11-28-2012, 09:25 AM
Hi Boriel!
I just ran into a bug with this code:
Without Optimiser or at level 1 or 2 it displays the correct value (13), but with Optimiser level 3 it runs through all the strings aot finding the correct one, so the output is 255 which here means "code not found".
I just ran into a bug with this code:
Code:
paper 7:ink 0:border 7:cls
Function code2level() as ubyte
dim adr as uinteger
dim count as ubyte
adr=@buffer
count=0
do
if not (peek(Uinteger,adr)-peek(Uinteger,@inpstring+3)+peek(Uinteger,adr+2)-peek(Uinteger,@inpstring+5)+peek(Uinteger,adr+4)-peek(Uinteger,@inpstring+7))
goto passok
Else
count=count+1:adr=adr+6
end if
loop until count=32
count=255
passok:
return count
end function
print code2level()
End
inpstring:
asm
defb 1,1,56
defm "Leveld"
end asm
buffer:
asm
defm "Level1"
defm "Level2"
defm "Level3"
defm "Level4"
defm "Level5"
defm "Level6"
defm "Level7"
defm "Level8"
defm "Level9"
defm "Level0"
defm "Levela"
defm "Levelb"
defm "Levelc"
defm "Leveld"
defm "Levele"
defm "Levelf"
defm "Levelg"
defm "Levelh"
defm "Leveli"
defm "Levelj"
defm "Levelk"
defm "Levell"
defm "Levelm"
defm "Leveln"
defm "Levelo"
defm "Levelp"
defm "Levelq"
defm "Levelr"
defm "Levels"
defm "Levelt"
defm "Levelu"
defm "Levelv"
end asm
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!