IonicWind Software

IWBasic => GUI Central => Topic started by: paja on January 19, 2011, 04:42:35 PM

Title: USING command ?
Post by: paja on January 19, 2011, 04:42:35 PM
Hi,

Can anybody explain USIND command ? In the help file is almost nothing.
I need format number in range 0 to 9999 to 0,00 - 99,99.

Paja
Title: Re: USING command ?
Post by: billhsln on January 19, 2011, 05:10:29 PM
In the Help, see:  General Programming, then Formatting Output.  That is where the description is.

Hope that helps,
Bill
Title: Re: USING command ?
Post by: paja on January 19, 2011, 05:53:38 PM
This works OK

def test:string
def test_1:INT
def win_error:window

openwindow win_error,300,150,260,250,@BORDER,0,"DEVICE ERRORS",&hndr

test_1 = 221
test = USING("0####", test_1)
print win_error, test

---------------------------------------------------------------------------

but this will return     0.00  - all digits zero

def test:string
def test_1:INT
def win_error:window

openwindow win_error,300,150,260,250,@BORDER,0,"DEVICE ERRORS",&hndr

test_1 = 221
test = USING("0##.##", test_1)
print win_error, test
Title: Re: USING command ?
Post by: LarryMc on January 19, 2011, 06:12:27 PM
Quote from: paja on January 19, 2011, 04:42:35 PM
I need format number in range 0 to 9999 to 0,00 - 99,99.
I believe this does exactly what you asked for:
int x,l,r
x=9999
int l= x/100
int r=x%100
if l < 10
print USING("0#",l)+","+USING("0##",r)
else
print USING("0##",l)+","+USING("0##",r)
endif


LarryMc
Title: Re: USING command ?
Post by: paja on January 19, 2011, 11:30:49 PM
Larry,

Very nice  !

Thanks