Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 04:33 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Version 2.6c printing arrays problem

Author Message
thetinkerer

Regular Member

Joined: 16/06/2011
Location: Australia
Posts: 68
Posted: 06:25pm 26 Sep 2011
Copy link to clipboard 
Print this post

I have been trying to print the values of an array and keep on getting an error.
running this code:

10 OPTION base 1
20 DIM DRO[4]
30 dro[1]=1
31 dro[2]=2
32 dro[3]=3
33 dro[4]=4
40 PRINT dro[1];

gave the result:

4
Error line 40: Invalid syntax


so it print 4 (not 1) and then the error. Just wondering what I am doing wrong? or is this a bug.

 
ArtBecker
Regular Member

Joined: 25/08/2011
Location: Philippines
Posts: 47
Posted: 07:06pm 26 Sep 2011
Copy link to clipboard 
Print this post

Change the brackets to parentheses.

 
thetinkerer

Regular Member

Joined: 16/06/2011
Location: Australia
Posts: 68
Posted: 07:38am 27 Sep 2011
Copy link to clipboard 
Print this post

ooops! this is mmbasic - thanks for that. All good now.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024