Accessing Vars in Group Passed by Address 
Author Message
 Accessing Vars in Group Passed by Address

Clarion DOS 3.x

Is there a way for a Procedure to access the individual variables in a
Group structure that was passed to it by address?

For instance a Procedure defined:
MYPROC   PROCEDURE(*GROUP)

and a group defined as:
LISTVARS   GROUP
    NDX            LONG
                     END

Then the call to MYPROC(LISTVARS)

MYPROC(LVARS)
        CODE
        LVARS:NDX = 1
        RETURN

LVARS:NDX generates the error: Unknown Label

Thanks,
Brad Kunkel



Mon, 07 Jul 2003 03:21:50 GMT  
 Accessing Vars in Group Passed by Address
Hi Brad,
You should be using dot notation here, not the old prefix/colon i.e.

LVars.NDX

HTH

Jim

Quote:

> Clarion DOS 3.x

> Is there a way for a Procedure to access the individual variables in a
> Group structure that was passed to it by address?

> For instance a Procedure defined:
> MYPROC   PROCEDURE(*GROUP)

> and a group defined as:
> LISTVARS   GROUP
>     NDX            LONG
>                      END

> Then the call to MYPROC(LISTVARS)

> MYPROC(LVARS)
>         CODE
>         LVARS:NDX = 1
>         RETURN

> LVARS:NDX generates the error: Unknown Label

> Thanks,
> Brad Kunkel

--
! Jim Katz
! Certified Clarion Developer
! Author: ABC DLL Toolkit  Maintainer: DEF for ABC,DET for Legacy
! Web Site: http://www.iag.net/~jimkatz/
! Company:  iTradeZone,Inc.
! Using Clarion for Windows - Always looking for the simpler solution.


Mon, 07 Jul 2003 05:06:41 GMT  
 Accessing Vars in Group Passed by Address
Tried that but it doesn't work.  It interprets the period as an
end-of-control structure and gives the error Unknown Procedure Label on the
NDX.
Thanks,
Brad
Quote:

> Hi Brad,
> You should be using dot notation here, not the old prefix/colon i.e.

> LVars.NDX

> HTH

> Jim


> > Clarion DOS 3.x

> > Is there a way for a Procedure to access the individual variables in a
> > Group structure that was passed to it by address?

> > For instance a Procedure defined:
> > MYPROC   PROCEDURE(*GROUP)

> > and a group defined as:
> > LISTVARS   GROUP
> >     NDX            LONG
> >                      END

> > Then the call to MYPROC(LISTVARS)

> > MYPROC(LVARS)
> >         CODE
> >         LVARS:NDX = 1
> >         RETURN

> > LVARS:NDX generates the error: Unknown Label

> > Thanks,
> > Brad Kunkel

> --
> ! Jim Katz
> ! Certified Clarion Developer
> ! Author: ABC DLL Toolkit  Maintainer: DEF for ABC,DET for Legacy
> ! Web Site: http://www.iag.net/~jimkatz/
> ! Company:  iTradeZone,Inc.
> ! Using Clarion for Windows - Always looking for the simpler solution.



Mon, 07 Jul 2003 09:30:40 GMT  
 Accessing Vars in Group Passed by Address
Hi Brad,
Sorry about that, I just re-read your post and realized you're in DOS 3.x.
Can't help you there...

Regards,

Jim

Quote:

> Tried that but it doesn't work.  It interprets the period as an
> end-of-control structure and gives the error Unknown Procedure Label on the
> NDX.
> Thanks,
> Brad


> > Hi Brad,
> > You should be using dot notation here, not the old prefix/colon i.e.

> > LVars.NDX

> > HTH

> > Jim


> > > Clarion DOS 3.x

> > > Is there a way for a Procedure to access the individual variables in a
> > > Group structure that was passed to it by address?

> > > For instance a Procedure defined:
> > > MYPROC   PROCEDURE(*GROUP)

> > > and a group defined as:
> > > LISTVARS   GROUP
> > >     NDX            LONG
> > >                      END

> > > Then the call to MYPROC(LISTVARS)

> > > MYPROC(LVARS)
> > >         CODE
> > >         LVARS:NDX = 1
> > >         RETURN

> > > LVARS:NDX generates the error: Unknown Label

> > > Thanks,
> > > Brad Kunkel

> > --
> > ! Jim Katz
> > ! Certified Clarion Developer
> > ! Author: ABC DLL Toolkit  Maintainer: DEF for ABC,DET for Legacy
> > ! Web Site: http://www.iag.net/~jimkatz/
> > ! Company:  iTradeZone,Inc.
> > ! Using Clarion for Windows - Always looking for the simpler solution.

--
! Jim Katz
! Certified Clarion Developer
! Author: ABC DLL Toolkit  Maintainer: DEF for ABC,DET for Legacy
! Web Site: http://www.iag.net/~jimkatz/
! Company:  iTradeZone,Inc.
! Using Clarion for Windows - Always looking for the simpler solution.


