Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error trying to call a function
Message
De
09/07/2000 13:31:24
 
 
À
09/07/2000 11:26:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00389959
Message ID:
00389982
Vues:
22
>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform