Single-Line entry or Deletion

Syntax

──<sequence number>─┬─────────────────────────────────────┬────────────%
                    ├─<text>──────────────────────────────┤
                    └─ @ ─┬─────────────────┬─ : ──<text>─┘
                          ├─<integer>───────┤
                          ├─ + ─┬─<integer>─┘
                          └─ ─ ─┘

Explanation

Any line beginning with a sequence number is a command to enter a new line of text in the work file at the sequence specified or to replace or delete the line already at that sequence number. The line consists of a <sequence number> followed immediately by an optional margin specification and text field. The sequence number begins the input line and continues until a nondigit character is encountered. (The maximum number of digits allowed in the sequence number is determined by the file type. Refer to Record Formats for more information.)

When <sequence number> is entered, the line at the indicated sequence number is deleted. If no line with that sequence number exists, the command is ignored. Spaces trailing the sequence number are considered <text>.

When <sequence number><text> is entered, the new line of text is entered at the sequence number specified. If a line already exists at the sequence number, the line is deleted and the new line of text is entered. If the first character following the <sequence number> is the at sign (@), CANDE interprets it as a margin specification. If the user wishes to enter an at sign (@) as the first character of <text>, the <text> must be preceded by an extra at sign (@). That is, an at sign (@) must appear twice (@@) if it is to be entered as the first character of <text>.

The text entry is controlled by either the margin column number set by the MARGIN command or the start column number set by the PAGE <column range spec> command, whichever is larger.

Example

MAKE MYFILE C74
#WORKFILE MYFILE: COBOL74

MARGIN 10
#

PAGE @20-50
#EMPTY WORKFILE
#

100M=10 AND S=20

MARGIN 30
#

200M=30 AND S=20

PAGE *
#UPDATING

NEXT+ ...1....*....2....*....3....
000100             M=10 AND S=20
000200                    M=30 AND S=20
#DISPLAY COMPLETE

Margin Specifications: The @ Option

The beginning column for text can be specified by using the @ option. If this option is not specified, the default is column 1. The at sign (@) followed only by a colon (:) indicates that the text is to begin in column 1. Thus, if the current margin setting is 5, it allows the text of the one line to begin at column 1. The @ option followed by an <integer> specifies that the text is to start in the column specified by <integer>. Thus, the following command enters a line in the work file at sequence number 100 with the word text beginning in column 5:

100@5:text

The @ option followed by +<integer> or –<integer> specifies that the text is to begin plus or minus the number of columns specified by <integer>, relative to the current margin setting. For example, the following command enters a line in the work file at sequence number 100 with the word text beginning five columns to the right of the current margin setting:

100@+5:text

If the current margin setting is 10, then text begins in column 15.

Note: To permanently set the margin to a particular column, the MARGIN command must be used.

Examples

MAKE TEST1 DATA
#WORKFILE TEST1:SEQ
25begin
100this is a single-line entry
215and so is this
25begin 
300@5:this text starts in column 5
315@+10:this text starts in col. 11 (col. 1 + 10 = 11)
317@@ this text begins with a single "@" character
000003208 digits maximum in type seqdata files

list
#WORKFILE TEST1
25 begin                                                    
100 this is a single-line entry                             
215 and so is this                                          
300     this text starts in column 5                        
315           this text starts in col. 11 (col. 1 + 10 = 11)
317 @ this text begins with a single "@" character          
320 8 digits maximum in type seqdata files                  
#          
215
300line 215 was just deleted, and this replaces the line at 300

list
#WORKFILE TEST1
25 begin                                                        
100 this is a single-line entry                                 
300 line 215 was just deleted, and this replaces the line at 300
315           this text starts in col. 11 (col. 1 + 10 = 11)    
317 @ this text begins with a single "@" character              
320 8 digits maximum in type seqdata files                      
#