Page 1 of 1

Double passed parameter missing

Posted: Wed Nov 03, 2010 10:54 pm
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)

Re: Double passed parameter missing

Posted: Thu Nov 04, 2010 4:07 pm
by ABBKlaus
Seems to me like a known limitation, i'm just wondering because its not on the list :o

BR Klaus

Re: Double passed parameter missing

Posted: Fri Nov 05, 2010 12:13 pm
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)