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
|
|||
|
|||
User command error
Hi All,
I'm having a problem with the user command function. No matter what I do it just keep giving me this error. Please help! Flexscript Error MAIN:/project/model/Tools/UserCommands/command3/code line 1 invalid character <.> ascii = 46 Flexscript Error MAIN:/project/model/Tools/UserCommands/command3/code line 1 invalid character <.> ascii = 46 Flexscript Error MAIN:/project/model/Tools/UserCommands/command3/code line 1 syntax error, unexpected '/', expecting end of code Could not finish parsing because of previous errors. Thank you |
#3
|
||||
|
||||
We got a similar error whenever we copied a code from a PDF file directly to the source code editor. It exists in the character space more characters, which look identical but are described by different binaries.
If you write the source code yourself in the code editor, the error may vanish. Otherwise check your language settings in the system. Test if you could change to the English set of the system. Jörg |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Pongjetanapong (07-06-2014) |
#4
|
||||
|
||||
Hello Pongjetanapong
It seems you have directly copied the code from any one of the object triggers in the model.Triggers that have a return a value need to have a return value.Example process time field return a process time and setup field returns a setup time.But user command is not like that you have to specify your own parameters that can be passed into a user command.The return value and parameter list are just used by the Flexscript parser to give you warnings if you are not defined them.In you case you have some special characters that was not defined i.e / and about "." i didnt see this character in your window may be that was the problem Jorg defined.If you are not using the special character in your script window than dont write it. For any reasons if you want to use special characters ex: concatenate you can use the escape character '\' to prefix a quotation mark (and other special characters) and therefore adds it your string string str="/\."; assigns the two characters /. to the string str. Edit: Okay.The above description is only used in the context of flexscript.To conform I have just read in the manual that Flexscript parser does not read the text line part of the code.I dont know why this happens in your case.May be you have copied from different source and i hope jorg suggestion should work for you. Last edited by sagar bolisetti; 07-04-2014 at 11:53 AM. |
The Following 2 Users Say Thank You to sagar bolisetti For This Useful Post: | ||
Pongjetanapong (07-06-2014) |
#5
|
|||
|
|||
Hi Jörg
I typed the command myself and already checked my language setting but still get the same error. My Flexsim is still at version 4.02 so I will try to update the software and see what happens. Thank you for your help |
Thread | Thread Starter | Forum | Replies | Last Post |
Command Reference not visible in User Manual | David Chan | Q&A | 0 | 04-30-2013 12:59 AM |
How to write a User Command ? | mearjun | Flexsim Student Forum | 7 | 12-08-2012 11:44 AM |
findInCode User Command | Jason Lightfoot | User Development | 19 | 05-21-2012 02:16 PM |
Modified User Command Gui | Esther Bennett | Q&A | 1 | 01-06-2010 03:55 AM |
Dynamic script generation: Good Example with a User Command | Naresh Yamani | Tips and Tricks | 2 | 05-16-2008 06:54 PM |