Nifty function required
Darren Reely
darren.reely at latticesemi.com
Thu Dec 15 11:59:22 CST 2005
Fernando,
Here is one wacky way to do it. Since 10 characters can only hold
nn,nnn,nnn in a standard format, you only require two lines. One for
each possible comma.
def a char*10 = "1,234,567"
define a2 char*10 = a[1:index(a, ',') - 1] &
+ a[index(a, ',') + 1 : 10]
define a3 char*10 = a2[1:index(a2, ',') - 1] &
+ a2[index(a2, ',') + 1 : 10]
report a a3
Darren.
fernando.olmos at hpa.com.au wrote:
> Hi gang,
>
> To save me re-inventing the wheel (and I won't take the credit - I
> promise!), I need a set of defines that will strip off comma characters
> "," from a field with numerics.
>
> i.e. def a char*10 = "1,234"
> def b = ncon(a)
> rep b
>
> this gives ZERO
>
> obviously, what I need is to report... 1234 and not 0.
>
> I can do it with ten defines and later concatenating them into a single
> define, then later converting that to a numeric, but there could be a
> "one line" solution? ;)
>
> Thanks
>
> /Fernando Olmos/
> *MIS*
> *Senior Analyst Programmer*
>
> *HPA***
> Direct: 03 9217 5411
> Mobile: 0410 382 857
> Fax: 03 9217 5716
>
> ___*www.hpa.com.au*_
> <file:///H:/Appdata/Microsoft/Signatures/www.hpa.com.au>
>
>
> **********************************************************************
> IMPORTANT
> The contents of this e-mail and its attachments are confidential and intended
> solely for the use of the individual or entity to whom they are addressed. If
> you received this e-mail in error, please notify the HPA Postmaster, postmaster at hpa.com.au,
> then delete the e-mail.
> This footnote also confirms that this e-mail message has been swept for the
> presence of computer viruses by Ironport. Before opening or using any
> attachments, check them for viruses and defects.
> Our liability is limited to resupplying any affected attachments.
> HPA collects personal information to provide and market our services. For more
> information about use, disclosure and access see our Privacy Policy at
> www.hpa.com.au
> **********************************************************************
>
More information about the powerh-l
mailing list