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 |
#1
|
|||
|
|||
Dynamic Script String Issue
Hi,
As per our observation if we define string variable with in quotes of another string, used for dynamic scripting, script does not get complied and start giving errors. for example.. string str; str = " /**custom code */ treenode item = parnode(1); treenode current = ownerobject(c); int rownumber = parval(2); //row number of the schedule/sequence table string strx= "test"; { treenode involved =item; int ishan =duniform(1,10,3); setitemtype(involved,ishan); colorarray(involved,ishan); } "; Strx string is in quotes of str string, if we remove it, script gets compiled. We are curious to know why it is happening, does flexsim script does not support this. Regards Shashank Trivedi |
#2
|
|||
|
|||
Hi,
Flexscript is based on C/C++ so the behavior is correct. When Flexscript find the second " (the first for strx), Flexscript thinks it is the end of the string. Try to replace Code:
string strx="test"; Code:
string strx=\"test\"; |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Anthony Johnson (06-02-2011) |
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Script | shashanktrivedi | Q&A | 2 | 05-26-2011 11:36 PM |
LAN license Installation issue with different network/hdd | David Chan | Installation | 0 | 03-01-2011 01:44 AM |
Need A Script | Gavin Douglas | Q&A | 3 | 07-18-2008 10:00 AM |
Dynamic script generation: Good Example with a User Command | Naresh Yamani | Tips and Tricks | 2 | 05-16-2008 06:54 PM |
Floating license issue | MorganIT | Q&A | 1 | 09-12-2007 01:51 AM |