Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:17 15 Nov 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 - MMBASIC MATH(MAX a())

Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 425
Posted: 03:26pm 16 Oct 2020
Copy link to clipboard 
Print this post

Hi

Conscious of being pointed back to the manual (in fairness - rightly so), I am trying to get the MAX value of an array dimension -- not the whole array.

For example if I have d(100,100) -- is it possible to finesse MATH(MAX)) to just report the largest value in the first (or second) dimension as opposed to the array over all?

I know I can iterate to find the value, but if there is a built in function - thinking MATH(MAX d(1)) << to find the max of the first dimension (or should that be MATH (MAX d(0)) ??

Cheers
Nim
Entropy is not what it used to be
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10582
Posted: 03:35pm 16 Oct 2020
Copy link to clipboard 
Print this post

  Quote   is it possible to finesse MATH(MAX)) to just report the largest value in the first (or second) dimension as opposed to the array over all?


No: sorry
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 425
Posted: 03:47pm 16 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote   is it possible to finesse MATH(MAX)) to just report the largest value in the first (or second) dimension as opposed to the array over all?


No: sorry


No probs - just checking I wasn't missing something ;-)

Nim
Entropy is not what it used to be
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 08:13pm 16 Oct 2020
Copy link to clipboard 
Print this post

MMBasic does not support any kind of array slicing; believe me, I tried really hard to see if it was possible. At least we can pass whole arrays to a subroutine or function without specifying the number of dimensions or their sizes.

-Bill
 
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