Elvas Tower: Parameter values in MSTS files - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Parameter values in MSTS files ( 1 ) or ( TRUE ) ? Rate Topic: -----

#1 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,869
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 01 July 2023 - 11:09 AM

View Poststeamer_ctn, on 24 May 2023 - 08:57 PM, said:

Another thought for policy/guideline is for the standard specification of data parameters.

Recently I noticed this comment in a thread. It appears to use true/false inputs rather then 0/1 inputs. This means that we will now have a mixture of both which I think is confusing. Personally I don't have a fixed leaning either way, though the 0/1 is quicker to type.

I think that we should set a standard policy/guideline about how these types of entries should be done, or alternatively make sure that the parameter accepts either of the above options.

Peter, you raise a good question - neither James nor I knew what Open Rails does without inspecting the code.

The STFReader.ReadBool() method will accept either ( FALSE ) or ( 0 ) as false and either ( TRUE ) or ( 1 ) or any non-zero integer as true. If the value is missing ( ), then the default for that parameter is returned. Entries are not case-sensitive.

The interesting point is that the Source Code Control records show that the extension to also accept ( FALSE ) and ( TRUE ) has the date Oct 2010, so it's been that way for over 12 years.So users can enter whichever notation works best for them.

Perhaps I can also say that developers should take care to use only the methods in STFReader. If you find a need to roll your own, then there is something wrong and we should have a team discussion.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users