Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:10 02 Aug 2025 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 : CMM2: Undocumented (?) limit on number of items in a DATA statement

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:24pm 05 Sep 2020
Copy link to clipboard 
Print this post

This was perplexing me whilst porting some BBC BASIC code.

Try this on for size:
Colour Maximite 2
MMBasic Version 5.05.05
Copyright 2011-2020 Geoff Graham
Copyright 2016-2020 Peter Mather

> list "test.bas"
Dim x
For i = 1 To 32
 Read x
 Print x;
Next i
Data 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5

> run "test.bas"
Error in line 3: Syntax


The DATA line has 33 items, if you reduce it to 32 then it works.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 02:02pm 05 Sep 2020
Copy link to clipboard 
Print this post

works fine on a stock micromite


> RUN
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
> ? mm.device$
Micromite MkII
>
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 02:23pm 05 Sep 2020
Copy link to clipboard 
Print this post

Try using RESTORE first to reset the DATA pointer.

Brian
ChopperP
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:39pm 05 Sep 2020
Copy link to clipboard 
Print this post

  Chopperp said  Try using RESTORE first to reset the DATA pointer.

Brian


RESTORE makes no difference, and it shouldn't, the DATA pointer should already be set to the first piece of data if READ has never been called.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 02:43pm 05 Sep 2020
Copy link to clipboard 
Print this post

Check the MMBasic implementation details in the manual and then split the data statement
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:54pm 05 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  Check the MMBasic implementation details in the manual and then split the data statement


Ever cryptic this section is a (relatively) recent addition to the manual and not present in the version I was referencing.

p46, Maximum number of arguments to commands that accept a variable number of arguments is 32


Thanks,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025