<?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 Script for ArcPad Studio to enter current system time in textbox in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296901#M2138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would love it if someone had some script code that I can use for the onsetfocus event for a text box that would enter the system time.&amp;nbsp; Currently the Date control only enters the date and not the current time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want is for the system time in hours:minutes to be entered into the control when I tap it.&amp;nbsp; If I tap it a second time it would clear the control then enter the new time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pat&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2011 18:46:59 GMT</pubDate>
    <dc:creator>PatrickMurphy</dc:creator>
    <dc:date>2011-06-10T18:46:59Z</dc:date>
    <item>
      <title>Script for ArcPad Studio to enter current system time in textbox</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296901#M2138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would love it if someone had some script code that I can use for the onsetfocus event for a text box that would enter the system time.&amp;nbsp; Currently the Date control only enters the date and not the current time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want is for the system time in hours:minutes to be entered into the control when I tap it.&amp;nbsp; If I tap it a second time it would clear the control then enter the new time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pat&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 18:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296901#M2138</guid>
      <dc:creator>PatrickMurphy</dc:creator>
      <dc:date>2011-06-10T18:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script for ArcPad Studio to enter current system time in textbox</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296902#M2139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I would love it if someone had some script code that I can use for the onsetfocus event for a text box that would enter the system time.&amp;nbsp; Currently the Date control only enters the date and not the current time.&lt;BR /&gt;&lt;BR /&gt;What I want is for the system time in hours:minutes to be entered into the control when I tap it.&amp;nbsp; If I tap it a second time it would clear the control then enter the new time.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pat&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RElated to this is a basic characteristic of the vb script implementation.&amp;nbsp; I assume when I am in ArcPad studio and I have a control that I want to trigger an event for, there is an event script box right below the event selection area.&amp;nbsp; Can I enter code directly here, or is this just supposed to reference and external .vbs file?&amp;nbsp; I though there was an indication in the instructions that I could enter code right here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The field is called Time and the control name is nowtime&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is some code that I have tried without success.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nowtime = FormatDateTime(Now(), DateFormat.Shorttime) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Time = FormatDateTime(Now(), DateFormat.Shorttime) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nowtime = FormatDateTime(Now(), 4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Teststring = FormatDateTime(Now(), DateFormat.Shorttime) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nowtime = "teststring"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Typically I will either get no response when I tap the control, or an error that points to one of the lines and says "Source Text unavailable"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Jun 2011 16:11:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296902#M2139</guid>
      <dc:creator>PatrickMurphy</dc:creator>
      <dc:date>2011-06-11T16:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script for ArcPad Studio to enter current system time in textbox</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296903#M2140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is the code that worked.&amp;nbsp; I got this from another forum called Experts Exchange that I belong to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code goes in the Script box associated with the gotfocus event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set objControl = ThisEvent.Object &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Teststring = FormatDateTime(Now(), 4) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;objControl.Value = teststring&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The format options are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' 0 = vbGeneralDate - mm/dd/yy hh:mm:ss PM/AM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' 1 = vbLongDate - weekday, month name, year&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' 2 = vbShortDate - mm/dd/yy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' 3 = vbLongTime - hh:mm:ss PM/AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' 4 = vbShortTime - hh:mm&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2011 14:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-for-arcpad-studio-to-enter-current-system/m-p/296903#M2140</guid>
      <dc:creator>PatrickMurphy</dc:creator>
      <dc:date>2011-06-12T14:46:01Z</dc:date>
    </item>
  </channel>
</rss>

