Syntax for creating a function 
Author Message
 Syntax for creating a function

Hi there,

I want to create a function in a modules to calculate the
average of each difference of some records in number. Then
I can use this function in query. It's like a formula of
the standard deviation. So I used the For Loop in the
modules. But I don't know the syntax for the number of
record. I also don't know how to call the name in the
modules? Or would you give me an example if I want to
create a function of the standard deviation by myself?

Thanks,
Florence



Tue, 03 May 2005 03:18:37 GMT  
 Syntax for creating a function
Try this (untested aircode):
' ===== BEGIN FUNCTION =====
Public Function fnStandDev(iNumOne as Integer, iNumTwo as
Integer)

   fnStandDev = 'Do Something with iNumOne and iNumTwo
(Put your calculation here)

End Function
' ===== END FUNCTION =====
In a QBE grid you would put:
  MyStandDev:fnStandDev(NumFieldOne, NumFieldTwo)

Not being a mathmatician, I may be way off.....
--
HTH
Tim Hansen

========================

Quote:
>-----Original Message-----
>Hi there,

>I want to create a function in a modules to calculate the
>average of each difference of some records in number.
Then
>I can use this function in query. It's like a formula of
>the standard deviation. So I used the For Loop in the
>modules. But I don't know the syntax for the number of
>record. I also don't know how to call the name in the
>modules? Or would you give me an example if I want to
>create a function of the standard deviation by myself?

>Thanks,
>Florence
>.



Tue, 03 May 2005 05:38:58 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Function within Function Syntax error

2. creating a callback function in c++ dll to callback a VB function in an exe

3. Function Syntax Error

4. Syntax for function to return an array

5. syntax error running function in macro

6. Problem with function/syntax.......

7. WHY syntax error on this Function call??????

8. easy question - date function syntax?

9. Syntax and function reference

10. How to force syntax error for missing functions?

11. No wrapping of function syntax in help

12. Syntax for Left function?

 

 
Powered by phpBB® Forum Software