Re: GCIC Fullscreen applications

"Rocky" <[email protected]>
Newsgroups gmane.comp.emulators.hercules390.vm
Message-ID <[email protected]>
Need an algorythm for the search/replace routine.

Anybody have any experience with this or a well thought out sugestion.

Issue is:

We probably need a trunc command to tell us where to stop shifting
We need to know what to do if we find an impossibe situation

My ideas is

String2 replaces string1

If string 2 is shorter than string1 than pad with blanks and don't touch anything else in the record.

Same if string2 is equal in length to string1 without the padding

If string 2 is greater it begins to get complicated.

My thoughts are:

If there are enough blanks immediately adjacent then use them as long as you leave at least one blank

if not enough blanks then find the first place that there are two  blanks to the right of the insert and shift up to 1 blank and then continue.

Cannot eliminate blanks that are between Quotes "" or ' '
Cannot shift past the trunc setting

that is sort of the idea that I have but does anybody have some serious thoughts on how to do this, or what the proper algorytm should be.

Not a simple routine. The things we take for granted in x-edit or ispf edit are not all that simple.

What is the proper logic?  Not the kind of routine that I want to write more than once. 

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