Passing by VAL and VAR 
Author Message
 Passing by VAL and VAR

        I once read -- and now I cannot find it when I need it! -- that
there is an undocumented feature of FUNCTION and SUB in Q[uick]Basic that
if you use the parentheses in one way you pass parameters by VAL and used
another way you pass by VAR.  Does anyone remember or recall seeing this
and tell me how it is done?  Thank you all in advance.

David Solly

--

Ottawa, Ontario, CANADA      FidoNet:  1:163/215
Voice: (613)731-2120



Mon, 01 Dec 1997 03:00:00 GMT  
 Passing by VAL and VAR

Quote:

>    I once read -- and now I cannot find it when I need it! -- that
>there is an undocumented feature of FUNCTION and SUB in Q[uick]Basic that
>if you use the parentheses in one way you pass parameters by VAL and used
>another way you pass by VAR.  Does anyone remember or recall seeing this
>and tell me how it is done?  Thank you all in advance.

>David Solly

You could do that with QuickBasic v3.0.  I don't know about newer versions
(they support BYREF now).  The default parameter passing procedure with QB 3.0
was by reference.  You could defeat this by putting a set of () around each
seperate parameter -- thus passing by value.

Like I said, I'm not quite sure as to what is done with newer versions of QB --
I basically stoped at v3.0 -- moved onto bigger and supposedly better things.

Damo



Mon, 01 Dec 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing a local var to a global session var

2. var's that retain their val?

3. var = var = var

4. var = var = var

5. Insert new rec, then pass new identity val back to Access97

6. EVENT with paramters passed by reference: be able to change a val ue

7. How Do I pass a var to Crystal?

8. Passing a server side var to client side block

9. pass vb var. from one page to another

10. Help please..passing var's between frames

11. Passing a var into a fucntion

12. Error 91: Object Var or With block var not set

 

 
Powered by phpBB® Forum Software