#

# LogiView

## How to Add Functions and Commands Using the Syntax Assistant

| ### What to do:
| As a prerequisite for this example, you must have added a comment line as described in "How to Add Functions and Commands" and a function as described in "How to Add Functions and Commands Using the Syntax Assistant".
| Enter the following values in the corresponding fields:
Line | Comment line ID | Command
30 |  | writeln(DOCU_INT_1,"Line 1")
40 |  | writeln(DOCU_INT_1,5)
50 |  | writeln(DOCU_INT_1,"Line 2")
60 |  | close(DOCU_INT_1)
70 | C | Reading data from file "test.file"
80 |  | DOCU_INT_1=open("\tmp\test.file","r")
90 |  | DOCU_LOGIC_1=eof(DOCU_INT_1)
100 | C | Output of the following variables in Debug mode
110 | D | put(DOCU_LOGIK_1)
120 |  | while (DOCU_LOGIC_1 != TRUE)
130 |  | readln(DOCU_INT_1,DOCU_STRING_1)
140 |  | readln(DOCU_INT_1,DOCU_INT_2)
150 |  | put(DOCU_STRING_1)
160 |  | put(DOCU_INT_2)
170 |  | DOCU_LOGIC_1=eof(DOCU_INT_1)
180 |  | done
190 |  | close(DOCU_INT_1)
200 | C | delete "test.file"
210 |  | delete("\tmp\test.file")
| The list should now look as follows:
| Lines are automatically sorted when the procedure is reopened. However, you may also sort the lines into the correct order using the Block Structure function from the context menu. Using the Renumber function in the same context menu you may change the enumeration after adding new lines, e.g. the renumbering function may transform lines #s 10, 15 and 20 to #s 10, 20, 30. In order to prevent a sequence transformation, the Renumber function should only be called after the Block Structure function (e.g. line #s 10, 5, 20 will be transformed by the renumbering function to 10, 20, 30).