Hi Rene,
OS_GetCommand behaves differentely when in thinAir and when the script is launched separately.
Why?
Because thinBASIC passes you the whole command line which the core interpreter receives.
If you want to get the parameters relevant for you script only, I do it this way:
Uses "OS"
MsgBox 0, Script_Parameter(1) ' -- This should return the file name for you
' Description: Function returns nth parameter of the script
' -----------------------------------------------------------------------------
' Parameters:
' -----------------------------------------------------------------------------
' index: index of nth parameter, starting from 1
Function Script_Parameter( index As Long ) As String
Long paramOffset = IIf(StartsWith(OS_GetCommand(0), "@"), 2, 1)
Function = OS_GetCommand(index+paramOffset)
End Function
Petr
Bookmarks