HP Forums
Question about lists in plus42 - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: Question about lists in plus42 (/thread-19755.html)



Question about lists in plus42 - nickapos - 04-01-2023 12:56 PM

Apologies for the simple question but I have no experience with lists in Plus42.

I wanted to generate a list of random numbers and return it to the stack.
What would be the best way to do this?
Does anyone have any examples I could look at?


RE: Question about lists in plus42 - Didier Lachieze - 04-01-2023 01:47 PM

Here is a program generating a list of 10 random numbers :
Code:
00 { 24-Byte Prgm }
01▸LBL "RNDLST"
02 10
03 NEWLIST
04▸LBL 01
05 RAN
06 APPEND
07 DSE ST Y
08 GTO 01
09 END

The list commands are in CATALOG>STR.


RE: Question about lists in plus42 - nickapos - 04-01-2023 04:21 PM

(04-01-2023 01:47 PM)Didier Lachieze Wrote:  Here is a program generating a list of 10 random numbers :
Code:
00 { 24-Byte Prgm }
01▸LBL "RNDLST"
02 10
03 NEWLIST
04▸LBL 01
05 RAN
06 APPEND
07 DSE ST Y
08 GTO 01
09 END

The list commands are in CATALOG>STR.
Thank you very much


RE: Question about lists in plus42 - Didier Lachieze - 04-01-2023 07:30 PM

The list functions in Free42/Plus42 are described here.


RE: Question about lists in plus42 - nickapos - 04-02-2023 06:23 AM

(04-01-2023 07:30 PM)Didier Lachieze Wrote:  The list functions in Free42/Plus42 are described here.

I have seen this, but I was not sure if newlist could accept an argument to create a list with specific name.
Also I have never used DSE before. I have very little experience with RPN programming.
Your example was very helpful.
Thank you very much