Re: Passing by Value 101 ?

View: New views
2 Messages — Rating Filter:   Alert me  

Re: Passing by Value 101 ?

by Bill Brutzman-2 :: Rate this Message:

| View Threaded | Show Only this Message

It is not clear to me why "Passing By Value" is worth anything.  

I am surprised that this thread has led to so many responses... most... I did not read.

>From here... having a variable with a name... and calling an external subroutine... is all the bread and butter that  I would ever need.

  myGuzInTa = ''
                                    myGuzOutA = ''
                                                              errorFlag = ''
Call *SUB.MY.THING.R1(myGuzInTa, myGuzOutA, errorFlag)

Begin case
            Case myGuzOutA = ''  ;  gosub xx
             Case 1                              ;  gosub yy
End    case

Putting a thingy-poo in double parens seems to be at odds with good programming practice.

Perhaps I am missing something...

I promise to try to read clarifying responses...

--Bill

_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Parent Message unknown Re: Passing by Value 101 ?

by u2ug-3 :: Rate this Message:

| View Threaded | Show Only this Message

It gives the calling routine a way to ensure that a called routine can't
modify the variables value ( intentionally or inadvertently ).

FOR COUNTER=1 TO 10
        IF IWANTTOCAUSEPROBLEMS
                THEN CALL *BADSUB( @LOGNAME , COUNTER ) ;* go boom !
                ELSE CALL *BADSUB( (@LOGNAME) , (COUNTER) ) ;*
everything ok
NEXT

SUBROUTINE BADSUB (ARG1,ARG2)
        ARG1="XXX" ;* this will globally change the value of
@LOGNAME believe it or not
        ARG2="XXX" ;* this will mess up the FOR NEXT
END


-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of Bill Brutzman
Sent: Friday, January 27, 2012 7:52 PM
To: U2 Users List
Subject: Re: [U2] Passing by Value 101 ?

It is not clear to me why "Passing By Value" is worth anything.  

I am surprised that this thread has led to so many responses... most...
I did not read.

>From here... having a variable with a name... and calling an external
subroutine... is all the bread and butter that  I would ever need.

  myGuzInTa = ''
                                    myGuzOutA =
''
                                                              errorFlag
= ''

Call *SUB.MY.THING.R1(myGuzInTa, myGuzOutA, errorFlag)

Begin case
            Case myGuzOutA = ''  ;  gosub xx
             Case 1                              ;  gosub yy
End    case

Putting a thingy-poo in double parens seems to be at odds with good
programming practice.

Perhaps I am missing something...

I promise to try to read clarifying responses...

--Bill

_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users