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
FAQ Downloads Calendar Search Mark Forums Read

Gripes and Goodies Software problems and suggestions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2012
Jens Mühlheimer Jens Mühlheimer is offline
Flexsim User
 
Join Date: Jul 2008
Location: Stuttgart, Germany
Posts: 140
Downloads: 8
Uploads: 0
Thanks: 40
Thanked 35 Times in 27 Posts
Rep Power: 170
Jens Mühlheimer will become famous soon enoughJens Mühlheimer will become famous soon enough
Default Script windows empty if MTBR tablename contains only digits

Hello everybody,

I noticed that if a MTBR / MTBF table name only contains digits (or at least starts with a digit) and I want to view the one of the funtion codes, the script editor window appears empty.

When I rename the table so it stars with a letter, everything is fine.

Is there a fix or explanation for this?

Thank you in advance!
Jens
Reply With Quote
  #2  
Old 03-27-2012
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1171
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

With a few exceptions, object and node names in Flexsim should follow C++ naming rules:
"A valid identifier is a sequence of one or more letters, digits or underscore characters (_). Neither spaces nor punctuation marks or symbols can be part of an identifier. Only letters, digits and single underscore characters are valid. In addition, variable identifiers always have to begin with a letter. In no case can they begin with a digit." (http://www.cplusplus.com/doc/tutorial/variables/)

Flexsim object and node names are frequently used in paths, which can take names or ranks as valid inputs:

node("/Tools/MTBFMTTR/6",model()) will point to the 6th node in the MTBFMTTR node of the Tools folder.

If you name the first MTBFMTTR object as "6542", then a path to that object will be looking for the object at rank 6542, which probably isn't the correct object.

Also, you may make variables out of object names, and variables cannot start with a number.


Question:
Quote:
Originally Posted by Jens Mühlheimer View Post
Is there a fix or explanation for this?
Answer:

Quote:
Originally Posted by Jens Mühlheimer View Post
When I rename the table so it starts with a letter, everything is fine.
Reply With Quote
The Following User Says Thank You to Phil BoBo For This Useful Post:
Jens Mühlheimer (03-27-2012)
  #3  
Old 03-27-2012
Jens Mühlheimer Jens Mühlheimer is offline
Flexsim User
 
Join Date: Jul 2008
Location: Stuttgart, Germany
Posts: 140
Downloads: 8
Uploads: 0
Thanks: 40
Thanked 35 Times in 27 Posts
Rep Power: 170
Jens Mühlheimer will become famous soon enoughJens Mühlheimer will become famous soon enough
Default

That explains a few things
Phil, thank you very much!

// Just in case somebody has the same question: I solved this by naming the MTBR / MTTR tables x123456 and then using this command to get the actual name:

Code:
string myname = stringcopy(getname(current),2,stringlen(getname(current)));

Last edited by Phil BoBo; 03-28-2012 at 10:08 AM. Reason: added code tags to fix formatting
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exel Import - Digits after decimal point FlorianK Q&A 7 09-25-2012 10:06 AM
Empty level in rack Manoj Kumar Q&A 3 02-01-2012 05:27 AM
Empty & Idle Warehouse at the end of the day Labro Eleni Q&A 3 08-08-2011 04:08 AM
IDLE and EMPTY Lydia Franck Q&A 2 08-05-2010 03:03 AM


All times are GMT -6. The time now is 03:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.