HP3000-L Archives

December 2004, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Vance, Jeff H (Cupertino)" <[log in to unmask]>
Reply To:
Vance, Jeff H (Cupertino)
Date:
Thu, 16 Dec 2004 18:20:28 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
...
> !/NTP/V0401000/NTPDATE '-q 192.168.1.1' > TEMPFILE
> !PRINT TEMPFILE;END=1 > TEMPLINE
> !INPUT TEMPLINE < TEMPLINE
> !CALC WORD('!TEMPLINE',,6)
> !IF ABS(!HPRESULT) > 60
> and where is where I get stuck with:
> IF ABS(-7.319336) > 60
>         ^
> Unexpected character found in number. (CIERR 9810)

HPRESULT is a string in this example, though it can be an integer or
Boolean.
The fact that !HPRESULT was used to retrieve its value (explicit
referencing) vs. just using IF ABS(HPRESULT) > 60, causes the type of
HPRESULT to be lost.  So in this case the ABS function sees -7.319336
which won't work since the CI expects all numbers to be integers. 

You'll need to write your own real -> integer CI script or perhaps
choose a scripting tool adept at reals. A possible real -> int CI script
could look like:

setvar _real "!realParm"
if setvar(_decpt,pos(".",_real)) > 0 then
   setvar _real _real+"0"
   setvar _whole ![lft(_real,_decpt-1)]
   setvar _frac str(_real,_decpt+1,1)
   if !_frac >= 5 then
      setvar _whole _whole+1
   endif
endif


hope this helps,
 Jeff Vance, vCSY

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2