12-07-2021, 05:33 PM
Sorry, I forgot some code that is necessary.
this is the complete code:
command initializeAppLibraries
local tAppLibraryPath, tLibraryContents
global LOFlag
set the itemDel to "/"
if the environment is "development" then
put item 1 to -2 of (the effective fileName of this stack) into tAppLibraryPath
else
switch the platform
case "android"
case "iPhone"
put specialFolderPath("engine") into tAppLibraryPath
break
case "MacOS"
put specialFolderPath("resources") into tAppLibraryPath
break
case "Win32"
case "Linux"
put item 1 to -2 of (the effective fileName of this stack) into tAppLibraryPath
break
end switch
end if
set the defaultfolder to tAppLibraryPath
put "/App_libraries/" after tAppLibraryPath
set the defaultfolder to tAppLibraryPath
put the files after tLibraryContents
-- if LOFlag is true then
-- unLoad_App_Libraries tLibraryContents, tAppLibraryPath
-- end if
Load_App_Libraries tLibraryContents, tAppLibraryPath
end initializeAppLibraries
command Load_App_Libraries, tAppLibraryContents
local tPath, tStack, tLibraryNames, tLContents, tLNames
--THE FOLLOWING CODE WILL only LOAD LIBRARY FILES
filter tAppLibraryContents without empty
filter tAppLibraryContents with "*.lib"
repeat for each line xStackName in tAppLibraryContents
try
start using xStackName
catch error
answer "Please check your Library stack" & cr & " There is an error in your stack " & xStackName
exit to top
end try
end repeat
end Load_App_Libraries
this is the complete code:
command initializeAppLibraries
local tAppLibraryPath, tLibraryContents
global LOFlag
set the itemDel to "/"
if the environment is "development" then
put item 1 to -2 of (the effective fileName of this stack) into tAppLibraryPath
else
switch the platform
case "android"
case "iPhone"
put specialFolderPath("engine") into tAppLibraryPath
break
case "MacOS"
put specialFolderPath("resources") into tAppLibraryPath
break
case "Win32"
case "Linux"
put item 1 to -2 of (the effective fileName of this stack) into tAppLibraryPath
break
end switch
end if
set the defaultfolder to tAppLibraryPath
put "/App_libraries/" after tAppLibraryPath
set the defaultfolder to tAppLibraryPath
put the files after tLibraryContents
-- if LOFlag is true then
-- unLoad_App_Libraries tLibraryContents, tAppLibraryPath
-- end if
Load_App_Libraries tLibraryContents, tAppLibraryPath
end initializeAppLibraries
command Load_App_Libraries, tAppLibraryContents
local tPath, tStack, tLibraryNames, tLContents, tLNames
--THE FOLLOWING CODE WILL only LOAD LIBRARY FILES
filter tAppLibraryContents without empty
filter tAppLibraryContents with "*.lib"
repeat for each line xStackName in tAppLibraryContents
try
start using xStackName
catch error
answer "Please check your Library stack" & cr & " There is an error in your stack " & xStackName
exit to top
end try
end repeat
end Load_App_Libraries