Data line MODIFY Example (:M ,NAME<,$NAME)


 

Data line MODIFY Example (:M ,NAME<,$NAME)

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

 

:M ,NAME<,$NAME

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,$NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

Note the following:

  1. The pointed line remains the same and no other data lines are moved or modified.

  2. The modified data line is redisplayed with all modifications.

  3. All fields are searched for the first occurrence of the old string ',NAME' When found, it is replaced with the new string ',$NAME'.

  4. This example and the next two all accomplish the same task using three different command strings. Not one of these command strings is considered the best way of performing this particular modify.

 

Data line MODIFY Example (:M3 ,NAME<,$NAME)

 

NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

 

:M3 ,NAME<,$NAME

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,$NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

Note the following:

  1. The pointed line remains the same and no other data lines are moved or modified.

  2. The modified data line is redisplayed with all modifications. Only field 3 is modified.

  3. Only field 3 is searched for the first occurrence of the old string ',NAME'. When found, it is replaced with the new string ',$NAME'.

 

Data line MODIFY Example (:MV3 ,>$)

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

 

:MV3 ,>$

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,$NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

Note the following:

  1. The pointed line remains the same and no other data lines are moved or modified.

  2. The modified data line is redisplayed with all modifications. Only field 3 is modified.

  3. Only field 3 is searched for the first occurrence of the old string ','. When found, the operator is queried for a YES or NO response. If a 'Y' is entered, the modification is done. Any other ASCII character results in the next occurrence being located. A null entry terminates the search. In the above case, 'N' was entered for the first ',' and 'Y' was entered for the second ','.

 

Data line MODIFY Example (:M2 \)

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

 

:M2 \

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

Note the following:

  1. The pointed line remains the same and no other data lines are moved or modified.

  2. The modified data line is redisplayed with all modifications. No fields other than field 2 are modified by this operation.

  3. This command string causes all data in field 2 to be deleted. The command is to append the new string to the end of the old string in the field specified. Since no old string was given, the new data is appended at the beginning of field 2. The new data is null thus resulting in no data being present in field 2 after the modify operation is complete.

 

Data line MODIFY Example (:M2 \DISPLAY)

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

 

:M2 \DISPLAY

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 DISPLAY

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

Note the following:

  1. The pointed line remains the same and no other data lines are moved or modified.

  2. The modified data line is redisplayed with all modifications. No fields other than field 2 are modified by this operation.

  3. This command string causes all data in field 2 to be deleted and the new string inserted in its place. The command is to append the new string to the end of the old string in the specified field. Since no old string was given, the new data is appended at the beginning of field 2. The new data is 'DISPLAY'.

 

Data line MODIFY Example (:MP A<xx>)

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

REPEAT

WHILE FKEY

 LOOP2

 

 

 

:MP A<xx

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

>

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NxxME;

 

 CMxxTCH

 " ",NxxME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUxxL

 

 CMxxTCH

 "xx",NxxME

 

 CONTINUE

 IF LESS

 

 CMxxTCH

 "Z",NxxME

 

 CONTINUE

 IF GRExxTER

 

 BRExxK

 IF DOWN

 

REPExxT

WHILE FKEY

 LOOP2

 

 

Note the following:

  1. The pointed line is changed to the last line on the current screen. All lines below and including the original pointed line are modified as specified.

  2. The modified data lines are redisplayed with all modifications.

  3. This command string causes all occurrences of the character 'A' to be located and replaced with the string 'xx'.

  4. If the command had been GLOBAL (:MG) rather than PAGE (:MP), all data lines in the file would be scanned to determine if the old string existed. In addition, the pointed line would have remained line 5.

  5. If the 'N' option had been specified, the modified lines would not be redisplayed before all lines are modified.

 

Data line MODIFY Example (:MPQ1 $<)

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

>TABLE$

DIM

5

 TABLE$

DIM

5

 TABLE$

DIM

5

 TABLE$

DIM

5

 TABLE$

DIM

5

 TABLE$

DIM

5

 TABLE$

DIM

5

 TABLE$

DIM

5

 .

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

 

 CONTINUE

 IF EQUAL

 

 CMATCH

 "A",NAME

 

 CONTINUE

 IF LESS

 

 CMATCH

 "Z",NAME

 

 CONTINUE

 IF GREATER

 

 BREAK

 IF DOWN

 

 

REPEAT WHILE FKEY

 LOOP2

 

 

 

:MPQ1 $<

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

>TABLE1

DIM

5

 TABLE2

DIM

5

 TABLE3

DIM

5

 TABLE4

DIM

5

 TABLE5

DIM

5

 TABLE6

DIM

5

 TABLE7

DIM

5

 TABLE8

DIM

5

.

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

 *P01:04,"Full Name: ",*EDIT,NAME;

 

 CMATCH

 " ",NAME

 

 CONTINUE

 IF EOS

Note the following:

  1. The pointed line is changed to the last line on the current screen. All lines below and including the original pointed line are modified as specified.

  2. The modified data lines are redisplayed with all modifications.

  3. This command string causes all occurrences of the character '$' to be located and replaced with the string entered after finding the old string and querying the operator for the new string. The 'Q' parameter allows for a table to be built much easier.

  4. If the command had been GLOBAL (:MG) rather than PAGE (:MP), all data lines in the file would be scanned to determine if the old string existed. In addition, the pointed line would have remained line 5.

  5. If the 'N' option had been specified, the modified lines would not be redisplayed until all lines are modified.

  6. The F10 function key causes the modify to terminate when querying for the new string.

 

 

See Also: Modification Commands, SUNEDIT Commands, Line Edit Mode, SUNEDIT

 



System Utilities Cursor Movement State Data line SPLIT Example (:V KEYIN)