<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reference file paths in script on Mobile Devices in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699482#M5074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tend to write my scripts using Preferences.Properties("AppletsPath") so it doesn't matter if the script is on Mobile or PC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jan 2012 19:43:31 GMT</pubDate>
    <dc:creator>GarethWalters</dc:creator>
    <dc:date>2012-01-12T19:43:31Z</dc:date>
    <item>
      <title>Reference file paths in script on Mobile Devices</title>
      <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699480#M5072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an Applet that automatically updates certain fields every time my user collects data. It was based on the XYZ+ script. My data is projected in UTM, but my users want to be able to record DMS as well. I found a script on the 15th page of &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://arcscripts.esri.com/Data/AS15207.pdf" rel="nofollow" target="_blank"&gt;http://arcscripts.esri.com/Data/AS15207.pdf&lt;/A&gt;&lt;SPAN&gt; that converts to DD.dddd. This is fine and it works great until I try and move it to my Nomad, because there is no C: drive. How do I reference a file at say "\\My Documents\gis\Coordinate System\NAD 1983 UTM Zone 15N.prj" ? "\" being the root directory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Sub FA&amp;nbsp; Set objRS = Map.Selectionlayer.Records objRS.Bookmark = ThisEvent.Bookmark&amp;nbsp; 'define coordinate systems Set pLLCS = Application.CreateAppObject( "CoordSys" ) Set pMCS = Application.CreateAppObject( "CoordSys" )&amp;nbsp; 'Set up Coordinate Systems&amp;nbsp; \\\\\-----This is where the problem is-----/////////// pMCS.Import("\\My Documents\gis\Coordinate System\NAD 1983 UTM Zone 15N.prj") pLLCS.Import("\\My Documents\gis\Coordinate System\North American Datum 1983.prj")&amp;nbsp;&amp;nbsp; 'Create Map Points and assign coordinate systems Set pMapPt = Application.CreateAppObject("Point") Set pLLPt = Application.CreateAppObject("Point") Set pMapPt.CoordinateSystem = pMCS Set pLLPt.CoordinateSystem = pLLCS 'Set x/y values for original point pMapPt.X = objRS.Fields.Shape.X pMapPt.Y = objRS.Fields.Shape.Y 'transpose the coordinate to lat long Set pLLPt = pLLCS.Project(pMapPt)&amp;nbsp; For Each f in objRS.Fields&amp;nbsp; Select Case Ucase(f.name)&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; CASE "LATSTRING" &amp;nbsp;&amp;nbsp; f.Value = DMS(pLLpt.Y, "y") &amp;nbsp; CASE "LONSTRING" &amp;nbsp;&amp;nbsp; f.Value = DMS(pLLpt.X, "x") &amp;nbsp; End Select&amp;nbsp; Next objRS.Update&amp;nbsp; Set pMapPt = Nothing Set pLLPt = Nothing Set pMCS = Nothing Set pLLCS = Nothing Set objLyr = Nothing Set objRS = Nothing End Sub&amp;nbsp;&amp;nbsp; Function DMS(v, xy)&amp;nbsp; absV = abs(v)&amp;nbsp; degInt = Floor(absV)&amp;nbsp; min = multDenom(absV, degInt)&amp;nbsp; if xy = "x" then &amp;nbsp; degInt = degInt * -1&amp;nbsp; end if&amp;nbsp; minInt = Floor(min)&amp;nbsp; sec = round(multDenom(min, minInt),4)&amp;nbsp; DMS = degInt &amp;amp; " " &amp;amp; minInt &amp;amp; " " &amp;amp; sec&amp;nbsp;&amp;nbsp; End Function&amp;nbsp; Function Floor(d)&amp;nbsp; dTmp = Round(d)&amp;nbsp; if dTmp &amp;gt; d then &amp;nbsp; dTmp = dTmp - 1&amp;nbsp; End if&amp;nbsp; Floor = dTmp&amp;nbsp; End Function Function multDenom(d, dInt)&amp;nbsp; d = d - dInt&amp;nbsp; multDenom = d*60&amp;nbsp; End Function&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; The code works fine. I just want to include it in case anyone else is trying to do the same thing, or has suggestions on more efficient way.&amp;nbsp; On the desktop I just change 2 lines to: &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;'Set up Coordinate Systems&amp;nbsp; pMCS.Import("C:\Program Files (x86)\ArcGIS\ArcPad10.0\Coordinate System\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone 15N.prj")&amp;nbsp; pLLCS.Import("C:\Program Files (x86)\ArcGIS\ArcPad10.0\Coordinate System\Geographic Coordinate Systems\North America\North American Datum 1983.prj")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; So how do I reference paths on mobile devices that do not have a root drive letter?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 15:15:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699480#M5072</guid>
      <dc:creator>JasonTipton</dc:creator>
      <dc:date>2012-01-11T15:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reference file paths in script on Mobile Devices</title>
      <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699481#M5073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Found the answer: &lt;/SPAN&gt;&lt;A href="http://social.msdn.microsoft.com/forums/en-US/netfxcompact/thread/3e73293d-eda5-43b0-8018-a19144643922/"&gt;http://social.msdn.microsoft.com/forums/en-US/netfxcompact/thread/3e73293d-eda5-43b0-8018-a19144643922/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, "\" is the root drive. I was on the right track, but instead of "\\" use "\" so change&lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;"\\My Documents"&lt;/PRE&gt;&lt;SPAN&gt; to&lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;"\My Documents"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 13:59:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699481#M5073</guid>
      <dc:creator>JasonTipton</dc:creator>
      <dc:date>2012-01-12T13:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reference file paths in script on Mobile Devices</title>
      <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699482#M5074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tend to write my scripts using Preferences.Properties("AppletsPath") so it doesn't matter if the script is on Mobile or PC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 19:43:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699482#M5074</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2012-01-12T19:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reference file paths in script on Mobile Devices</title>
      <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699483#M5075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Jason,&lt;BR /&gt;&lt;BR /&gt;I tend to write my scripts using Preferences.Properties("AppletsPath") so it doesn't matter if the script is on Mobile or PC.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Gareth&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Gareth, I would assume that the above is only true when you keep to having only one path defined in your applets tag in the config file and not as below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;PATHS public="C:\Users\Public\Documents\ArcPad" data="C:\Temp\Data" applets="C:\Temp\Applets1;C:\Temp\Applets2" styles="" extensions="" templates=""/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rolf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2012 11:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699483#M5075</guid>
      <dc:creator>RolfBroch</dc:creator>
      <dc:date>2012-01-16T11:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reference file paths in script on Mobile Devices</title>
      <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699484#M5076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Gareth, I would assume that the above is only true when you keep to having only one path defined in your applets tag in the config file and not as below&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;PATHS public="C:\Users\Public\Documents\ArcPad" data="C:\Temp\Data" applets="C:\Temp\Applets1;C:\Temp\Applets2" styles="" extensions="" templates=""/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Rolf&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Rolf, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the property is indexed, I could use Preferences.Properties("AppletsPath",2) to get to a specific folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Standard ArcPAd Data Path reads: C:\Users\Gareth\Documents,C:\Users\Public\Documents\ArcPad&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Preferences.Properties("DataPath",2) would give me: C:\Users\Public\Documents\ArcPad&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 20:11:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699484#M5076</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2012-01-17T20:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reference file paths in script on Mobile Devices</title>
      <link>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699485#M5077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth, thanks for the information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I actually did not know that the value was indexed (although it clearly says so in the ArcPad Help) and this opens up new possibilities for referencing files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rolf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 05:13:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/reference-file-paths-in-script-on-mobile-devices/m-p/699485#M5077</guid>
      <dc:creator>RolfBroch</dc:creator>
      <dc:date>2012-01-19T05:13:25Z</dc:date>
    </item>
  </channel>
</rss>

