Re: GCIC Fullscreen applications Replace algorythm

"Rocky" <[email protected]>
Newsgroups gmane.comp.emulators.hercules390.vm
Message-ID <[email protected]>

I threw this question out yesterday but have had no specific suggestions as to how the REPALCE alogrythm should work when one the replacing field is larger or smaller than the field being replaced.

When it is smaller than the filed it is replacing  what do we do?
replace the field and PAd with blanks or shift the entire line
is there a trunc function needed

Blanks are valid arguments for Replace and search. But they may also have a special delimiting function.

What do we do when the replacing field is larger

Do we just shift the whole record from that point
Do we have a trunC position that stops the shifting
Do we arbitarily shift out the last position of the record.
Do we remove Blanks in the middle
and leave as much unchanged as possible.

In the absence of an algorythm I will not waste any more time on this

If no one has thoughts I will add a trunc position that will default to 72 but that can be changed and I will just shift the whole line to the right or left from where the string is found.
That is the easiest logic though not necessarily the best.

If I have to shift anything other than blanks out of the record it will be an error

Message  will be:  Some records not replaced
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.