Well..
Here it is..
Playing around this afternoon we see:
code:
$tst=1
$tst2=3
$tst3=(0.+$tst)/$tst2
? $tst3
$tst3=cdbl($tst3)*100
? $tst3
$tst3=split($tst3,'.')[0]+'.'+left(split($tst3,'.')[1],2)
? $tst3
get $
And, we could expand on this:
code:
CLS
BREAK ON
COLOR g+/n
$script='pu.kix'
?'Press anykey to start test (open '+$script+', READ & display lines, CLOSE..'
GET $x
$result=1
IF exist('@scriptdir\'+$script)
$result=open(1,'@scriptdir\'+$script)
ELSE
BEEP
? "Sorry, pu.kix appears to be missing."
SLEEP 3
EXIT
ENDIF
$maxi=1
$i=1
IF $result = 0
$maxline = readline(1)
WHILE @error = 0
$maxline
$maxline = readline(1)
$maxi=$maxi+1
LOOP
$result=close(1)
$maxi=cdbl($maxi-1)
ENDIF
$i=cdbl($i)
$result = open(1,'@scriptdir\'+$script)
IF $result = 0
$line = readline(1)
WHILE @error = 0
$pct=cdbl(($i/$maxi)*100)
IF len(split($pct,'.')[1])>2
$pct=LEFT($pct,5)
ENDIF
COLOR w/n
?'Line '+$i+'/'+$maxi+' read of '+$pct+'% done: ['
COLOR w+/n
$line
COLOR w/n
']'
$line=readline(1)
$i=$i+1
LOOP
$result=close(1)
ELSE
BEEP
?'Sorry, failed to open '+$script+', errorcode : ['+@error+']'
ENDIF
GET $
Cheers!
Kent