Select to view content in your preferred language

ArcPad 10 Script Error

4701
7
05-14-2013 09:37 AM
GerardFinan
New Contributor
Hi,
I get a script error when starting a custom application in ArcPad 10. This occurs at the login screen. This same script ran without any error in ArcPad 8. This is the error I get:

Script Error 800A01A8
Error Source Unavailable
Error Description
Unavailable
[Line: 65, Column :5]
Source Text Unavailable

After I hit ok on the error box it disappears and I can enter my login info and everything else functions well. This happens on both a Trimble GeoXH 2008 and a GeoXH600, both with ArcPad 10.

This is the beginning of the script (Line 65 mentioned in the error is in bold text):

Option Explicit
On error resume next

  'exit flag
  Dim g_DoExit
  g_DoExit = False

  ''' <summary>
  ''' This sub launches when ArcPad opens, to get the master path to the ArcPad location
  ''' and and also laucnhes the log in form
  ''' </summary>
Sub StartupArcPad


  'Get the Path to the ArcPad application
  Dim strArcPadPath
  strArcPadPath = Application.Filepath

  'Strip off ArcPad.exe
  dim strApplicationPath
  strApplicationPath = Left(strArcPadPath,InStrRev(strArcPadPath,"\"))

  'Set the path to a global varaible for further use
  Application.UserProperties("AppPath")  = strApplicationPath

  'Launch the log in form
  Forms("Login").show

  'if exit flag is set - then quit
If (True = g_DoExit) Then
  Application.Quit
  Exit Sub
End If

End Sub

  ''' <summary>
  ''' Sets up the form for for the Login information
  ''' </summary>
Sub Loadform

  'Get the deviceID form the suplyed text file
  Dim strSystemPath
  Dim objDeviceFile
  Dim strDeviceID

  strSystemPath = Application.UserProperties("AppPath") & "System\"
  Set objDeviceFile = Application.CreateAppObject("file")

  'Check to see if the DeviceID.txt file is on the devide
  if objDeviceFile.Exists(strSystemPath & "DeviceID.txt") then
   
    'Read the file and set the Device ID
    objDeviceFile.Open strSystemPath & "DeviceID.txt"
    strDeviceID = objDeviceFile.ReadLine
  Else

    'The File is missing Set the Device ID to missing
    strDeviceID = "Device ID Missing See GIS Dept."
  End if

  'get the form and load the Device ID to the correct field
  'get a refference to this form
  Dim objLoginform
  Set objLoginform = Forms("Login") 

'Get a refference to the page and controls
  Dim objPage1
  Set objPage1 = objLoginform.Pages("PAGE1")

  'set the DeviceID controll to the proper value
  objPage1.Controls("txtDeviceID").Value = strDeviceID
   
 
End Sub

Thanks for any help solving this!
Regards
Raj1339
Tags (3)
0 Kudos
7 Replies
JamesNunn
Deactivated User
I know this is old, but I have the same problem. I don't think the custom script is the problem because all my loaded scripts contain a blank line 65.

I can't find any other reference to this issue, any ideas would be helpful.

Thanks
0 Kudos
ThaiTruong
Deactivated User
Hi James

Do you have the same code as the #1 post?
In ArcPad 10, Application.Filepath will return a full path to ArcPad.exe

So, Just below these lines:
'Set the path to a global varaible for further use
 Application.UserProperties("AppPath") = strApplicationPath


Try to print out this global variable (AppPath) to make sure it's a correct path that you want to use.
MsgBox (strApplicationPath)
0 Kudos
JamesNunn
Deactivated User
I am not using the same code - I'm using an edited version of the Login form applet found here: http://arcscripts.esri.com/details.asp?dbid=16477.

Using the login applet as provided above, the error is actually at Line 61 Column 4. I'll wait to post my own code because it is oft-changing and also I don't want to put up an entire project here just yet.

Thanks
0 Kudos
ThaiTruong
Deactivated User
James,

The ArcPad Login Form from above link worked for me.  I did not get any errors with ArcPad 10.0.4
Here is what I just did:
1. Extract the zip file to Applets folder (C:\Users\Public\Documents\ArcPad\Applets)
2. Open up ArcPad application and and set the path to Applets to the above directory.
3. Restart ArcPad, I've got a login form.  Selected a user from drop down list.
4. Back to Arcpad Studio, checked to see if "LoggedInEmployee" is available by go to ArcPad >> Send Script and type in
MsgBox (Application.UserProperties("LoggedInEmployee"))
Hit "OK"
5.  I've got a username return in a message box.

You might have to double check your implementation!
0 Kudos
JamesNunn
Deactivated User
I followed exactly that method, extract zip to applets folder, set the applet path to that folder. The global variable is set correctly, as are all the others I set in my app.
The error appears before any user input, and only when an applet is being loaded. Strange behaviour, but like the OP, there appears to be no other adverse effects on the application. It wouldn't bother me but it's just something else I have to tell our surveyors to 'just ignore that error box - I can't get rid of it'.
0 Kudos
ThaiTruong
Deactivated User
Hi James,

Review Application::OnStartup event and  Applet::Onload event to see if you have code under those two events.
0 Kudos
JamesNunn
Deactivated User
From the Login applet:

APPLET
   |-- onload=Call LoadLoginForm()
0 Kudos