Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error trying to call a function
Message
From
09/07/2000 14:23:17
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00389959
Message ID:
00389997
Views:
23
Kelly,

In addition to what Ed has pointed out, if it is a stored procedure in a database, the database must be opened. If the procedure is stored in a program file (.prg), use SET PROCEDURE TO programname ADDITIVE, so VFP can find the procedure.

HTH
Jon

>>I put this function in my stored procedures, i get an error when i try to call the program it says cant find feecalc.prg when it gets to this line in my code.
>>this is a test program i wrote just to test the passing of varibales from this and back to this program.
>>
>>loandate = {04/09/2000}
>>loanamt = 100
>>strcode = 0
>>firearmcode = "E"
>>govermentcode = .T.
>>
>>amtdue = feecalc(loandate,loanamt,strcode,firearmcode,govermentcode)
>>this line where it calls the program and gives the error. ^^^^^
>>
>>? amtdue
>>
>>here is my function in my stored procedures
>>
>>function feecalc(amtdue)
>>lparameters loandate,loanamt,strcode,firearmcode,govermentcode
>
>Your error is here. You've specified the parameters of the function twice, and they do not match. The line:
>
>FUNCTION feecalc(amtdue)
>
>says that one parameter will be passed, and referenced by the name "amtdue"
>
>lparameters loandate,loanamt,strcode,firearmcode,govermentcode
>
>states that there are 5 parameters. I suspect that you want the lparameters statement. Omit the "(amtdue)" from the function declaration. Define amtdue as a local variable for the function, and use the local variable to hold the result. To return amtdue to the calling procedure, you specify what you want to return in the RETURN statement; it would read
>
>RETURN amtdue
>
>to pass back the value of amtdue to the caller.
>
>>local storage,loanduration,prorateamt,amtdue,sixday,thrtday
>>local annualrate
>>
>>use fees &&load fees table
>>scatter memvar && load all fields to varibals
>>use && clear table
>>use intrest && load intrest table
>>scatter memvar && load all fields to variables
>>use && clear table
>>loanduration = date() - loandate
>>sixtyday = sixtyday / 100 && normilze values
>>thirtyday = thirtyday / 100 && normilze values
>>
>>I didn't put the hole fucntion in it would be too long
>>at then end i have
>>return
>>endfunc
>>I probably dont need endfunc sense it the only function there
>>
>>I just cant seem to find good examples of simple things like this in the help files i dont know why.
>>
>>thanks kelly
Previous
Reply
Map
View

Click here to load this message in the networking platform