i need some help on a program I'm making
I've got three variables, for example:
ipa% = 0
ipb% = 1
ipc% = 5
these 3 are defined by the user of the program
this had to become:
ipaa$ = 15
I wondered if you could help me, thanks
Bart
If you're looking to manipulate variables, you can always check out the SWAP
statement for swapping variable contents, or STR$ for converting an integer
variable into a string. Conversely, you can use VAL to convert a string value
into an integer. Examples:
A = 5, B = 6
SWAP(A, B)
now, A = 6 and B = 5
A = 5, STR$(A) = "5"
A$ = "5", VAL(A$) = 5
cheers,
Brendon
Be distinct, or be extinct.
http://members.aol.com/brainsawx
I think the program you are looking for is:
CLS
ipa% = 0
ipb% = 1
ipc% = 5
ipa$ = STR$(ipa%)
ipb$ = STR$(ipb%)
ipc$ = STR$(ipc%)
PRINT ipa%, ipb%, ipc%
PRINT ipa$, ipb$, ipc$
ipaa$ = LTRIM$(ipa$) + LTRIM$(ipb$) + LTRIM$(ipc$)
ipaa% = VAL(ipaa$)
PRINT ipaa$, ipaa%
The print out is:
0 1 5
0 1 5
015 15
CLS
ipa% = 0
ipb% = 1
ipc% = 5
ipaa$ = STR$(ipa% * 100 + ipb% * 10 + ipc%)
PRINT ipaa$
Note this example looses the zero at the start as requested.