Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Re: Help on DCL
       [not found] <7dfjj9$mlt$1@m5.att.net.hk>
  1999-03-26  5:00 ` Help on DCL hammond
@ 1999-03-26  5:00 ` sol gongola
  1999-03-26  5:00 ` Carl Perkins
  2 siblings, 0 replies; 3+ messages in thread
From: sol gongola @ 1999-03-26  5:00 UTC (permalink / raw)


Haven't got a system or mnual nearby but you use the lexical 
to edit a string and remove commas from it. then you do the 
number conversion


> Dear all,
> 
> Anyone can advise how to use the lexical function to suppress "," so
> that I can
> convert the numberic string into figure for caluation.
> i.e. read from file that contain 1,234,445,233 convert to 1234445223.
> 
> Thanks !
> 
> --
> Where were you in '82 ?
> I was in France, where were you ?
> I was in school, where was Lou ?
> Lou wasn't born in '82 :P



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help on DCL
       [not found] <7dfjj9$mlt$1@m5.att.net.hk>
@ 1999-03-26  5:00 ` hammond
  1999-03-26  5:00 ` sol gongola
  1999-03-26  5:00 ` Carl Perkins
  2 siblings, 0 replies; 3+ messages in thread
From: hammond @ 1999-03-26  5:00 UTC (permalink / raw)



In article <7dfjj9$mlt$1@m5.att.net.hk>, 
"Forest Gum" <Trishgoff@hotmail.com> writes:
>Anyone can advise how to use the lexical function to suppress "," so =
>that I can
>convert the numberic string into figure for caluation.
>i.e. read from file that contain 1,234,445,233 convert to 1234445223.

$ x = "123,456,789"
$ x = x - "," - "," - "," - "," - ","
$ sho sym x
  X = "123456789"
$ x = f$integer(x)
$ sho sym x
  X = 123456789   Hex = 075BCD15  Octal = 00726746425

NOTE: "Subtracting" more commas than exist is O.K.

-- 
    Charlie Hammond -- Compaq Computer Corporation -- Pompano Beach  FL USA
           (hammond@peek.enet.dec.com -- remove "@not" when replying)
      All opinions expressed are my own and not necessarily my employer's.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help on DCL
       [not found] <7dfjj9$mlt$1@m5.att.net.hk>
  1999-03-26  5:00 ` Help on DCL hammond
  1999-03-26  5:00 ` sol gongola
@ 1999-03-26  5:00 ` Carl Perkins
  2 siblings, 0 replies; 3+ messages in thread
From: Carl Perkins @ 1999-03-26  5:00 UTC (permalink / raw)


"Forest Gum" <Trishgoff@hotmail.com> writes...
}Anyone can advise how to use the lexical function to suppress "," so =
}that I can
}convert the numberic string into figure for caluation.
}i.e. read from file that contain 1,234,445,233 convert to 1234445223.

Try this:

$ A = "1,234,445,233"
$ B = A -","-","-","
$ Write Sys$Output B
$ Write Sys$Output B+1

It subtracts up to 3 "," from A when making B. If A has fewer than 3, the
excess subtractions do not do anything. If A can have more, you might want
to do more than 3 (but you won't be able to do any math with the result
since DCL uses 32 bit signed integers which would never have more than 3
of them).

--- Carl



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-03-26  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <7dfjj9$mlt$1@m5.att.net.hk>
1999-03-26  5:00 ` Help on DCL hammond
1999-03-26  5:00 ` sol gongola
1999-03-26  5:00 ` Carl Perkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox