<?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: VBS: Carry variable value between layer forms in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374190#M2704</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Aaron,&lt;BR /&gt;I can't tell from your posting if you have two separate script files. Have you tried using a global variable &lt;BR /&gt;Application.UserProperties("Variablename") that you define in the first script? Set the value in the child form and you should be able to read it when the child attachment form closes. &lt;BR /&gt;&lt;BR /&gt;In one script, I have defined:&lt;BR /&gt;Application.UserProperties("SRLayerName") = "SRLayerName"&lt;BR /&gt;&lt;BR /&gt;In another script, I use that variable:&lt;BR /&gt;If LCaseCompare(Application.Map.SelectionLayer.Name, Application.UserProperties("SRLayerName")) Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_ServiceReqTreatment = True&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;This will also work if both forms are in one script-- just define the variable as global.&lt;BR /&gt;&lt;BR /&gt;Is there a reason why you don't want to get the data from the record for the child feature? Can you query the child feature based on the ID?&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I actually ended up Googling around a few hours after I posted this and stumbled onto this very method (Application.UserProperties("Variablename") ) of saving variable information and it worked perfectly. Solved a very crucial and valuable problem for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So thank you very much for the great response Chris!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This might be basic to the VBS vets but like I said, I'm new to it. Re: your second suggestion: Probably another basic. I have the query techniques licked from my CAD scripting experience, but I am still getting used to the way you access objects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again Chris! You da man!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Mar 2013 01:24:16 GMT</pubDate>
    <dc:creator>AaronAmbrose</dc:creator>
    <dc:date>2013-03-01T01:24:16Z</dc:date>
    <item>
      <title>VBS: Carry variable value between layer forms</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374188#M2702</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;BR /&gt;&lt;SPAN&gt;I am new here, and am fairly new to VBS scripting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My situation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a master layer feature which retrieves info surveyed on utility poles. The collection template required to collect all the information on a busy pole is staggering. I have been playing with different strategies for years now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I am now creating a variation where - once you come to the different pole attachments, at the activation of a button on the main pole form, a new form from a different layer pops up to gather the values of that specific attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The new attachment feature is placed smack dab over the main pole block - as a separate element.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Once all the survey is collected, all the poles shapes and their sub-component shapes are imported to CAD where I have created a set of routines to associate and develop the total product.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To link the parent pole feature with the child attachment feature, I am using a Unique ID created with the auto-increment feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The barrier I have right now, is trying to grab a value from the child feature/form and carry it back over to the parent pole script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So far, I have it so that everything works: the pole script keeps running after I return back to the pole, but I don't know how to switch the script focus to the child feature to grab info.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I totally understand all the concepts of VBS - as I am a CAD lisp guru. But the language and methods are still foreign to me. So my problem may be something really simple such as not defining the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;object&lt;/SPAN&gt;&lt;SPAN&gt; in the subform correctly). Or, it could be that I am trying to do something near impossible; don't really know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I read about the 'Evaluate' method required to access values between layer scripts, and tried to apply it, but I had no luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is NO way to do this, I assume I can accomplish my goal by writing to (and reading from) an external cvs file, but that could end up being quite complicated given the different things I need to do. And again, something else I will have to learn the code for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, am I missing something easy here? I just need direction or a code example for the part where you switch focus to the new form and access one of its controls.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to whoever can help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 11:47:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374188#M2702</guid>
      <dc:creator>AaronAmbrose</dc:creator>
      <dc:date>2013-02-28T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: VBS: Carry variable value between layer forms</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374189#M2703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Aaron,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't tell from your posting if you have two separate script files. Have you tried using a global variable &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Application.UserProperties("Variablename") that you define in the first script? Set the value in the child form and you should be able to read it when the child attachment form closes. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In one script, I have defined:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Application.UserProperties("SRLayerName") = "SRLayerName"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In another script, I use that variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If LCaseCompare(Application.Map.SelectionLayer.Name, Application.UserProperties("SRLayerName")) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_ServiceReqTreatment = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will also work if both forms are in one script-- just define the variable as global.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a reason why you don't want to get the data from the record for the child feature? Can you query the child feature based on the ID?&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;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 20:45:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374189#M2703</guid>
      <dc:creator>ChrisSeabrooke</dc:creator>
      <dc:date>2013-02-28T20:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: VBS: Carry variable value between layer forms</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374190#M2704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Aaron,&lt;BR /&gt;I can't tell from your posting if you have two separate script files. Have you tried using a global variable &lt;BR /&gt;Application.UserProperties("Variablename") that you define in the first script? Set the value in the child form and you should be able to read it when the child attachment form closes. &lt;BR /&gt;&lt;BR /&gt;In one script, I have defined:&lt;BR /&gt;Application.UserProperties("SRLayerName") = "SRLayerName"&lt;BR /&gt;&lt;BR /&gt;In another script, I use that variable:&lt;BR /&gt;If LCaseCompare(Application.Map.SelectionLayer.Name, Application.UserProperties("SRLayerName")) Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_ServiceReqTreatment = True&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;This will also work if both forms are in one script-- just define the variable as global.&lt;BR /&gt;&lt;BR /&gt;Is there a reason why you don't want to get the data from the record for the child feature? Can you query the child feature based on the ID?&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I actually ended up Googling around a few hours after I posted this and stumbled onto this very method (Application.UserProperties("Variablename") ) of saving variable information and it worked perfectly. Solved a very crucial and valuable problem for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So thank you very much for the great response Chris!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This might be basic to the VBS vets but like I said, I'm new to it. Re: your second suggestion: Probably another basic. I have the query techniques licked from my CAD scripting experience, but I am still getting used to the way you access objects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again Chris! You da man!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 01:24:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374190#M2704</guid>
      <dc:creator>AaronAmbrose</dc:creator>
      <dc:date>2013-03-01T01:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: VBS: Carry variable value between layer forms</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374191#M2705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, now you are really gonna see how new I am to this forum; I can't - for the life of me - find where you click the green icon to indicate that this question is solved. How annoying!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 01:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-carry-variable-value-between-layer-forms/m-p/374191#M2705</guid>
      <dc:creator>AaronAmbrose</dc:creator>
      <dc:date>2013-03-01T01:42:21Z</dc:date>
    </item>
  </channel>
</rss>

