Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dim, redim
#1
Hi, i hav a prob with dim and redim, here's the code,

Code:
'dim/redim test
'
dim test(9) as ubyte

for i = 0 to 9
   test(i)=i
   print test(i);
next i

input j$
print

redim test(19) as ubyte

for i = 0 to 19
   test(i)=i+50
   print test(i);
next i

input j$
end

FB 0.12 & 0.13 give me the error (11) Duplicate definition, test..
but if you change 1st line to
Code:
redim test(9) as ubyte
,it work fine.

I apologise if some1 already posted about this.
Thanx..
00 character limit...
Reply
#2
add: 'option dynamic' into the beginning of your program :wink:
url]http://fbide.sourceforge.net/[/url]
Reply
#3
Thanx !!! Working now.
00 character limit...
Reply
#4
using REDIM the first time you declare an array makes it DYNAMIC, so able to be REDIMmed. If you first declare it with DIM, it makes it static, unless you put '$DYNAMIC: before it.
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)