Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:08 18 Sep 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 : [MMBASIC]Const arrays

Author Message
Greg Fordyce
Senior Member

Joined: 16/09/2011
Location: United Kingdom
Posts: 153
Posted: 09:27am 26 Sep 2015
Copy link to clipboard 
Print this post

@Geoff

Would it be possible to extend the CONST command to include arrays?

For example;
CLS
Option base 1

Const cellid(6) = (4,5,6,7,8,9)

For i = 1 To 6
GUI textbox cellid(i), 5+(i-1)*133, 85, 120, 50, RGB(red), RGB(gray)
Next i


At the moment I can use this, but I want to be able to refer to the controls in a FOR/NEXT loop as well. Because cellid is a variable there is a risk it could be inadvertently change;

CLS
Option base 1

Dim cellid(6) = (4,5,6,7,8,9)

For i = 1 To 6
GUI textbox cellid(i), 5+(i-1)*133, 85, 120, 50, RGB(red), RGB(gray)
Next i


 
Geoffg

Guru

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

It should be possible (and easy) because constants and variables are closely related and share a lot of the same code.

I will investigate.

Geoff
Geoff Graham - http://geoffg.net
 
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