Mon, 07 Jul 2003 21:21:13 GMT  
 Accessing Vars in Group Passed by Address
Brad,

Quote:
> Is there a way for a Procedure to access the individual variables in a
> Group structure that was passed to it by address?

Don't know the correct way (if there is one)
but you may want to try one of these:
Quote:
> MYPROC(LVARS)
LocalLong    LONG
>         CODE

           LocalLong = 1
           LVARS[1:4] = LocalLong
Quote:
>         RETURN
or
> MYPROC(LVARS)

LocalGrp   GROUP        !Exactly like passed group
NDX             LONG
                   END
Quote:
>         CODE

           LocalGrp = LVARS
           NDX = 1
           LVARS = LocalGrp

Quote:
>         RETURN

--
Best regards,
Maarten
CDD3.1, C5EEb - ABC & C5.5EEgold
Certainly Clarion Developer


Tue, 08 Jul 2003 03:31:41 GMT  
 Accessing Vars in Group Passed by Address
Clarion 3.x DOS

Maarten,

The second way works.  Do you know of a way to access individual elements in
a passed Queue?  How about a passed Screen structure?

Thanks,
Brad

Quote:

> Brad,

> > Is there a way for a Procedure to access the individual variables in a
> > Group structure that was passed to it by address?

> Don't know the correct way (if there is one)
> but you may want to try one of these:
> > MYPROC(LVARS)
> LocalLong    LONG
> >         CODE
>            LocalLong = 1
>            LVARS[1:4] = LocalLong
> >         RETURN
> or
> > MYPROC(LVARS)
> LocalGrp   GROUP        !Exactly like passed group
> NDX             LONG
>                    END
> >         CODE
>            LocalGrp = LVARS
>            NDX = 1
>            LVARS = LocalGrp
> >         RETURN

> --
> Best regards,
> Maarten
> CDD3.1, C5EEb - ABC & C5.5EEgold
> Certainly Clarion Developer



Tue, 08 Jul 2003 08:54:36 GMT  
 Accessing Vars in Group Passed by Address
You need to define the group as a global TYPEd group:

Global Data:
ListVarsType   GROUP,TYPE
NDX                      LONG
                          END

In the calling procedure:

ListVars     ListVarsType
  CODE
  MYPROC(ListVars)

Prototype:
MYPROC   PROCEDURE(ListVarsType ListVars)

Then you can access ListVars.NDX

Peter Gysegem
Beaver Creek Software

Quote:

>Clarion DOS 3.x

>Is there a way for a Procedure to access the individual variables in a
>Group structure that was passed to it by address?

>For instance a Procedure defined:
>MYPROC   PROCEDURE(*GROUP)

>and a group defined as:
>LISTVARS   GROUP
>    NDX            LONG
>                     END

>Then the call to MYPROC(LISTVARS)

>MYPROC(LVARS)
>        CODE
>        LVARS:NDX = 1
>        RETURN

>LVARS:NDX generates the error: Unknown Label

>Thanks,
>Brad Kunkel



Wed, 09 Jul 2003 02:01:58 GMT  
 Accessing Vars in Group Passed by Address
Clarion DOS 3 doesn't seem to recognize TYPEs.  Is that only for Windows?
Thanks,
Brad Kunkel
Quote:

> You need to define the group as a global TYPEd group:

> Global Data:
> ListVarsType   GROUP,TYPE
> NDX                      LONG
>                           END

> In the calling procedure:

> ListVars     ListVarsType
>   CODE
>   MYPROC(ListVars)

> Prototype:
> MYPROC   PROCEDURE(ListVarsType ListVars)

> Then you can access ListVars.NDX

> Peter Gysegem
> Beaver Creek Software


> >Clarion DOS 3.x

> >Is there a way for a Procedure to access the individual variables in a
> >Group structure that was passed to it by address?

> >For instance a Procedure defined:
> >MYPROC   PROCEDURE(*GROUP)

> >and a group defined as:
> >LISTVARS   GROUP
> >    NDX            LONG
> >                     END

> >Then the call to MYPROC(LISTVARS)

> >MYPROC(LVARS)
> >        CODE
> >        LVARS:NDX = 1
> >        RETURN

> >LVARS:NDX generates the error: Unknown Label

> >Thanks,
> >Brad Kunkel



Wed, 09 Jul 2003 13:08:50 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Passing group by address

2. Passing sub GROUPs to procedures by ADDRESS

3. Addressing local vars using tasm

4. passing shell vars to gawk

5. passing vars to shell script

6. passing vars to awk script

7. Passing and getting vars. from C to awk

8. HELP: Passing Unix vars to AWK

9. passing run-time vars to RRUN

10. How pass compound vars to subroutine?

11. vars passing through URL

12. Newbie - passing variable number of vars to expect script

 

 
Powered by phpBB® Forum Software