4019
4019
4019
but instead I get:
4076
4019
4019
Seems very strange, has anyone else had this problem? Is there reason for this type of behaviour? Is it generally safe to nest up functions like this or better to keep them seperate? This is the first time I have hit a problem with nested functions in purebasic.....
Code: Select all
OpenConsole()
ClearConsole()
;part one, using Trim within nested statement
ECDAR=0
ECDAR=ECDAR + Val(Trim(Mid("N4019 ",2,10)))
PrintN(Str(ECDAR))
;part two, remove trim completely
ECDAR=0
ECDAR=ECDAR + Val(Mid("n4019 ",2,10))
PrintN(Str(ECDAR))
;part three, break nested statement into seperate lines
ECDAR=0
ECDARS.s=""
ECDARS = Mid("n4019 ",2,10)
ECDARS=Trim(ECDARS)
ECDAR=Val(ECDARS)
PrintN(Str(ECDAR))
;part4, keep on screen until key is pressed
PrintN("(Press a key to exit)")
Repeat
Until Inkey()
CloseConsole()