SOFiSTiK Forum

It is currently Tue Nov 12, 2019 6:51 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: List of Values
PostPosted: Tue Apr 04, 2017 12:14 pm 
Offline

Joined: Fri May 20, 2016 6:34 pm
Posts: 6
Hallo,
I have a small question.

If I have a list of values for example:

STO#P 1,2,3,4.....9

1- How can i get the maximum of the these values?
-I have tried Max(#P), but it didn't work.

2- How could i get the last value in this list?
- I have tried #P(P), but it also didn't work.

I would be thankful if you could help me with this.

Best regards,


Top
 Profile  
 
 Post subject: Re: List of Values
PostPosted: Tue Apr 04, 2017 2:50 pm 
Offline

Joined: Wed Dec 10, 2008 1:35 pm
Posts: 79
As far as I know there is no built-in function for this.

But you can do this easily using a loop:
Code:
+prog template
head

STO#P 1,2,3,4,5,6,7,8,9,6
let#maxP #P(0)
loop#1 P
  if #P(#1)>#maxP
    let#maxP #P(#1)
  endif
endloop
let#lastP #P(#1-1)

txe last element: #lastP
txe max. element: #maxP
end       
Regards
gmay


Top
 Profile  
 
 Post subject: Re: List of Values
PostPosted: Wed Apr 05, 2017 6:16 am 
Offline

Joined: Fri May 20, 2016 6:34 pm
Posts: 6
Thank you very much.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group