[DONE] 1.877 / 4.30b4: String Problem

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

Vladi
User
User
Posts: 33
Joined: Sun Sep 10, 2006 3:09 pm

[DONE] 1.877 / 4.30b4: String Problem

Post by Vladi »

Is this a known bug? What is the status?

Lib:

Code: Select all

ProcedureDLL$ proc(a)
   ProcedureReturn Str(a)
EndProcedure

ProcedureDLL$ p(b)
   ProcedureReturn proc(b)
EndProcedure
Pgm:

Code: Select all

Debug proc(3)

Debug p(2)
Second statement crashes.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

It's a known limitation with PB versions >= 4.20.

Don't call exported string functions in your library, because of the 'RET X+4' fix : see http://www.purebasic.fr/english/viewtop ... e&start=22

Just add a 'dummy' function through which the exported string function operates.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Vladi
User
User
Posts: 33
Joined: Sun Sep 10, 2006 3:09 pm

Post by Vladi »

Thanx for your prompt answer. But what do you mean with a dummy function? I think any other function in between (inside the lib) will crash as well?

And the "limitation" will stay? Don't you think it will make user libs unusable for anything other than elementary functions?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Vladi wrote:Thanx for your prompt answer. But what do you mean with a dummy function? I think any other function in between (inside the lib) will crash as well?
You could do it like this :

Code: Select all

; proc
Procedure$ proc_private(a) ; private
  ProcedureReturn Str(a) 
EndProcedure 
ProcedureDLL$ proc(a) ; exported
  ProcedureReturn proc_private(a) 
EndProcedure 
;
ProcedureDLL$ p(b) 
  ProcedureReturn proc_private(b) ; use private version in your library
EndProcedure

Code: Select all

Debug proc(2)
Debug p(2)
Vladi wrote:Don't you think it will make user libs unusable for anything other than elementary functions?
No, you only have to use a 'dummy' function if you call an exported string function inside your library.
No problems with non string functions, private string functions or with exported string functions not called from inside the library.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Vladi
User
User
Posts: 33
Joined: Sun Sep 10, 2006 3:09 pm

Post by Vladi »

Ok, that's not nice, but it works, thanks.
But I think you should mention something about this in the manual...
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Thanks Vladi.
The help file is updated. You can read it online : http://www.tailbite.com/help/index.html
Post Reply