× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The short answer is, you can't directly.

You might consider making the data structure contain only the two
fields MARKER and PATH and then make it an array (use the DIM
keyword) Then you can access each "element" by

  myDs(x).Marker
  myds(x).path

Should give you the same kind of results.

-Bob

> 
> 
> I have a data area that is 1030 characters long with
> the structure
> marker1      3  0
> path1       100a
> marker2      3  0
> path2       100a
> marker3      3  0
> path3        100a
> .
> .
> marker10   3  0
> path10      100a
> 
> How do I create a ds to move the data area into an array so I can
> use code
> like the following....
> /free
>    for x = 1 to 10;
>       if pdfloc.marker(x) = somevar;
>            path =pdfloc.path(x);
>       endif;
>    endfor;
> /endfree
> 
> this is how I think it would look but am unsure
> d pathds    ds            based(@) qualified
> d   marker    3  0
> d   path     100a
> d
> d                   ds
> d  pdfloc                    likeds(pathds) dim(10)
> c
> 
> does this look right:
> 
> J. Scott Carter
> Programmer/Analyst
> e-mail: Mailto:scarter@xxxxxxxxxxx
> Phone: 214.583.0348
> 
> It's not the destination that counts in life it's the journey. The
> journey
> with the people we love is all that really matters. Such a simple
> truth so
> easily forgotten.
> 
> 
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.