• Variable not being found

    From Sidney Reilley@21:1/5 to All on Mon Oct 25 16:58:52 2021
    Noob here again ...

    [code]
    #!/usr/bin/mumps
    PARMS
    ; Parameter passing example routine
    SHOW(first,second,third)
    write !,"First value: ",first
    write !,"Second value: ",second
    set third="Modified"
    write !,"Third value: ",third
    quit

    set x=1,y="B"
    do SHOW^PARMS(x,y,.z)
    [/code]

    ─› ./PARMS.mps <99>

    First value:

    *** in or near line 5:
    write !,"First value: ",first
    *** E17 Variable not found

    BUT, it's there in the formal parameters - is it not?
    --
    Duke

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jens@21:1/5 to Duke on Tue Oct 26 01:06:02 2021
    Duke schrieb am Dienstag, 26. Oktober 2021 um 00:58:54 UTC+2:
    Noob here again ...

    [code]
    #!/usr/bin/mumps
    PARMS
    ; Parameter passing example routine
    SHOW(first,second,third)
    write !,"First value: ",first
    write !,"Second value: ",second
    set third="Modified"
    write !,"Third value: ",third
    quit

    set x=1,y="B"
    do SHOW^PARMS(x,y,.z)
    [/code]

    ─› ./PARMS.mps <99>

    First value:

    *** in or near line 5:
    write !,"First value: ",first
    *** E17 Variable not found

    BUT, it's there in the formal parameters - is it not?
    --
    Duke


    I think the problem is, that the routine gets in Line 5 without being called. I'd put the do SHOW^PARMS(x,y,.z) before the SHOW label followed by q QUIT.
    Jens

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jens@21:1/5 to All on Tue Oct 26 01:10:23 2021
    BTW, when you are in the same routine you don't need "do SHOW^PARMS(x,y,.z)", a "do SHOW(x,y,.z)" works too.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sidney Reilley@21:1/5 to Jens on Tue Oct 26 10:49:30 2021
    On Tue, 26 Oct 2021 01:10:23 -0700 (PDT)
    Jens <jewu34@web.de> wrote:

    BTW, when you are in the same routine you don't need "do
    SHOW^PARMS(x,y,.z)", a "do SHOW(x,y,.z)" works too.

    Thank you Jens, for both your replies! I need more coffee before I
    implement your advise. :-)
    --
    Duke

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)