Nifty function required

fernando.olmos at hpa.com.au fernando.olmos at hpa.com.au
Thu Dec 15 17:13:33 CST 2005


Yep, this worked a treat!

At most, I would want to remove two commas from the numeric values, so
this did the trick perfectly. I knew the index() function would come
into it, but I thought I would save brain-cells and ask the Invention
Room, for an already nifty tool that could do it! hehehe

Thanks everyone

-----Original Message-----
From: darren.reely at latticesemi.com [mailto:darren.reely at latticesemi.com]

Sent: Friday, December 16, 2005 4:59 AM
To: Fernando Olmos
Cc: powerh-l at lists.sowder.com
Subject: Re: Nifty function required


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
> **********************************************************************
> 
**********************************************************************
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