As far as I understood my recent ByRef, ByVal learning experience,  
then yes, your msgbox should read '1'.

Subroutines should not affect intNumber unless you are passing it ByRef

- Tom

On 21/02/2007, at 12:33 PM, David Glass wrote:

> I think I'm having a scoping issue, and would appreciate somebody
> verifying what I think is correct behavior.
>
> If I do something like this:
>
> dim intNumber as integer
>
> intNumber = 1
>
> subMyMethod(intNumber)
>
> MsgBox str(intNumber)
>
>
> And subMyMethod looks like this:
> Sub
> intNumber = intNumber + 10
> End Sub
>
> Then the MsgBox in the original should display '1', right?
>
> Changing intNumber inside the method should have no effect on
> intNumber in the calling location, right?
>
> -- 
> David Glass - Gray Matter Computing
> graymattercomputing.com - corepos.com
> 559-303-4915
>
> Apple Certified Help Desk Specialist
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to