Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
not at all,
this was what I stumbled over (or similar):
take my last working with 303 :
function a($)
dim $s
$s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
$a = "" + $a + $ + " is "
if four=$ | 4=$
$a = $a + magic.
else
if $>99
$ = $s[($^)+25-(($^)>7&instr($,y)>)]
else
$ = $s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)
endif
$a = $a + $ + ". " + a($)
endfunction
replacing with an iif() in line 11 (one stroke less) fails with array ref out of bounds if $ > 37 (set $verbose to 2):
function a($)
dim $s
$s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
$a = "" + $a + $ + " is "
if four=$ | 4=$
$a = $a + magic.
else
if $>99
$ = $s[($^)+25-(($^)>7&instr($,y)>)]
else
$ = iif($<20, $s[$], $s[$/10+18]+($ mod 10>)*$s[$ mod 10])
;$s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)
endif
$a = $a + $ + ". " + a($)
endfunction
Still can't explain that..
_________________________
|