Double passed parameter missing

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

zoot33
User
User
Posts: 69
Joined: Sat Jul 11, 2009 7:43 pm
Location: Oxford, UK

Double passed parameter missing

Post by zoot33 »

The value of a is wrong when using a double as the first parameter ?
The passed string empty when using a double as the first parameter ?

Is there a workaround that doesn't involve putting str(5000) into a variable before calling the library ?

Thanks.

libTest.pb

Code: Select all

ProcedureDLL doubleTest(a.d, text$, z.f)
  Protected message$
  
  message$ + "a = " + StrD(a) + #CRLF$
  message$ + "text$ = " + text$ + #CRLF$
  message$ + "z = " + StrF(z)
  
  MessageRequester("Results",message$)
EndProcedure

ProcedureDLL floatTest(a.f, text$, z.f)
  Protected message$
  
  message$ + "a = " + StrF(a) + #CRLF$
  message$ + "text$ = " + text$ + #CRLF$
  message$ + "z = " + StrF(z)
  
  MessageRequester("Results",message$)
EndProcedure
callingCode.pb

Code: Select all

doubleTest(99.12345,Str(5000), 99.12345)
floatTest(99.12345,Str(5000), 99.12345)
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Double passed parameter missing

Post by ABBKlaus »

Seems to me like a known limitation, i'm just wondering because its not on the list :o

BR Klaus
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: Double passed parameter missing

Post by gnozal »

I agree : it is a known issue.
It is never a good idea to use an expression / function as argument in a 'tailbited' function.

Better use literals or variables.

Code: Select all

doubleTest(99.12345,"5000", 99.12345)
floatTest(99.12345,"5000", 99.12345)

a$ = Str(5000)
doubleTest(99.12345,a$, 99.12345)
floatTest(99.12345,a$, 99.12345)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply