Copy 1 line Example (:C)


 

Copy 1 line Example (:C)

 

 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;

 

 STOP

 IF ESCAPE

 

 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

 

 

 

:C

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

>ZIP

DIM

5

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

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

 

 STOP

 IF ESCAPE

 

 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

 

 

 STATE

DIM

2

Note the following:

  1. The copied line is deleted from the screen.

  2. The new line is on the bottom data line (23).

 

Copy 3 lines Example (:C3)

 

 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;

 

 STOP

 IF ESCAPE

 

 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

 

 

 

:C3

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

>CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

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

 

 STOP

 IF ESCAPE

 

 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

 

 

 STATE

DIM

2

 ZIP

DIM

5

 ROUTE

DIM

4

Note the following:

  1. The copied lines are deleted from the screen.

  2. As each new line is copied to the bottom of the screen, a close window function is performed to take in the space left by the deleted line. This is done by rolling all lines below (and including) the pointed line, up one line at a time.

 

Copy To Scratch File 2 Lines Example (:CO2)

 

 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;

 

 STOP

 IF ESCAPE

 

 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

 

 

 

:CO2

 

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;

 

 STOP

 IF ESCAPE

 

 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. After execution of the last copy out, the pointer references the last line copied.

  2. All lines copied are retained in the input file.

  3. After the copy out, the copy scratch file contains only two records.

  4. If the :CQ option had been used, the copy scratch file would have contained all original records followed by the two new records.

 

Copy To Scratch File and Delete 2 Lines Example (:COD2)

 

 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;

 

 STOP

 IF ESCAPE

 

 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

 

 

 

:COD2

 

After command:

 

 NAME

DIM

30

 ADDRESS

DIM

30

 CITY

DIM

17

>ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

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

 

 STOP

 IF ESCAPE

 

 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. After execution of the last copy out, the pointer references the line after the last line copied.

  2. All lines copied are deleted from the input file.

  3. After the copy out, the copy scratch file contains only two records.

  4. If the :CQ option had been used, the copy scratch file would have contained all original records followed by the two new records.

 

Copy In From Scratch File Example (:CI)

 

 NAME

DIM

30

 ADDRESS

DIM

30

>CITY

DIM

17

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

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

 

 STOP

 IF ESCAPE

 

 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

 

 

 

:CI

 

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;

 

 STOP

 IF ESCAPE

 

 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 copy scratch file contained only 2 records - STATE and ZIP.

  2. Both of these records are inserted following the pointed line.

  3. All records are retained in the copy scratch file.

  4. The copy scratch file used is named 'SCRATCH.C01'. Another file could have been used by specifying the filename as below:
     

  5. :CI"NEWFILE.TXT"

    This would have caused all records from file 'NEWFILE.TXT' to be inserted as per note 2 above.

 

Copy In From Scratch File Example (:CI2,4)

 

 NAME

DIM

30

>ADDRESS

DIM

30

 ROUTE

DIM

4

 CITYSTZ

DIM

30

 .

 

 

 LOOP1

 

 

 

LOOP

 

 

 KEYIN

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

 

 STOP

 IF ESCAPE

 

 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

 

 

 

:CI2,4

 

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;

 

 STOP

 IF ESCAPE

 

 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 copy scratch file contained n records.

  2. Only records 2, 3 and 4 are inserted following the pointed line.

  3. All records are retained in the copy scratch file.

  4. The copy scratch file used is named 'SCRATCH.C01'. Another file could have been used by specifying the filename as below:

:CI"NEWFILE.TXT"2,4

This would have caused records 2 through 4 from file 'NEWFILE.TXT' to be inserted as per note 2 above.

 

 

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

 



System Utilities Conventions and Data Display Copy Commands