mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-07 18:00:24 +00:00
Relative paths for external libraries
External libraries can now sit in the same folder as your source file without the need to specify a full path. You can use .libraryname or ./libraryname with DECLARE LIBRARY statement blocks.
This commit is contained in:
parent
5e7e37ea0b
commit
b8b4b13302
|
@ -3686,7 +3686,7 @@ DO
|
||||||
LOOP
|
LOOP
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
'Seperate path from name
|
'Separate path from name
|
||||||
libpath$ = ""
|
libpath$ = ""
|
||||||
FOR z = LEN(x$) TO 1 STEP -1
|
FOR z = LEN(x$) TO 1 STEP -1
|
||||||
a = ASC(x$, z)
|
a = ASC(x$, z)
|
||||||
|
@ -3697,6 +3697,17 @@ DO
|
||||||
END IF
|
END IF
|
||||||
NEXT
|
NEXT
|
||||||
|
|
||||||
|
'Accept ./ and .\ as a reference to the source file
|
||||||
|
'folder, replacing it with the actual full path, if available
|
||||||
|
IF libpath$ = "./" OR libpath$ = ".\" THEN
|
||||||
|
libpath$ = ""
|
||||||
|
IF NoIDEMode THEN
|
||||||
|
IF LEFT$(path.exe$, 2) <> ".." THEN libpath$ = path.exe$
|
||||||
|
ELSE
|
||||||
|
IF LEN(ideprogname) THEN libpath$ = idepath$ + pathsep$
|
||||||
|
END IF
|
||||||
|
END IF
|
||||||
|
|
||||||
'Create a path which can be used for inline code (uses \\ instead of \)
|
'Create a path which can be used for inline code (uses \\ instead of \)
|
||||||
libpath_inline$ = ""
|
libpath_inline$ = ""
|
||||||
FOR z = 1 TO LEN(libpath$)
|
FOR z = 1 TO LEN(libpath$)
|
||||||
|
|
Loading…
Reference in a new issue