HP Forums
ORDER Error - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: ORDER Error (/thread-16114.html)



ORDER Error - MNH - 01-03-2021 03:38 PM

[attachment=8981]

Apparently the bad arguments are the two unallowed names. Is there a SYSEVAL that will work?


RE: ORDER Error - rprosperi - 01-03-2021 03:45 PM

"!" is a built-in function (factorial) which may be interfering?


RE: ORDER Error - DavidM - 01-03-2021 06:12 PM

(01-03-2021 03:38 PM)MNH Wrote:  Apparently the bad arguments are the two unallowed names. Is there a SYSEVAL that will work?

Easier might simply be to place the strings you want in a list, store it as CST, then activate the custom menu:

Code:
"HAPPY"
"NEW"
"YEAR"
"2021"
"!"
5 →LIST
'CST' STO
CST



RE: ORDER Error - Giuseppe Donnini - 01-07-2021 12:39 PM

The job of the ORDER command is not to reorder the elements of a given menu, but to reorder the variables in the current directory, that is, to adequately rearrange the linked list of identifier/object pairs stored in the dedicated RAM area called USEROB. The new order will then automatically be reflected by the built-in VAR menu — but not by any other menu, including temporary or custom menus containing, or even consisting entirely of, variables from the current directory.


RE: ORDER Error - DavidM - 01-07-2021 01:20 PM

(01-07-2021 12:39 PM)Giuseppe Donnini Wrote:  The job of the ORDER command is not to reorder the elements of a given menu, but to reorder the variables in the current directory, that is, to adequately rearrange the linked list of identifier/object pairs stored in the dedicated RAM area called USEROB. The new order will then automatically be reflected by the built-in VAR menu — but not by any other menu, including temporary or custom menus containing, or even consisting entirely of, variables from the current directory.

All true, of course, but I (perhaps mistakenly) perceived the actual goal here as simply placing certain strings in those menu positions on the screen to achieve the display of a particular message. Hence my suggestion.

If MNH truly wants to rearrange the order of those globals in the directory, one way to do that without running into the command-line parser's confusion would be:
  1. Obtain a list of the globals in the current directory with the VARS command
  2. Explode that list (OBJ→ DROP)
  3. Rearrange the order as needed with the interactive stack (ROLL and ROLLD would be very helpful for this)
  4. Recombine into a new list (<quantity> →LIST)
  5. Execute ORDER

Having to "jump through hoops" like this is just one of the potential pitfalls of having non-standard names for globals, which is a good reason not to use them IMHO. Smile


RE: ORDER Error - Giuseppe Donnini - 01-07-2021 05:42 PM

I totally agree, my reply was actually to MNH in order to help him clarify his objective. I know from another thread that he experimented with $>ID, so the menu shown in the screenshot could after all be the VAR menu, exhibiting two variables with prohibited names: '2021' and '!'. We simply don't know.


RE: ORDER Error - Csaba Tizedes - 01-10-2021 11:50 AM

(01-03-2021 03:38 PM)MNH Wrote:  Apparently the bad arguments are the two unallowed names. Is there a SYSEVAL that will work?

The real question is not the ORDER, but how you did make those variables? If you can make it, you can make it in right order and there is no problem.

Csaba


RE: ORDER Error - MNH - 01-10-2021 12:27 PM

Thanks to everyone for replying! I just wanted to know why the ORDER command generated an error when acting on a particular list of objects and if there's a SYSEVAL that will work. I assumed that the two unallowed names were causing the error because they are the wrong object types. I understand that there are other ways to display the variables in order in the VAR menu. In the past I've always used ORDER to accomplish this.


RE: ORDER Error - Csaba Tizedes - 01-10-2021 02:48 PM

(01-07-2021 01:20 PM)DavidM Wrote:  
(01-07-2021 12:39 PM)Giuseppe Donnini Wrote:  ...reorder the variables in the current directory

... those globals in the directory...

The real question is still open: HOW?

Cs.
BTW: DavidM: no need to use strings, simple put the names into a list, then 'CST' STO
{HAPPY NEW YEAR 2021 !} 'CST' STO


RE: ORDER Error - DavidM - 01-10-2021 05:54 PM

(01-10-2021 02:48 PM)Csaba Tizedes Wrote:  
(01-07-2021 01:20 PM)DavidM Wrote:  ... those globals in the directory...

The real question is still open: HOW?

You'd have to read this thread to get the complete picture here. In addition to the globals with "normal" names, he created a couple with non-standard names as well (using #5B15 SYSEVAL to create the IDs).

Yes, he could always delete and then re-create the variables in reverse order so that the order was as needed. ORDER can also be used, but the '2021' ID can't be inserted into a list by simply pressing it's menu key or typing the characters in. Some alternative needs to be used. There are several, my suggestion to use VARS and the interactive stack to rearrange things is just one of them.


RE: ORDER Error - DM48 - 03-28-2021 09:04 PM

(01-10-2021 02:48 PM)Csaba Tizedes Wrote:  The real question is still open: HOW?

Delete ! from the list. ORDER will arrange the first four and place ! at the end.


RE: ORDER Error - Han - 03-28-2021 09:16 PM

(03-28-2021 09:04 PM)DM48 Wrote:  
(01-10-2021 02:48 PM)Csaba Tizedes Wrote:  The real question is still open: HOW?

Delete ! from the list. ORDER will arrange the first four and place ! at the end.

I think you may be mistaking ORDER for SORT. ORDER is the command to arrange the variables in a specific order, namely the one provided by the list argument. SORT simply rearranges the list. Neither command will allow for an existing command name to be used within the list.


RE: ORDER Error - DM48 - 03-29-2021 03:27 PM

(03-28-2021 09:16 PM)Han Wrote:  
(03-28-2021 09:04 PM)DM48 Wrote:  Delete ! from the list. ORDER will arrange the first four and place ! at the end.

I think you may be mistaking ORDER for SORT. ORDER is the command to arrange the variables in a specific order, namely the one provided by the list argument. SORT simply rearranges the list. Neither command will allow for an existing command name to be used within the list.

Hey Han. Maybe I am confused. When I enter

Code:
 { HAPPY NEW YEAR} ORDER

The menu is rearrange with those three variables listed to the far left in that order. Any other objects in the menu are pushed to the right. What am I missing?


RE: ORDER Error - rprosperi - 03-29-2021 04:37 PM

SORT is for sorting an arbitrary list, while ORDER is specifically for establishing the display order of the VARS in the VAR menu. It will display the items you specify in that order starting from the left, then continues with others in the order they were already in.

SORT - Sorting any list
ORDER - Specifying the displayed order of the VAR menu.