Welcome! Log In Create A New Profile

Advanced

Variable definition issue ?

Posted by damato68 
Variable definition issue ?
November 28, 2012 04:42PM
This is now fixed with a new version 2.06 - 69 that can be downloaded from here


Hi, writing code, I've loose time around the variable definition order:

function TestCrc()
dim appo$,ln
appo$="012345678"
ln=strlen(appo$)
print appo$
endf


This give ERROR (33) variable not found at (vlit) at runtime

Changing the variable definition order the problem don't appear
function TestCrc()
dim ln,appo$
appo$="012345678"
ln=strlen(appo$)
print appo$
endf


or another case:

function TestCrc()
  dim r,ln
  dim appo$[10]
  dim h$[1]="0"
  dim l$[1]="0"
  appo$ ="012345678"
  print appo$
endf

won't work but
function TestCrc()
  dim r,ln
  dim appo$[10]="012345678"
  dim h$[1]="0"
  dim l$[1]="0"
  print appo$
endf

is ok
anyone know the reason ?
I'm working with mBasic 2.06 201226067
My regards
Davide



Edited 4 time(s). Last edit at 11/30/2012 08:30PM by admin.
Re: Variable definition issue ?
November 28, 2012 04:58PM
yes, its a bug due to be fixed for next release.
Re: Variable definition issue ?
November 28, 2012 05:04PM
Thanks jimeer, you know workarounds ?
My regards
D-
Re: Variable definition issue ?
November 28, 2012 05:06PM
The workrounds are in your code above.
Sorry, you do not have permission to post/reply in this forum.