SRL Archive - OSR Help

How to get the file path?


shadowrecon

2013-05-24 00:08:45

Hello,
I am trying to find out how to get the path of a script from inside the script in order to locate directories, files and other materials that are relative to that script. Is there a function similar to that in which SCAR Divi has called "ScriptPath" which returns the path of the script?

Sincerely
- ShadowRecon

Janilabo

2013-05-24 00:19:49

ScriptPath function exists in Simba.

-Jani

shadowrecon

2013-05-24 01:16:31

Is it in a include? because I used the search box and it didn't show up. Id prefer to not the SRL include due to the lack of organization.

Janilabo

2013-05-24 01:58:45

From: shadowrecon
Is it in a include? because I used the search box and it didn't show up. Id prefer to not the SRL include due to the lack of organization.
Nope, built-in to Simba.

begin
WriteLn(ScriptPath);
end.

Debugs:

Compiled successfully in 46 ms.
C:\Simba\
Successfully executed.

NOTE: That was ran with unsaved script. Obviously the result is different if you'll save the script to some other path. :)

..and yeah, for some reason ScriptPath is not listed in Functionlist. Not in Simba docs either…

-Jani

shadowrecon

2013-05-24 20:37:19

Thanks Jani, I searched for the function. Didn't think to just try the SCAR equivalent but I guess many of the same functions that SCAR has were copied over to Simba.

BTW - Have you switched to just Simba scripting? I'm making the switch now. I plan on just porting / re-writing the OSI include because of its reliability since this community seems to be in a better standing than SCAR plus I really like SPS and since SCAR went to version 3.5 I cant seem to get the DLL for SPS to work any more.