emu48 append to list issue - 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: emu48 append to list issue (/thread-18156.html) |
emu48 append to list issue - rickster - 03-21-2022 11:03 PM I'm working on a program to generate characters for a role-playing game. I am having trouble with '+' used to append an item to a list: Code:
When I run XGEN2, it stalls at INFORM in EDITX: the "$$EDITX" routine apparently fails to add CHRXCX as the 5th element of the parameter-list. (CHRXCX has a value.) When I run "$$EDITX" on its own, however, it does add the list. And when I run EDITX on its own, it displays the input form correctly! I am completely puzzled by this behaviour. Any ideas? Thanks in advance... RE: emu48 append to list issue - DavidM - 03-22-2022 01:05 PM Interesting that your variable name that begins with two dollar signs and ends with EDITX is causing posting problems in the forum. There's probably a way to "escape" that name, but I'm not familiar enough with the MyBB features to know for sure. Speculation: Is it possible that the variable CHRXCX is not defined at some point in the code when your append is being attempted? If it isn't defined, it will simply show up on the stack as 'CHRXCX' instead of showing any possible contents, which would undoubtedly cause problems. Try placing the commands 41 MENU HALT right before the "+" in your code to see exactly what's on the stack, and that might provide a clue as to what is happening. If everything looks good, simply SST through the code to see where things start to break down. Another suggestion: try putting the list elements on the stack first and then combining them all with 5 \->LIST instead of appending an encapsulated sublist. Not a huge difference here, but it might save some space in the long run. Hope this helps! RE: emu48 append to list issue - rickster - 03-22-2022 02:44 PM Thanks, I'll try that 41 MENU HALT tip. |