Jump to content
Senshuken

Add set/getdarray

Recommended Posts

add

  • setdarray
  • getdarray

I think getelementofarray can be used to do some of this.

For example:

set [email protected], 1;

// for each element in .items_1[]
for (set [email protected],0; [email protected]<10; set [email protected], [email protected]+1) {
set [email protected]_item, getelementofarray(getd(".items_"[email protected]), [email protected]);
// do stuff with [email protected]_item

}

Link to comment
Share on other sites

add

  • setdarray
  • getdarray

I think getelementofarray can be used to do some of this.

For example:

set [email protected], 1;
// for each element in .items_1[]
for (set [email protected],0; [email protected]<10; set [email protected], [email protected]+1) {
set [email protected]_item, getelementofarray(getd(".items_"[email protected]), [email protected]);
// do stuff with [email protected]_item

}

Sorry, I meant it as a dynamic array setter and getter.

Link to comment
Share on other sites

This does already work with setd and getd:

getd(".somearray["[email protected]+"]");
setd ".somearray["[email protected]+"]", 0;

or did you mean something like that:

setdarray ".somearray", 0, 5, 4, 3, 6;

but here getdarray would make no sense, since you can only get 1 value at a time

  • Upvote 1
Link to comment
Share on other sites

This does already work with setd and getd:

getd(".somearray["[email protected]+"]");
setd ".somearray["[email protected]+"]", 0;

or did you mean something like that:

setdarray ".somearray", 0, 5, 4, 3, 6;

but here getdarray would make no sense, since you can only get 1 value at a time

You're right, getdarray would be pointless, but yes I do mean the setdarray ".somearray", 0, 1, 2, 3, 4

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.