× 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.



Booth,

The issue I am trying to resolve is having these XMLRtnAttr() words
scattered all through dozens of lines of >>code, hard to find, hard to proof
read, and hard to use.

You could define an array which contains both the text string and also space
for the return value, e.g.:

D Array DS Qualified
D Idx 10I 0
D LU 10I 0
D Elm Dim(10)
D String 10A Overlay(Elm)
D RtnVal 10A Overlay(Elm:*Next)
*
D ArrayPtr S * Inz(%addr(Array.Elm))
D ArrayData S 200A Inz('RawReading +
D OtherValue +
D AnotherOne +
D +
D +
D +
D +
D +
D +
D ')
/free
Array.RtnVal(1) = XMLRtnAttr( Array.String(1) );

Admittedly this means that in your inline code you're not referring to the
strings but simply to array elements, but it gives you more flexibility to
add new elements. Also it keeps all your strings in one place (in the array
at the top). Obviously you'd need to define your RtnVal and String fields
large enough to accept the largest values they might take, but I'm sure you
get my drift. You could even define the actual strings in a CTDATA array at
the bottom of your source and load it when the program starts, rather than
include them in the D-specs.

HTH,

Rory

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.