Post Reply 
how to remove string?
06-02-2018, 05:37 PM
Post: #9
RE: how to remove string?
(06-02-2018 04:49 PM)Richard Wrote:  
Code:
EXPORT LIST_1:={1,2,3}; 

ID;
NUMBER;
VAR;

EXPORT CHANGE()
BEGIN

NUMBER:=1;
ID:=EXPR("'LIST_"+NUMBER+"'");  // ID  =LIST_1
VAR:=EXPR("'LIST_"+NUMBER+"'"); // VAR =LIST_1

EDITLIST(EVAL(ID)); // LIST_1:={ 1,2,3 } CHANGE LIST_1:{100,200,300}

// CHECK THIS GLOBAL VARIABLE IN MEM> USER VARIABLES> LIST_1
// You will see that the change is not saved
END;

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;
ID:="LIST_"+NUMBER;  // ID  ="LIST_1"

EXPR("EDITLIST("+ID+")"); // LIST_1:={ 1,2,3 } CHANGE LIST_1:{100,200,300}
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
how to remove string? - Richard - 05-31-2018, 06:44 PM
RE: how to remove string? - Richard - 06-01-2018, 06:48 AM
RE: how to remove string? - Richard - 06-01-2018, 04:55 PM
RE: how to remove string? - Richard - 06-01-2018, 08:54 PM
RE: how to remove string? - Richard - 06-02-2018, 04:49 PM
RE: how to remove string? - Richard - 06-02-2018, 04:49 PM
RE: how to remove string? - Didier Lachieze - 06-02-2018 05:37 PM
RE: how to remove string? - roadrunner - 06-03-2018, 10:23 AM
RE: how to remove string? - Tim Wessman - 06-03-2018, 11:58 PM
RE: how to remove string? - Richard - 06-04-2018, 01:29 PM



User(s) browsing this thread: 5 Guest(s)