@ts-soft
There is an address, see this:
Main file "StringConstants_test.pb"
Code: Select all
Define file1.s, file2.s
file1 = #PB_Compiler_File
XIncludeFile "StringConstants.pbi"
MessageRequester("Test", file1+#LF$+file2)
Include file "StringConstants.pbi"
Excerpt of the resulting asm file compiled with /COMMENTED:
Program part:
; Define file1.s, file2.s
;
; file1 = #PB_Compiler_File
MOV edx,_S1
LEA ecx,[v_file1]
CALL SYS_FastAllocateStringFree
; XIncludeFile "StringConstants.pbi"
; file2 = #PB_Compiler_File
MOV edx,_S2
LEA ecx,[v_file2]
CALL SYS_FastAllocateStringFree
;
; MessageRequester("Test", file1+#LF$+file2)
PUSH dword [_PB_StringBasePosition]
MOV edx,dword [v_file1]
PUSH dword [_PB_StringBasePosition]
CALL _SYS_CopyString@0
MOV edx,_S3
CALL _SYS_CopyString@0
MOV edx,dword [v_file2]
CALL _SYS_CopyString@0
INC dword [_PB_StringBasePosition]
PUSH dword _S4
MOV edx,[PB_StringBase]
ADD [esp+4],edx
CALL _PB_MessageRequester@8
POP dword [_PB_StringBasePosition]
Data part:
public _SYS_StaticStringStart
_SYS_StaticStringStart:
_S1: db "StringConstants_Test.pb",0
_S2: db "G:\Projects\PureBasic4\Tests\StringConstants.pbi",0
_S3: db 10,0
_S4: db "Test",0
pb_public PB_NullString
db 0
public _SYS_StaticStringEnd
As you can see, _S1, _S2 are the addresses for the different replacements of #PB_Compiler_File,
_S3 is the #LF$
and _S4 is for the "Test" string used by the MessageRequester
@helpy
Sorry, but that will not solve my problem,
even using a seperate DataSection for the main and every included source
would mean, you have to give different names to labels in the DataSection,
so you can not use a simple construct like this:
TestProc(param1, param2, ..., @#PB_Compiler_File, #PB_Compiler_Line)
so that TestProc() would get it's normal parameter and the pointer to
the filename string that it was called from.
Of course I would use a Macro to call TestProc() which will be replaced
by just the normal call of TestProc() and parameters, without the filename and linenumber in the final application compilation.
I'm asking for this feature, because I want to write a library written in
pure PB (no asm) to keep track of pointer allocation/reallocation/freeing
with the PB functions AllocateMemory() and the like,
because I often use pointers in my programs and I want to make life easier by knowing where the pointer was used last time.
I already have a set of functions that keep track of that, but I want to store the filenames and linenumers with it,
to make it easier to track errors down to the root.
Sorry if that all sounds like rambling to someone else,
maybe it's just importend to me, and I have to find my
one way to solve that problem.
CU
technicorn