HELP! Passing Integers by Value 
Author Message
 HELP! Passing Integers by Value

Can anyone tell me what's wrong with this code.  I'm trying to pass two
integers to a long-integer function that will use ASM to calculate
combinations.  My current code begins:

'    Main Program
DECLARE FUNCTION COMB&(BAG%,TAKE%)
JOE&=COMB&(CINT(6%),CINT(4%))
PRINT JOE&
END

'Beginning of a function
FUNCTION COMB& (byval BAG%,byval TAKE%)

I keep getting "error 481: Parameter mis-match; may need ByCopy" on the
FUNCTION statement.  I definitely want to send the parameters by value
because later I'm going to use the same function and pass it things like
CINT(25 - A% + B%).  It sure looks to me like I'm doing everything
possible to send two integers.  Am I missing something?



Sat, 08 Feb 2003 03:00:00 GMT  
 HELP! Passing Integers by Value
An uninformed, untested guess: you need the BYVAL keyword in your
DECLARE statement.



Quote:
>Can anyone tell me what's wrong with this code.  I'm trying to pass two
>integers to a long-integer function that will use ASM to calculate
>combinations.  My current code begins:

>'    Main Program
>DECLARE FUNCTION COMB&(BAG%,TAKE%)
>JOE&=COMB&(CINT(6%),CINT(4%))
>PRINT JOE&
>END

>'Beginning of a function
>FUNCTION COMB& (byval BAG%,byval TAKE%)

>I keep getting "error 481: Parameter mis-match; may need ByCopy" on the
>FUNCTION statement.  I definitely want to send the parameters by value
>because later I'm going to use the same function and pass it things like
>CINT(25 - A% + B%).  It sure looks to me like I'm doing everything
>possible to send two integers.  Am I missing something?



Sat, 08 Feb 2003 03:00:00 GMT  
 HELP! Passing Integers by Value
Yup.

Thanks much.

Quote:

> An uninformed, untested guess: you need the BYVAL keyword in your
> DECLARE statement.



> >Can anyone tell me what's wrong with this code.  I'm trying to pass two
> >integers to a long-integer function that will use ASM to calculate
> >combinations.  My current code begins:

> >'    Main Program
> >DECLARE FUNCTION COMB&(BAG%,TAKE%)
> >JOE&=COMB&(CINT(6%),CINT(4%))
> >PRINT JOE&
> >END

> >'Beginning of a function
> >FUNCTION COMB& (byval BAG%,byval TAKE%)

> >I keep getting "error 481: Parameter mis-match; may need ByCopy" on the
> >FUNCTION statement.  I definitely want to send the parameters by value
> >because later I'm going to use the same function and pass it things like
> >CINT(25 - A% + B%).  It sure looks to me like I'm doing everything
> >possible to send two integers.  Am I missing something?

--
"Out here {*filter*}, in front of a man -- you feel like a criminal."
   -- inmate at DC jail on being strip-searched (Wash Post, 3/21/00)


Sat, 08 Feb 2003 03:00:00 GMT  
 HELP! Passing Integers by Value

Quote:
> Can anyone tell me what's wrong with this code.  I'm trying to pass two
> integers to a long-integer function that will use ASM to calculate
> combinations.  My current code begins:

> '    Main Program
> DECLARE FUNCTION COMB&(BAG%,TAKE%)
> JOE&=COMB&(CINT(6%),CINT(4%))
> PRINT JOE&
> END

> 'Beginning of a function
> FUNCTION COMB& (byval BAG%,byval TAKE%)

Put the ByVal in the DECLARE statement as well.  Also, you don't need the
CINT function to convert 6% and 4% to integers.  They already ARE integers.

Tom L



Sun, 09 Feb 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problem : Unable to pass an integer value from Visual Basic to Fortran DLL

2. Problem : Unable to pass an integer value from Visual Basic to Fortran DLL

3. Help! Integer value too large

4. HELP: Tcl command for getting integer value of character

5. Are method args pass-by-value or pass-by-reference

6. Speed of pass by reference vs pass by value

7. HELP: Passing values between programs?

8. how can i use control reference to pass integer to a sub VI

9. How to Fix Passing Hollerith as Integer ??

10. integer passing

11. Searching dictionaries for large integer values

12. hex value to integer conversion

 

 
Powered by phpBB® Forum Software