Elvas Tower: Typo in the manual - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Typo in the manual Big Bug for include files Rate Topic: -----

#11 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,446
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 07 June 2017 - 12:02 PM

Dave, I think I've added some confusion here...but I take your point about placement and path/name structure.

I posted the following "Packaged in a nice "OpenRail" folder ready to be dropped into a trainset"

A more accurate sentence using Jeff Auberpines autoracks as the example would be:
"Packaged in a nice "OpenRail" folder ready to be dropped into the "Autoracks_Jeff_A" trainset folder."

In this situation -- include ( "..\\ATSF_88099_LD.wag" ) would be correct. Yes?

edit >>> correction mentioned in post#12 applied.

#12 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,009
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 June 2017 - 12:14 PM

No, you are missing the closing double quote.

#13 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,446
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 07 June 2017 - 12:19 PM

http://www.elvastower.com/forums/public/style_emoticons/default/censored2.gif http://www.elvastower.com/forums/public/style_emoticons/default/sign_oops.gif
GADS...I gotta slow down, that's it! I'm going for a bike ride to clear my mind.

Thanks, again Carlo...

#14 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,250
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 09 June 2017 - 05:33 AM

To elaborate on what Dave pointed out... there are two ways to specify where a file is: 1) Absolute path, or 2) Relative path.

An absolute file path starts from a "fixed" point, such a drive mount or a machine\share name:
C:\MSTS\Open Rails\OpenRails.exe
or
K:\Users\Default\AppData\Local\Microsoft\Key.dat
or a network path:
\\BACKUP\BK_STA0\STD\20150703\MSTS\Open Rails\OpenRails.exe

An absolute file path is completely independent of the current folder. It doesn't matter what folder your program is looking at right now, because the absolute path overrides that.

A relative file path is dependent on the current path your program is looking at right now, and is relative to that path (hence the name).

The simplest relative file path is just the filename:
OpenRails.exe

This is relative to the current folder your program is looking at. It is also the same as this:
.\OpenRails.exe

The folder "." is a special relative folder name that always refers to the current folder. Because it's often redundant and unnecessarily verbose, it's seldom used and rarely seen. Again, remember those two previous examples are exactly the same.

If there is a folder in the current folder with the file then you could do something like this:
Open Rails\OpenRails.exe
If whatever program is looking at C:\MSTS (per the above examples), then the OpenRails.exe file could be found by specifying the path "Open Rails\" - again it's relative to the current folder. If you add the current folder and the relative path together you get C:\MSTS\Open Rails\OpenRails.exe.

The next special folder name we've all seen is ".." and it always refers to the parent folder (if there is one).

Let's say we have our fancy Open Rails include file for a route, located at: C:\MSTS\Routes\MyRoute\OpenRails\BestRouteEver.trk

The reason this file contains the line include ( "..\\BestRouteEver.trk" ) is because it's invoking all of the contents of the route's main .trk file that exists in the route's main folder, which is the parent folder of the OpenRails folder. Open Rails sees the file in the OpenRails folder and ignores the main one, but upon reading the OR one, OR sees that it specifically includes the contents of the main one. This allows you to maintain settings for both MSTS and OR but not have to change two files constantly, which is a good thing.

Relative paths can be as long or complicated as you wish.
..\..\..\MSTS3\Routes\SOUND\goodsound.wav
could actually refer to a file in another MSTS installation by navigating up three folders and then down into another folder tree.

Lastly, when a relative path starts with a backslash, it always refers to the root folder of that storage drive (its mount point):
\MSTS\Open Rails\OpenRails.exe
The file would be found if the current path the program is looking at is on the C: drive (per above examples) but would fail if it was, say, the D: drive.

So the trick with relative paths (and include files) is to know where your target file is relative to the current file, and be able to spell out the relative path accordingly.

#15 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,446
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 09 June 2017 - 01:10 PM

Joseph, Thank you. That is going into my OpenRails document/tips library. Excellent information...clears up some other situations I was puzzling over.

#16 User is offline   Mike B 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,085
  • Joined: 18-January 13
  • Gender:Not Telling
  • Location:Pacific Time
  • Simulator:Mostly ORTS these days
  • Country:

Posted 09 June 2017 - 05:22 PM

Bottom line: an "Include" file, as with programming languages and even Wordstar (remember that?), is another file that becomes part of the current file at the point where the Include statement occurs. Then, whatever else follows that statement is effectively appended to it.

Thanks for the note that the first line must be empty. That was also pointed out elsewhere, but as noted above should be early in the manual section not late. It's not an "oh by the way..." it's vital to make it work.

Jovet's description of how the paths work should be a sticky. Too many people never figure that out.

Thanks all for the discussion! :sign_thanks:

#17 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,250
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 10 June 2017 - 04:39 AM

View PostMike B, on 09 June 2017 - 05:22 PM, said:

Jovet's description of how the paths work should be a sticky. Too many people never figure that out.

I'm glad the reaction is positive. It's kinda a pedantic thing to explain and I feared my post might be too wordy and induce eye-gloss-over. :D

  • 2 Pages +
  • 1
  • 2
  • 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