Page 1 of 1
Tailbite bug ??
Posted: Mon May 09, 2005 6:24 pm
by Droopy
When I run this code it works
Code: Select all
ProcedureDLL.s GetProgramName2()
ProgramName.s=Space(255)
GetModuleFileName_(0,@ProgramName,255)
ProcedureReturn GetFilePart(ProgramName)
EndProcedure
ProcedureDLL.s GetProgramPath2()
ProgramName.s=Space(255)
GetModuleFileName_(0,@ProgramName,255)
ProcedureReturn GetPathPart(ProgramName)
EndProcedure
test with :
Code: Select all
Debug GetProgramPath2() + GetProgramName2()
but when I create a Library with Tailbite the result show only the result of the first procedure.
I don't know why .
Re: Tailbite bug ??
Posted: Mon May 09, 2005 6:50 pm
by traumatic
Maybe this has something todo with var-arg-functions?
tailbite docs wrote:
You can make your function accept variable arguments. To do so, you must include two or more ProcedureDLL's with the same name and an index number:
Code: Select all
ProcedureDLL MyFunction(arg1, arg2)
result = Pow(arg1, arg2)
ProcedureReturn result
EndProcedure
ProcedureDLL MyFunction2(arg1, arg2, arg3)
result = Pow(arg1, arg2)/arg3
ProcedureReturn result
EndProcedure
tailbite docs wrote:
To be considered as different versions of the same function with different argument number, the arguments names and types must coincide between them; otherwise, both functions will be considered different functions and processed that way.
After the library is made, and the compiler restarted from the PureBasic editor, if you type MyFunction( in the PureBasic editor, the status window will show:
tailbite docs wrote:
And you'll be able to call the function with two or three arguments. You can make as many versions as you want, with a different number of arguments, as long as you follow the mentioned rules.
Posted: Mon May 09, 2005 7:04 pm
by Droopy
Sorry I changed the procedure name to avoid conflict with my lib ( add a 2 after the procedure name )
With the original name the problem is the same ( Ok when running / False with Tailbite )
Code: Select all
ProcedureDLL.s GetProgramName()
ProgramName.s=Space(255)
GetModuleFileName_(0,@ProgramName,255)
ProcedureReturn GetFilePart(ProgramName)
EndProcedure
ProcedureDLL.s GetProgramPath()
ProgramName.s=Space(255)
GetModuleFileName_(0,@ProgramName,255)
ProcedureReturn GetPathPart(ProgramName)
EndProcedure
Posted: Mon May 09, 2005 10:22 pm
by traumatic
Well, it was just quick shot... it's not that I'm using Tailbite on a regular basis
Seems like there's a problem with returning strings then...
Is it possible to return strings at all?
Posted: Mon May 09, 2005 10:59 pm
by Droopy
Yes it can return string
when you test with :
Code: Select all
Debug GetProgramPath() ; No problem
debug GetProgramName() ; No problem
Debug GetProgramPath() + GetProgramName() ; Problem only with Tailbite !?
Posted: Tue May 10, 2005 12:10 am
by El_Choni
Yes, it's TailBite, this return string problem. As long as it's not fixed, I suggest to not use them, that is, like when you code a DLL.
I hope I'll fix this, some time in the near future, when I have some real time to dedicate to other stuff than work
EDIT:I'll give it another try tomorrow.
Posted: Wed May 11, 2005 7:21 pm
by Droopy
Everything OK with Tailbite 1.2 Pr1 !!
Thanks a lot