str()
Purpose
Convert a value to a string
Description
Convert an integer or floating point number to a string
Syntax
result = str( int )
result = str( float )
Arguments
int int value to be converted
float floating point value to be converted
result string result
Example
hour = "00"
minute = "00"
second = "00"
size = 100.0
textSize( size )
loop
clear()
c = clock()
if c.hour < 10 then
hour = "0" + str( c.hour )
else
hour = str( c.hour )
endIf
if c.minute < 10 then
minute = "0" + str( c.minute )
else
minute = str( c.minute )
endIf
if c.second < 10 then
second = "0" + str( c.second )
else
second = str( c.second )
endIf
now = hour + ":" + minute + ":" + second
tw = textWidth( now )
drawText( ( gWidth() - tw ) / 2, ( gHeight() - size ) / 2, size, white, now )
update()
repeat
Associated Commands