Cleaning up code - help me
|
12-15-2015, 05:57 AM
Post: #1
|
|||
|
|||
Cleaning up code - help me
Hi,
I have static INPUT code, which looks like this: Code: EXPORT testinput() But number of fields is dependent on previous user's input, so I wrote this: Code: Loop; Please, is there other way how to make dynamic input than this almost unreadable code? Prime G2, 15C CE |
|||
12-16-2015, 07:44 AM
Post: #2
|
|||
|
|||
RE: Cleaning up code - help me
Hello,
For something like this, the code will be somewhat hard to read. Even the mighty MAKELIST can not help you here as you are trying to generate 2 elements per loop. I did try to simplify things using lists, but even this fails because you need to do something like: List(0):= { L3(Varaible), ....} with Variable being evaluated but L3(...) being NOT evaluated! I guess if PPL had an apply function, it could be build, but even that would not be very obvious/readable. Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
12-16-2015, 05:20 PM
Post: #3
|
|||
|
|||
RE: Cleaning up code - help me
Here is what I've been able to achieve using MAKELIST, working but quite ugly:
Code: EXPORT testinput2() |
|||
12-17-2015, 06:25 AM
Post: #4
|
|||
|
|||
RE: Cleaning up code - help me
Thank you, Cyrille and Didier, for your input. It seems I have personal assistants now. Sorry if my questions are dumb so you waste your precious time on them. :-)
Prime G2, 15C CE |
|||
12-17-2015, 07:23 AM
Post: #5
|
|||
|
|||
RE: Cleaning up code - help me
Hello,
No, not dumb, they are interesting and show what people want and manage to achieve with PPL. Have fun! Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)