Rocket Terminal Emulator

 View Only

 Using $Include in RTE scripts

Tony Vitonis's profile image
Tony Vitonis posted 08-10-2021 12:37
I have two script files, script1.bbs and script2.bbs. script1.bbs says:

Sub Cesn
 [commands here]
End Sub

script2.bbs says:

Dim bzhao As Object

'$Include "script1.bbs" [with the full path to the file name here]

Sub Main
   Call Cesn
End Sub

When I use a keyboard shortcut to invoke script2, I see this:

The idea is to have a shared subroutine that I can use among various scripts.

  1. Is '$Include the right way to do that?
  2. What's going on with the interaction of the two script files above?
  3. The script files are in the same directory. Can I use a relative path name in '$Include? If so, how does that work?
Mike Slater's profile image
Hi Tony,

In RTE Basic scripts you need to include the colon character at the end of the Include keyword, for example:

'$Include: "script1.bbs"​

Yes, you can use the full or a relative path to the file. If no path is specified then the file needs to be in the Scripts Directory, which is usually  <Documents>\BlueZone\Scripts, so any relative path would be off of this path. Does this work?

Tony Vitonis's profile image
Tony Vitonis
I didn't get an email notifying me of your answer, so I just saw it. The colon makes everything work fine. Thanks much.