ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Gripes and Goodies Software problems and suggestions |
#1
|
||||
|
||||
Global arrays declared with no o f elements only
Hi,
after I just used a global integer array with 55 elements and had to press 55 times the button to add an element and had to fill in an initial value 55 times, I´m going to post this suggestion: Can´t we have an alternative way to declare a global array with just the number of elements we like and have the initial values optional? I think that would save much time since initializing an array with a loop is much more comfortable than filling each value manually. Thanks Ralf aka Ralle Felxsim Germany |
#2
|
||||
|
||||
If you want to initialize your array using a loop in code instead of manually in the GUI, you can just look at the code for the Add button and steal it. (By using the right click option View > Explore Structure.)
treenode arraylist = node("/1/GlobalVariables/variable1/3",model()); for(int r=1;r<=55;r++) { nodeinsertinto(arraylist); nodeadddata(last(arraylist),DATATYPE_STRING); setnodestr(last(arraylist),"1234"); } Anything that any GUI does in Flexsim is visible to the user to take that code and put it to work in whatever way you need. |
The Following 3 Users Say Thank You to Phil BoBo For This Useful Post: | ||
RalfGruber (09-12-2008) |
#3
|
||||
|
||||
Phil,
of course, you are right, but this is the experienced user solution. I thought the global variables GUI was created to help less or none experienced users so I still like the idea to have another editfield were you just have to put in the number of elements for an array you want to create. Tanks Ralf aka ralle |
Thread | Thread Starter | Forum | Replies | Last Post |
Limit in the completion hints? Global Tables, Global Variables, etc.? | Tom David | Gripes and Goodies | 6 | 09-09-2008 04:05 PM |
size of arrays in Flexscript | Steven Hamoen | Q&A | 13 | 06-23-2008 01:04 PM |
Using multi-dimensional arrays with flexscript | Cliff King | Tips and Tricks | 0 | 12-15-2007 11:25 AM |