STRINGFROMID and gradians
|
09-21-2018, 09:44 AM
Post: #21
|
|||
|
|||
RE: STRINGFROMID and gradians
Hello,
"I wouldn't mind an HPPL GOTO statement! Even C has GOTO and it would make translating programs to HPPL easier in some cases." Unfortunately, this will not happen, at least not anytime soon. Not because I do not like gotos or anything like that (I have done enough Basic or ASM to know their worth), but because GOTO are actually VERY dificult to implement in a language which has scopes, local variables and the like... However, since you are talking about goto C, if you look at "non messy code" (ie, code that is reasonably clean) and look at the GOTO usage, you will see that >80% of them are there to cover a single situation. The exit of the inside of a double (or deeper) loop. Something along the lines of: for all elements in a list for all elements in a sub-list if something, then do it and stop searching (goto end) end:; in C, you either have to create boolean and set them in the inner loop and test it in the outer loop, or do a GOTO... However, in HPPL, you have the EXIT(n) construct which does exactly that for you (CONTINUE(n) is also available) So, most uses of GOTO are already covered in a much cleaner way... This does not mean that a GOTO would not be nice, but the lesser need of the functionality makes the implementation investment not really worth it... 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. |
|||
09-21-2018, 02:44 PM
Post: #22
|
|||
|
|||
RE: STRINGFROMID and gradians
One point to remember though is that if you then surround those two FOR loops with a third FOR loop, your EXIT(2) will now be taking you to the wrong place - the middle, not the end -, if I am not mistaken...
Whereas a GOTO end; - you can see exactly where you are going to, without having to count lots of ENDFOR's, making the code arguably more readable and needing less edits. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
09-21-2018, 04:49 PM
Post: #23
|
|||
|
|||
RE: STRINGFROMID and gradians
(09-21-2018 02:44 PM)StephenG1CMZ Wrote: One point to remember though is that if you then surround those two FOR loops with a third FOR loop, your EXIT(2) will now be taking you to the wrong place - the middle, not the end -, if I am not mistaken...Problem with EXIT(2)? There's no difference compared to the formal loop exit. The execution continues after the loop END; What is your problem? Please, explain. |
|||
09-21-2018, 05:47 PM
(This post was last modified: 09-22-2018 07:28 AM by StephenG1CMZ.)
Post: #24
|
|||
|
|||
RE: STRINGFROMID and gradians
Maybe I'm wrong - I don't use EXIT often.
But Code:
It could be I have misunderstood how EXIT works, but a GOTO looks like MUCH less effort. Update: In PPL its BREAK or CONTINUE, apparrently, not EXIT - Thanks Cyberangel. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
09-21-2018, 09:04 PM
Post: #25
|
|||
|
|||
RE: STRINGFROMID and gradians | |||
09-22-2018, 02:37 PM
(This post was last modified: 09-22-2018 02:41 PM by Tyann.)
Post: #26
|
|||
|
|||
RE: STRINGFROMID and gradians
(09-21-2018 05:47 PM)StephenG1CMZ Wrote: Maybe I'm wrong - I don't use EXIT often. Bonjour Dans ce cas il peut-être utile d'utiliser une variable, il suffira de modifier la valeur de cette variable plutôt que tous les BREAK. De plus vous pourrez si vous avez plusieurs points de sortie les repérer grâce à un commentaire. Hello In this case it may be useful to use a variable, it will be enough to modify the value of this variable rather than all the BREAKs. Moreover you will be able if you have several points of exit to locate them thanks to a comment. exemple : Code:
Sorry for my english |
|||
09-26-2018, 03:17 PM
Post: #27
|
|||
|
|||
RE: STRINGFROMID and gradians
(09-19-2018 08:12 AM)Tim Wessman Wrote: Note that these string names are NOT final and guaranteed to be supported long term. For example, in the "modes" group there are a bunch of spreadsheet items that need to be moved. That sounds quite useful... If you are taking suggestions for new languages to support, in England, Polish is a significant minority language - but that might change if/when the uk leaves the EU. Er, can these planned language modifications be selected whilst in Exam mode? Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
09-27-2018, 12:17 AM
Post: #28
|
|||
|
|||
RE: STRINGFROMID and gradians
Unfortunately not, however if a translation was advanced enough to be reviewed it could potentially pulled in as supported. Until then, not really due to the potentially for abuse.
TW Although I work for HP, the views and opinions I post here are my own. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: