ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 05-29-2011
shashanktrivedi shashanktrivedi is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 59
Downloads: 26
Uploads: 0
Thanks: 26
Thanked 16 Times in 3 Posts
Rep Power: 122
shashanktrivedi will become famous soon enough
Default 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  
Old 05-29-2011
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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";
with
Code:
string strx=\"test\";
Lars-Olof
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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.