how to remove string? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: how to remove string? (/thread-10834.html) |
how to remove string? - Richard - 05-31-2018 06:44 PM hello boys, how could i remove the string example: "hp_prime" >>>> hp_prime RE: how to remove string? - cyrille de brébisson - 06-01-2018 04:56 AM Hello, When you see "hp_prime", it means that you have a string object that contains the text hp_prime. The double quote is not part of the string... it is an indicator... So you can not "remove" it... If what you want to do is display the content of the string on the screen, depending on what you want to do exactly, you could use the textout_p or print functions... If you want to convert that string into another object (for example, if your string contains the name of a variable and that you want to get the content of this variable), you could use expr... Please tell us more... Cyrille RE: how to remove string? - Richard - 06-01-2018 06:48 AM I CAN NOT MODIFY THE USER VARIABLES [img]https://ibb.co/dFjTNd https://ibb.co/jPLPvy https://ibb.co/jfMWay https://ibb.co/gMhtoJ https://ibb.co/jSRa2d https://ibb.co/n2W8Nd[/img] RE: how to remove string? - Richard - 06-01-2018 04:55 PM CREATE USER VARIABLES MY PROGRAM: edit the objects in the lists DAT1; DAT2; EXPORT PREGUNTA(Y,D) BEGIN PRINT; DAT1:=EXPR("YEAR_"+Y+"_DAY_"+D); // LIST DAT2:=EVAL("'YEAR_"+Y+"_DAY_"+D+"'"); // NAME LIST PRINT(DAT2)+PRINT(DAT1); wait(3); EDITLIST(DAT1); END; example why the changes made in the list YEAR_1999_DAY_2 are not kept? RE: how to remove string? - Richard - 06-01-2018 08:54 PM Code: EXPORT LIST_1:={1,2,3}; another example Why can not the global variables be modified from the program? RE: how to remove string? - Didier Lachieze - 06-01-2018 09:27 PM (06-01-2018 08:54 PM)Richard Wrote: another example Is this what you want to do : Code: EXPORT LIST_1:={1,2,3}; RE: how to remove string? - Richard - 06-02-2018 04:49 PM Code: EXPORT LIST_1:={1,2,3}; RE: how to remove string? - Richard - 06-02-2018 04:49 PM Code: EXPORT LIST_1:={1,2,3}; RE: how to remove string? - Didier Lachieze - 06-02-2018 05:37 PM (06-02-2018 04:49 PM)Richard Wrote: I don't know why your program ends up editing Ans instead of LIST_1, maybe Cyrille can provide some insights on how parameters are managed for EDITLIST. However here is a way to edit the list defined by ID: Code: NUMBER:=1; RE: how to remove string? - roadrunner - 06-03-2018 10:23 AM Hello, It also works if you put ID in single quotes, like this: EDITLIST(EVAL('ID')); // LIST_1:={ 1,2,3 } CHANGE LIST_1:{100,200,300} -road RE: how to remove string? - Tim Wessman - 06-03-2018 11:58 PM Don't forget that EDITLIST returns the edited list - it doesn't automatically store it into the variable. SO you need to do MYVAR:=EDITLIST(...) to keep your changes... RE: how to remove string? - Richard - 06-04-2018 01:29 PM Thank you so much guys I had broken my head trying to solve this, the truth that I am a novice with this calculator Thank you |