Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:00 29 Mar 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 : DIM array help....

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9029
Posted: 04:31am 10 Feb 2020
Copy link to clipboard 
Print this post

I'm a bit stuck trying to work out how to use and access an array.

I have FOUR sets of FIVE integers I want to keep track of.
An array would be perfect for that.
Reading the manual(pages 56, 57), defining it would seem to be a case of: DIM Q(5,4)

This should give me an array of four sets of five integers.

Writing and reading is now where I am lost.

With a simple one-dimensional array such as DIM Q(5), reading and writing to the elements is easy: X=Q(3) as a reading example, or Q(3)=X as a writing example.

However, how do you do the syntax for a bigger one?

IE: How do I go about writing to the 5th element on the 4th set of elements for example?

EDIT: Nevermind....  





Playing about on the console has revealed how to do it!
Another fantastic use for the console - just type in commands and see what happens.
Edited 2020-02-10 14:40 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


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

© JAQ Software 2024