Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function and paramaters 1

Status
Not open for further replies.

LouisC4

Programmer
Jul 26, 2003
54
0
0
US
Hi All,

I have created a function that takes 4 parameters. When I call the function it looses the last parameter.

I call the function from an SQL statement, something like this:

par1 = "Hello "
par2 = "World "
par3 = "it "
par4 = "works!!!"

SELECT units, FormatX(par1, par2, par3, par4) FROM ...

FUNCTION FormatX(par1, par2, par3, par4)

rslt = par1+par2+par3+par4

RETURN

when it gets to the function, par4's value is .F., which gives me the type mismatch error message.

Any ideas why?

TIA

Louis
 
Hi Louis,

Make sure there isn't a table in the current work area with a column called Par4. Otherwise the value in the table will be used over the variable.

Good luck,
Shardlow.
 
Hi Louis,

In your function you need to say

RETURN rslt


Jim
 
In your function you need to say
RETURN rslt

Good catch Jim.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top