PDA

View Full Version : Usage of the STR$ Keyword



Michael Clease
28-05-2007, 13:31
' Usage of the STR$ Keyword example
'
' Written by Abraxas

DIM s AS STRING
DIM numeric_expression AS DWORD VALUE 1234567890
DIM digits AS DWORD VALUE 10
DIM sMsg AS STRING

s = STR$(numeric_expression, digits)

sMsg += "STR$(numeric_expression [, digits]) = " & s & $CRLF

MSGBOX 0, sMsg

ErosOlmi
28-05-2007, 14:35
I will replace with the following:


' Usage of the STR$ Keyword example
'
' Written by Abraxas

DIM numeric_expression AS ext VALUE 123.4567890123456
DIM digits AS DWORD
DIM sMsg AS STRING

sMsg += "Different STR$(numeric_expression, digits) of " & numeric_expression & $crlf
sMsg += "Digits will be from 1 to 18" & $crlf & $crlf

for digits = 1 to 18
sMsg += "Digit = " & digits & " Result: " & STR$(numeric_expression, digits) & $CRLF
next

MSGBOX 0, sMsg


It's ok?

Michael Clease
28-05-2007, 14:38
yours looks better.