<?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 auto update of shape area in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/auto-update-of-shape-area/m-p/608084#M4395</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to create a layer definition for a shapefile. when a new shape is created and the editform opens, iwant the area to be automatically placed into an edit control. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have put the following scripts into the OnLoad event, but when i run arcpad to test the code i get the following error message: "Microsoft VBScript compilation error, Syntax error, [line 1 column 1] Source Text Unavaliable"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what can i do to make it running... tks!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub UpdateChgCode(pCode)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Set the value of the last field to pCode&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If Map.SelectionLayer Is Nothing Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pRS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pRS = Map.SelectionLayer.Records&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRS.Bookmark = Map.SelectionBookmark&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRS.Fields(pRS.Fields.Count).Value = pCode&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Get the polygons area&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pPoly&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pPoly = pRs.Fields.Shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRs.Fields("Shape_area").Value = pPoly.Area&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Get the edit control and set its value to the area of the new polygon&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pAreaControl, pAreaValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pAreaControl = Layers("Historic Foundation").Forms("EditForm").Pages("attributePage").Controls("txtSHAPE_Area")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pAreaControl.Value = pPoly.Area&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRS.Update&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pRS = Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 May 2010 23:13:25 GMT</pubDate>
    <dc:creator>ChangLiu</dc:creator>
    <dc:date>2010-05-20T23:13:25Z</dc:date>
    <item>
      <title>auto update of shape area</title>
      <link>https://community.esri.com/t5/arcpad-questions/auto-update-of-shape-area/m-p/608084#M4395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to create a layer definition for a shapefile. when a new shape is created and the editform opens, iwant the area to be automatically placed into an edit control. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have put the following scripts into the OnLoad event, but when i run arcpad to test the code i get the following error message: "Microsoft VBScript compilation error, Syntax error, [line 1 column 1] Source Text Unavaliable"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what can i do to make it running... tks!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub UpdateChgCode(pCode)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Set the value of the last field to pCode&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If Map.SelectionLayer Is Nothing Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pRS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pRS = Map.SelectionLayer.Records&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRS.Bookmark = Map.SelectionBookmark&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRS.Fields(pRS.Fields.Count).Value = pCode&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Get the polygons area&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pPoly&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pPoly = pRs.Fields.Shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRs.Fields("Shape_area").Value = pPoly.Area&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Get the edit control and set its value to the area of the new polygon&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pAreaControl, pAreaValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pAreaControl = Layers("Historic Foundation").Forms("EditForm").Pages("attributePage").Controls("txtSHAPE_Area")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pAreaControl.Value = pPoly.Area&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pRS.Update&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pRS = Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 May 2010 23:13:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/auto-update-of-shape-area/m-p/608084#M4395</guid>
      <dc:creator>ChangLiu</dc:creator>
      <dc:date>2010-05-20T23:13:25Z</dc:date>
    </item>
  </channel>
</rss>

