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 11-09-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default initializing int in 4_3 and 4_5

Hi there,
I just pulled up a modell from 4_3 to 4_5.
I found that if you define a integer in 4_3 like:
int i_count;
it was set automatically to 0.
In 4_5 you have to set the varaible manually to 0 (initialize it):
int i_count=0;
Attached is a small modell which will work in 4_3 but not in 4_5 until you set the int to 0 when it is defined.

What is the reason for this behavior?
Attached Files
File Type: zip Update_43_45_int.zip (43.5 KB, 190 views)
__________________
kind regards Nico.
The Following User Says Thank You to Nico Zahn For This Useful Post:
Jörg Vogel (11-10-2009)
  #2  
Old 11-09-2009
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

The reason for the change is mainly for conformance with c++. In c++ the variable is not initialized unless you initialize it explicitly, and right now the methodology in developing flexscript is to make flexscript act as much like c++ as possible, so that switching between flexscript and c++ is seamless, i.e. if you write code in flexscript, you can switch it to c++ and get the exact same results.
The Following 3 Users Say Thank You to Anthony Johnson For This Useful Post:
RalfGruber (11-10-2009)
  #3  
Old 11-10-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi Anthony,
are there some more changes which are not direcly listed in the change history of Flexsim 4_52?
__________________
kind regards Nico.
The Following User Says Thank You to Nico Zahn For This Useful Post:
RalfGruber (11-10-2009)



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.