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 > Gripes and Goodies
Downloads

Gripes and Goodies Software problems and suggestions

  #1  
Old 05-05-2008
Jan Brandau Jan Brandau is offline
Flexsim User
 
Join Date: Feb 2008
Posts: 10
Downloads: 14
Uploads: 0
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 149
Jan Brandau is on a distinguished road
Default Gripes of Flexsim 4.32

Hello everyone!

I came across two problems in Version 4.32.

At first I am missing the modulo operator for integer value. In the documentation it says, that one can use "%", but this always gives me an error:
Quote:
Flexscript Error VIEW:/active/scriptinputconsole108925808/script>curtext line 5 invalid character <%> ascii = 37
Flexscript Error VIEW:/active/scriptinputconsole108925808/script>curtext line 5 syntax error, unexpected integer, expecting ';'
Could not finish parsing because of previous errors.
I then changed to the "fmod()"-function, but with this one can not use integer values, or otherwise the compiler will complain that it is ambiguous.


Second I ran across a problem with the settings of Global Variables with the function "fillarray. What I did is this. I changed to "Make all code C++" for the first time. Then some of my Global Variables showed vaules around 11731774932502602000000000000000000000000000000000 000000000000000000000000000000.000000 AFTER setting them to 0.0 with the help of fillarray in the "OnRunStart" Function. When I only used Flexscript this problem did not occur. This can be seen in the picture.
The funny thing is, that some values in the array are right and some are not. I worked around that with a while-loop. When I tried to reproduce it, the function worked fine. What you see in the picture is an old model version.

Hope this helps!

Greetings,

Jan
Attached Thumbnails
Click image for larger version
Name:	fehler_fillarray.jpg
Views:	315
Size:	193.7 KB
ID:	248  
  #2  
Old 05-05-2008
Dustin Derrick Dustin Derrick is offline
FlexSim Consultant
 
Join Date: Jul 2007
Posts: 17
Downloads: 23
Uploads: 0
Thanks: 20
Thanked 35 Times in 7 Posts
Rep Power: 223
Dustin Derrick is a jewel in the roughDustin Derrick is a jewel in the roughDustin Derrick is a jewel in the roughDustin Derrick is a jewel in the rough
Default

Jan,

The reason why the % doesn't work is because it is not a current part of Flexscript. If the documentation says otherwise this is probably a typo that has not been corrected since our switch from C++ to Flexscript. However, I am not seeing the same problem with the fmod command. It seems to work fine for me. Do you have an example of the code that is not working? As for your second question, I am not sure what could be happening, maybe if you could put together a sample model displaying the problem that we could look at it might clarify the question.

Dustin Derrick
Flexsim Support
  #3  
Old 05-06-2008
Jan Brandau Jan Brandau is offline
Flexsim User
 
Join Date: Feb 2008
Posts: 10
Downloads: 14
Uploads: 0
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 149
Jan Brandau is on a distinguished road
Default

Hello Dustin!

I solved my problems with the fmod()-function. It occurred, because I tried to give it integer values:
Quote:
if (fmod(photoeye,2) == 1){...}
Actually the function works if you write:
Quote:
if (fmod(photoeye,2.0) == 1.0){...}
Regarding the other problem...I worked around it and now I am not able to reproduce it quickly. Maybe I look into it later on this month and post a sample model.

Thank you for your help!

Jan


Thread Thread Starter Forum Replies Last Post
My gripes and improvement suggestions for v4.30 (Ctrl+C/V in tables, media path updater) Tom David Gripes and Goodies 2 03-18-2008 08:29 PM


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.