2643_en-US
Insert value to Associative ArrayHello all,
The following code works in JMP 9 but not JMP 8:
Basically I need to put a value into a particular position in an associative array. It appears that in JMP 8, to build an associative array you need to insert values sequentially with INSERT INTO.
I have a workaround but I would really like to use this syntax, which is much more convenient.
Thanks,
PeterRe: Insert value to Associative ArrayYes,
Now I see:
The below works - but coincidenently Insert replaces the first record - does order matter?
<-
x = associative array();
x["one"] = {"", "a", "b"};
x["two"] = {"", "d", "e"};
print(x);
newx = Remove(x, "one");
newx << Insert("Hello World", "a", "b");
print(newx);
-->
produces
x
Associative Array({{"one", {"", "a", "b"}}, {"two", {"", "d", "e"}}})
newx
Associative Array({{"Hello World", "a"}, {"two", {"", "d", "e"}}})
Bset,
-MattRe: Insert value to Associative ArrayHi Matt,
That doesn't work - I want put the string "hello world" into the list pointed to by x["one"], in the first position. What I want to end up with is:
print(x["one"])
{"hello world", "a", "b"}
I have a workaround in place - I was curious if there was a JMP version 8 syntax that I wasn't aware of. The syntax I showed works in version 9 but not 8.
Regards,
PeterRe: Insert value to Associative ArrayHi:
How about: