Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:27 18 Sep 2026 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 : Passing arrays to a SUB / Function

Author Message
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 232
Posted: 04:52pm 27 Sep 2020
Copy link to clipboard 
Print this post

Another noob question, is it possible to pass an array of values into a SUB without first assigning them to a variable?  Something like:
MyCodeThatNeedsAnArray((1,2,3))

END

SUB MyCodeThatNeedsAnArray(paramArray() as Integer)

END SUB


As another noob question - is it possible to get the upper bounds of an array (I'm not trying to restart that Base 0 vs Base 1 discussion  )


Thanks


elk1984
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11873
Posted: 05:10pm 27 Sep 2020
Copy link to clipboard 
Print this post

Try the BOUND function
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 232
Posted: 06:16pm 27 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  Try the BOUND function


Thanks - right under my nose  
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 411
Posted: 06:34pm 27 Sep 2020
Copy link to clipboard 
Print this post

Hmm, the docs don't mention a BOUND function and MMBasic on my CMM2 does not either. Do you mean some special way of using a function? Or is this only available in a firmware version higher than 5.05.04?

-Bill
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1769
Posted: 07:14pm 27 Sep 2020
Copy link to clipboard 
Print this post

  William Leue said  Hmm, the docs don't mention a BOUND function and MMBasic on my CMM2 does not either. Do you mean some special way of using a function? Or is this only available in a firmware version higher than 5.05.04?

-Bill

S. p93 (V5.05.04)
‚My name is Ozymandias, king of kings
Look on my works, ye Mighty, and despair!‘
Nothing beside remains. Round the decay
Of that colossal wreck, boundless and bare
The lone and ...
 
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 2026