Re: GCIC Fullscreen applications Replace algorythm
"paoloG" <[email protected]>
| Newsgroups | gmane.comp.emulators.hercules390.vm |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], "Rocky" <rocsystems@...> wrote: > > > > 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 > Rocky, I'll give you my thoughts;-) if RECFM=F and LRECL=80 you should trunc at length=72, if RECFM=F and LRECL>80 you should trunc at length=LRECL, if RECFM=V you should shift the whole line to the right. BTW you're doing an excellent job; I'm really astonished! Regards. Paul