Jump to content
Bixby Sayz

Load library path

Recommended Posts

Having a brain dead moment. Trying to get SCAR 3.39 to load a library relative to the includes directory but SCAR doesn't seem to want to find it unless I hard wire in the full complete path.

 

Trying to load file <IncludesPath>\OSI\SMART\SmartRemote.dll:

 

[sCAR]program New;

 

{$L OSI\SMART\SmartRemote.dll}

 

begin

end.[/sCAR]

Link to comment
Share on other sites

I do not have any way to test the following suggestion (ATM), and I have never needed to do what you do, but try using a relative path based on the "." which represents current dir (in most cases).

 

[sCAR]

program Untested;

 

{$L .\OSI\SMART\SmartRemote.dll}

 

begin

end.[/sCAR]

 

If you are not loading from OSI-folder, you must append "Includes/OSI/" to the path first (but that you already know), so I assume you're loading from OSI-base folder.

Edited by slacky
Link to comment
Share on other sites

Yeah I tried that.

 

The includes directive {$I} works fine automatically relative to the includes directory. The load library directory {$L} works fine relative to the current include file. BUT if doing this directly from a script it seems to just get totally confused on where to look.

Link to comment
Share on other sites

Now I see what you wish (load lib from a script?)... The default Plugin directory is specified as current path when using {$L ..}

 

So you need to do:

[sCAR]

program Untested;

 

{$L ..\Includes\OSI\SMART\SmartRemote.dll}

 

begin

end.

[/sCAR]

Edited by slacky
Link to comment
Share on other sites

I believe I constructed the system to try to find the file in 3 places, as it does for the $I directive. Given the path isn't absolute, it tries to find it relative to the script's directory, then the script file it's in and then the libraries folder. Though I'm not sure it's in that order, first 2 might be switched.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...