jupeto 3 Posted May 1, 2017 (edited) I don't know if I'm doing this right So I have a collection of character variable like so; variable_one[0] = value_one variable_two[0] = value_two variable_three[0] = value_three then I'm trying to push some data to it variable_one[getarraysize(variable_one)] = value_one_point_one variable_two[getarraysize(variable_two)] = value_two_point_one variable_three[getarraysize(variable_three)] = value_three_point_one I can see that it saves to my database but when I try to access it and loop like this for (.@i = 0; .@i < getarraysize(variable_one); .@i++) { mes variable_one[.@i]; } end; the result is only one value Edited May 1, 2017 by jupeto Quote Share this post Link to post Share on other sites
0 Habilis 119 Posted May 1, 2017 (edited) .@i < getarraysize(variable_one) You want to review the control part of your FOR loop. You also, may want to review the overall logic of your code... I don't have time right now to go over Hercules's scripting Syntax and see how arrays are built there. But, there is something about your code, that confuses me... Edited May 1, 2017 by Habilis Quote Share this post Link to post Share on other sites
0 bWolfie 138 Posted May 1, 2017 variable_one[getarraysize(variable_one)] = value_one_point_one variable_two[getarraysize(variable_two)] = value_two_point_one variable_three[getarraysize(variable_three)] = value_three_point_one I think you need these the other way around? E.g. JobLevel = .@joblevel; Would make your JobLevel = whatever .@joblevel is. So when saving variable_one[getarraysize(variable_one)] = value_one_point_one v1[3] would mean whatever the third index of variable one is, is now equal to value point 1. Quote Share this post Link to post Share on other sites
I don't know if I'm doing this right
So I have a collection of character variable like so;
then I'm trying to push some data to it
I can see that it saves to my database
but when I try to access it and loop like this
the result is only one value
Edited by jupetoShare this post
Link to post
Share on other sites