<?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: Checking a String symbol for numerics in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984915#M34229</link>
    <description>Thanks Duncan.  I was going to write something similar but I was hoping for a lexical, etc. that would do what I wanted.&lt;BR /&gt;&lt;BR /&gt;Thanks, all, for the responses.</description>
    <pubDate>Tue, 13 Jun 2006 12:14:13 GMT</pubDate>
    <dc:creator>Stephen Daddona</dc:creator>
    <dc:date>2006-06-13T12:14:13Z</dc:date>
    <item>
      <title>Checking a String symbol for numerics</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984911#M34225</link>
      <description>Have any of you folks had the occasion to check a symbol of type STRING for all numerics? I need to do that. Using F$INTEGER returns a value of zero, but zero is a valid value in the data that I'm checking.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          thanks in advance</description>
      <pubDate>Mon, 12 Jun 2006 20:43:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984911#M34225</guid>
      <dc:creator>Stephen Daddona</dc:creator>
      <dc:date>2006-06-12T20:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Checking a String symbol for numerics</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984912#M34226</link>
      <description>How close does F$TYPE() come?&lt;BR /&gt;&lt;BR /&gt;HELP LEXICALS F$TYPE&lt;BR /&gt;&lt;BR /&gt;alp $ x = 123&lt;BR /&gt;alp $ wso f$type( x)&lt;BR /&gt;INTEGER&lt;BR /&gt;&lt;BR /&gt;alp $ x = "123"&lt;BR /&gt;alp $ wso f$type( x)&lt;BR /&gt;INTEGER&lt;BR /&gt;&lt;BR /&gt;alp $ x = "1o3"&lt;BR /&gt;alp $ wso f$type( x)&lt;BR /&gt;STRING&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984912#M34226</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-06-12T23:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Checking a String symbol for numerics</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984913#M34227</link>
      <description>You may also specify the radix, e.g.&lt;BR /&gt;$ A="ABC"&lt;BR /&gt;$ Write Sys$output F$Type(A)&lt;BR /&gt;STRING&lt;BR /&gt;$ A="%XABC"&lt;BR /&gt;$ Write SyS$Output F$Type(A)&lt;BR /&gt;INTEGER&lt;BR /&gt;&lt;BR /&gt;regards kALLE</description>
      <pubDate>Mon, 12 Jun 2006 23:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984913#M34227</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2006-06-12T23:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Checking a String symbol for numerics</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984914#M34228</link>
      <description>&lt;!--!*#--&gt;Craig,&lt;BR /&gt;&lt;BR /&gt;since you specify that you are starting with a STRING symbol, you can just examine each character in turn and check for a numeric. With a bit of work, you can also allow for negative numbers, leading/trailing spaces etc.&lt;BR /&gt;&lt;BR /&gt;Here is a simplistic sample&lt;BR /&gt;&lt;BR /&gt;$check_for_numeric: SUBROUTINE&lt;BR /&gt;$!&lt;BR /&gt;$! Check a supplied string for all numeric&lt;BR /&gt;$! sets $STATUS on exit&lt;BR /&gt;$! 1 = numeric&lt;BR /&gt;$! 2 = false&lt;BR /&gt;$! usage CALL CHECK_FOR_NUMERIC string_to_test&lt;BR /&gt;$ inp_string = p1&lt;BR /&gt;$ len_inp = f$length(inp_string)&lt;BR /&gt;$ inp_sub = 0&lt;BR /&gt;$char_loop:&lt;BR /&gt;$ test_char = f$extract(inp_sub,1,inp_string)&lt;BR /&gt;$ if test_char .lts. "0" -&lt;BR /&gt;.or. test_char .gts. "9"&lt;BR /&gt;$ then&lt;BR /&gt;$       exit 2&lt;BR /&gt;$ endif&lt;BR /&gt;$ inp_sub = inp_sub + 1&lt;BR /&gt;$ if inp_sub .lt. len_inp&lt;BR /&gt;$ then&lt;BR /&gt;$       goto char_loop&lt;BR /&gt;$ endif&lt;BR /&gt;$ exit 1&lt;BR /&gt;$ENDSUBROUTINE&lt;BR /&gt;&lt;BR /&gt;Duncan&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jun 2006 06:16:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984914#M34228</guid>
      <dc:creator>Duncan Morris</dc:creator>
      <dc:date>2006-06-13T06:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Checking a String symbol for numerics</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984915#M34229</link>
      <description>Thanks Duncan.  I was going to write something similar but I was hoping for a lexical, etc. that would do what I wanted.&lt;BR /&gt;&lt;BR /&gt;Thanks, all, for the responses.</description>
      <pubDate>Tue, 13 Jun 2006 12:14:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/checking-a-string-symbol-for-numerics/m-p/4984915#M34229</guid>
      <dc:creator>Stephen Daddona</dc:creator>
      <dc:date>2006-06-13T12:14:13Z</dc:date>
    </item>
  </channel>
</rss>

