HPlogo EDIT/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 EDIT/3000 COMMANDS

Z::=

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

3-122. Z::=COMMAND

3-123. Purpose.

The Z::= command is used to assign a character string value to Z::=.

3-124. Form.

The form of the Z::=command is

    Z::=

3-125. Description.

When the Z::= command is entered in an interactive session, EDIT/3000 displays

     ENTER Z::=

at which point you may enter the value to be assigned to Z::=. For example,

     /Z::=

     ENTER Z::=

     "HP 3000"

In a batch job, EDIT/3000 assigns the record immediately following the Z::= command record to Z::=.

A series of EDIT/3000 commands, separated by semicolons, can be assigned to Z::= so that repetitious series of commands need not be repeated. For example,

    /Z::=

    ENTER Z::=

    LIST LAST;FINDQ FIRST;FIND "EDIT/3000"

Once a value is assigned to Z::=, this value can be invoked in an EDIT/3000 cycle by entering Z:: (without the equals sign) or using Z:: as part of a command, and whatever has been assigned to Z::=will be substituted by EDIT/3000. Z:: is only effective as a command line or part of a command line, not to input data once in the ADD, INSERT, REPLACE, or MODIFY modes.

The default value for Z:: is "Z::". It can be reset to the default by entering CONTROL Y or "//" when the prompt ENTER Z::= is displayed.

To find the current value of Z::, enter

          Q "Z::"

3-126. Limitations.

No more than 255 characters may be assigned to Z::=. When an EDIT/3000 cycle begins, Z::= is undefined. You must define it by using the Z::= command, then entering the value to be assigned. The Z:: form of the command (which causes execution of the value assigned to Z::=) may not be used until you have defined Z::=.

You can change the current definition of Z::= by entering another Z::= command and assigning another definition. The old definition is lost. Any definition of Z::= is lost when EDIT/3000 terminates.

The Z:: command is not effective on the current record. That is, multiple commands on one line will use the previous value of Z::, even if Z::= is one of the commands on that line. For example, suppose Z:: contains the value FIRST, then FIND Z:: in the following command line locates the first column of the first line rather than the string "example":

              /Z::=;FIND Z::

              ENTER 7::=

              "example"

                  1     This is an example using EDITOR.

                         (1   )

3-127. Examples.

The following examples illustrate the use of the Z::= command.

The first example sets Z::= equal to the string "(120-I)". The command CHANGE Z: "I" IN ALL then searches the file JUST (a FORTRAN/3000 source program copied into the WORK file with the TEXT command) for all occurrences of the string "(120-1)". Each time the string is found, it is changed to "I".

The next example sets Z::= equal to

     FINDQ FIRST;FIND "58:";CHANGE "58:" TO "28:"

Each time Z:: is entered, EDIT/3000 executes these three commands.

   /TEXT JUST

   /Z::=

   ENTER Z::=

   "(120-1)"

   /CHANGE Z:: TO "I" IN ALL

     112     216       L=1-61

     128     236       L=I-59

     143     256       L=1-62

     150     266       L=I-61

     159     276       L=1-57

     177     296       L=1-59

     185     306       L=1-60

   /Z::=

   ENTER Z::=

   FINDQ FIRST;FIND "58:";CHANGE "58:"  TO "28:"

   /Z::

      50      120   IF(BUFF1[58:3].EQ."     ".AND.BUFF1[57:1].NE." ")GOTO 130

                             ^  (16 )

      50      120   IF(BUFF1[28:3].EO."     ".AND.BUFF1[57:1].NE." ")GOTO 130

   /Z::

      51            IF(BUFF1[59:3].EO."     ".AND.BUFF)[58:1].NE." ")GOTO 150

                                                        ^  (41 )

      51            IF(BUFF1[59:3].EO."     ".AND.BUFF][28:1].NE." ")GOTO 150

The Z::= command can be used to alter commands in a WHILE loop during the execution of the loop. For instance, you can specify a different line number or string to be edited each time through the loop. In the following example, Z:: allows the user to select which lines are to be replaced for each iteration of the loop. The loop is terminated by entering CONTROL Y; in this example, CONTROL Y was entered just before the point where error #53 was displayed. (Make sure that Z:: has been cleared before entering the WHILE loop.)

   /SET SHORT

   /Z:::=

   ENTER Z::=

   //

   /WHILE FLAG

   /      BEGIN

   /         Z::=

   /         R Z::/Z::+1,HOLD,NOW

   /         END

   ENTER Z::=

   3

       3    LINE 3

       3    HOLD LINE 1

       4    LINE 4

       4    HOLD LINE 2

   ENTER      Z::=

   9

       9    LINE 9

       9    HOLD LINE 1

      10    LINE 10

      10    HOLD LINE 2

   ENTER Z::=

   *53*TIME-OUT ON WHILE ITERATION

   /L ALL

       1    LINE 1

       2    LINE 2

       3    HOLD LINE 1

       4    HOLD LINE 2

       5    LINE 5

       6    LINE 6

       7    LINE 7

       8    LINE 8

       9    HOLD LINE 1

      10    HOLD LINE 2

      11    LINE 11

      12    LINE 12

      13    LINE 13

      14    LINE 14

      15    LINE 15

      16    LINE 16
Feedback to webmaster