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



It is also faster to use varying length fields than trimming off blanks from
a string.

When trimming off all characters (beginning from the last one) get checked,
while for varying length fields a "substring" gets performed for the number
of characters specified in the 2/4 leading bytes. If it is a big text field
which is only filled with a few characters, it may be time consuming. Also
when using EVAL to fill a field with fixed length all trailing characters
must be replaced with a blank. Because for varying length fields the length
of the string is stored in the first 2/4 Bytes it is not necessary to
replace the trailing bytes into blanks, i.e. they stay unchanged and get
overwritten the next time more characters get filled into the field.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Pete Hall
Gesendet: Friday, 11. September 2009 03:04
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: Use of VARYING fields

David FOXWELL wrote:
Hi,

I was asked why use this kind of variable. A part from tidying up the code
when concatenating text fields, I wasn't sure. The problem is that our data
dictionary is used in all our RPG sources and all zones are supposed to be
declared like a field in the dictionary.

Are there other advantages?

Thanks

They're very much like strings in most other languages, where char
fields are more like an array of char. Varying variables make string
manipulation (concatenation, character substitution, passing arbitrary
length values, program defined output buffering, empty strings, etc)
much easier. Try writing a parser, or managing a delimited data
structure with fixed length strings. You'll see the advantage.


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.