DATA read problems... (FIXED!)
Posted: Tue Dec 31, 2024 10:11 am
If anyone can help me with this, I would most appreciate it...
Hi, I am slowly using my marbles due to DATA statements being (I think) totally unreliable. Let's take this code... should be easy no? A housekeeping statement in the first line, then declaring the string 'team' as an array of 48 names (0-47... Go through the data, read, and print the team name...
THIS IS NOT ALWAYS WORKING FOR ME... does it read? I can't tell as there are no apparent errors anywhere... This code I have tested on its own in a new blank basic file... still no go. I have the latest updates, and have even tried this on TWO different computers (using Spectrum and C64 emulation), just to be sure. I have been struggling with data files for two days now (apart from my DWORD foul)
I am having so much problems with these variables that I am resorting to naming the other important strings , such as fixtures or player names, specifically... ex... ply_name(1)="DelPiero" , ply_name(2)="Chiellini"...
CLS BLACK : PAPER BLACK : COLOR BORDER BLACK : PEN WHITE
'
DIM team AS STRING(48) ' (DECLARE 48 TEAMS AS STRING DATA)
FOR i=0 TO 47 ' (START OF FOR NEXT LOOP TO READ THE DATA)
READ team(i) (READ THE TEAM NAME FROM THE DATA)
PRINT team(i) (PRINT THE TEAM NAME)
NEXT (END OF LOOP)
'
DATA "AFC Fylde","Accrington St","Aldershot","Altrincham","Barnet","Barrow"
DATA "Boston Utd","Bradford C.","Braintree","Bromley","Carlisle","Cheltenham"
DATA "Chesterfield","Colchester","Crewe","Dag. & Red.","Doncaster","Eastleigh"
DATA "Ebbsfleet","Fleetwood","Forest Green","Gateshead","Gillingham FC","Grimsby"
DATA "Halifax","Harrogate","Hartlepool","Maidenhead","Milton Keynes","Morecambe"
DATA "Newport","Notts County","Oldham","Port Vale","Rochdale","Salford"
DATA "Solihull Moors","Southend Utd","Sutton","Swindon","Tamworth","Tranmere"
DATA "Walsall","Wealdstone","Wimbledon","Woking","Yeovil","York City"
PRINT "Does not get to this point..." (THE PROGRAM DOES NOT ALWAYS ARRIVE HERE)
WAIT KEY
------------------------------------------
HOWEVER, if I change the code to this, it WILL sometimes work... of course all the rest of the data for other variables will be totally random.
DIM team AS STRING(16)
FOR i=0 TO 15
READ team(i)
PRINT team(i)
NEXT
Hi, I am slowly using my marbles due to DATA statements being (I think) totally unreliable. Let's take this code... should be easy no? A housekeeping statement in the first line, then declaring the string 'team' as an array of 48 names (0-47... Go through the data, read, and print the team name...
THIS IS NOT ALWAYS WORKING FOR ME... does it read? I can't tell as there are no apparent errors anywhere... This code I have tested on its own in a new blank basic file... still no go. I have the latest updates, and have even tried this on TWO different computers (using Spectrum and C64 emulation), just to be sure. I have been struggling with data files for two days now (apart from my DWORD foul)
I am having so much problems with these variables that I am resorting to naming the other important strings , such as fixtures or player names, specifically... ex... ply_name(1)="DelPiero" , ply_name(2)="Chiellini"...
CLS BLACK : PAPER BLACK : COLOR BORDER BLACK : PEN WHITE
'
DIM team AS STRING(48) ' (DECLARE 48 TEAMS AS STRING DATA)
FOR i=0 TO 47 ' (START OF FOR NEXT LOOP TO READ THE DATA)
READ team(i) (READ THE TEAM NAME FROM THE DATA)
PRINT team(i) (PRINT THE TEAM NAME)
NEXT (END OF LOOP)
'
DATA "AFC Fylde","Accrington St","Aldershot","Altrincham","Barnet","Barrow"
DATA "Boston Utd","Bradford C.","Braintree","Bromley","Carlisle","Cheltenham"
DATA "Chesterfield","Colchester","Crewe","Dag. & Red.","Doncaster","Eastleigh"
DATA "Ebbsfleet","Fleetwood","Forest Green","Gateshead","Gillingham FC","Grimsby"
DATA "Halifax","Harrogate","Hartlepool","Maidenhead","Milton Keynes","Morecambe"
DATA "Newport","Notts County","Oldham","Port Vale","Rochdale","Salford"
DATA "Solihull Moors","Southend Utd","Sutton","Swindon","Tamworth","Tranmere"
DATA "Walsall","Wealdstone","Wimbledon","Woking","Yeovil","York City"
PRINT "Does not get to this point..." (THE PROGRAM DOES NOT ALWAYS ARRIVE HERE)
WAIT KEY
------------------------------------------
HOWEVER, if I change the code to this, it WILL sometimes work... of course all the rest of the data for other variables will be totally random.
DIM team AS STRING(16)
FOR i=0 TO 15
READ team(i)
PRINT team(i)
NEXT