reading data inside a procedure - why will this not work?
Posted: Thu Aug 12, 2010 10:39 am
Very new here so please be nice! I've used arrays before so I know i'm doing something right but...
I have a text file that I am reading strings from into an array which works fine.
But when I put code inside a procedure it complains about my arrary not being recognised.
Below is just a simple example of what I mean inside a procedure:
Now here it is outside the procedure which works fine:
I know i'm about to be embarassed here so I await your humbling words.. 
I have a text file that I am reading strings from into an array which works fine.
But when I put code inside a procedure it complains about my arrary not being recognised.
Below is just a simple example of what I mean inside a procedure:
Code: Select all
Dim A$(4)
Procedure ReadIt()
Restore StringData
For R=0 To 4
Read.s Dat$ : A$(R)=Dat$
Debug (R)
Next R
EndProcedure
ReadIt()
End
DataSection
StringData:
Data.s "Hello", "This", "is ", "my","data"
EndDataSection
Code: Select all
Dim A$(4)
Restore StringData
For R=0 To 4
Read.s Dat$ : A$(R)=Dat$
Debug A$(R)
Next R
End
DataSection
StringData:
Data.s "Hello", "This", "is ", "my","data"
EndDataSection
