Code: Select all
XIncludeFile GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder\MyData.pbi"
Code: Select all
XIncludeFile GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder\MyData.pbi"
This is no "Literal String Limitation". GetUserDirectory() is a run time function.Paul wrote:Is there any way to do this or is it a Feature Request ?Code: Select all
XIncludeFile GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder\MyData.pbi"
Code: Select all
SetCurrentDirectory(GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder")
XIncludeFile "MyData.pbi"
It was worth a try but unfortunately it doesn't work.RASHAD wrote:Just a guess
It could be like IncludeBinary "filename" and the filename should be between quotes
TryCode: Select all
SetCurrentDirectory(GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder") XIncludeFile "MyData.pbi"
RASHAD wrote:Just a guess
It could be like IncludeBinary "filename" and the filename should be between quotes
TryCode: Select all
SetCurrentDirectory(GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder") XIncludeFile "MyData.pbi"
Code: Select all
CopyFile(GetUserDirectory(#PB_Directory_AllUserData)+"MyFolder\MyData.pbi",GetTemporaryDirectory()+"MyData.pbi")
XIncludeFile "MyData.pbi"
GetUserDirectory() is needed at compile time, but not at runtime, because there is no (X)IncludeFile in the final exe anymore. The usage of GetUserDirectory() shouldn't make problems in this case.Little John wrote:all these trials by you don't make sense, since you obviously do not understand the difference between things that happen at compile time, and things that happen at runtime.
Code: Select all
;-TOP
; File MainUserX.pb
#ProjectData = #PB_Compiler_FilePath
#ProjectBase = #PB_Compiler_FilePath + ".." + #PS$
IncludePath #ProjectData
IncludeFile "MyData.pbi"
IncludePath #ProjectBase
IncludeFile "Main.pb"
;IncludeFile "Functions.pbi"
Yes, in Rashad's code GetUserDirectory() is needed at compile time (as well as SetCurrentDirectory() or CopyFile()).Josh wrote:GetUserDirectory() is needed at compile time, but not at runtime, because there is no (X)IncludeFile in the final exe anymore. The usage of GetUserDirectory() shouldn't make problems in this case.Little John wrote:all these trials by you don't make sense, since you obviously do not understand the difference between things that happen at compile time, and things that happen at runtime.
This is the best solution I see.Paul wrote:Guess it will have to be a Feature Request then and function similar to a constant like #PB_Compiler_Home which retrieves the compiler home directory at compile time.
Something like using just #PB_Compiler_AllUserData would be retrieved and filled at compile time.