GRIDPLUS2 - Deleting a Tablelist Row, Text line or Tree Node | ![]() |
||||||
|
Deleting a Tablelist Row, Text line or Tree Node |
GRIDPLUS provides the gpdelete command to delete a Tablelist row, Text line or Tree node.
Syntax |
The syntax is partially free-form. The following rules apply:-
To delete the currently selected Tablelist row or Tree node:-
To delete a specified row/line/node where no Tablelist column is specified:-
To delete a Tablelist row where a column match is specified:-
Note: For the purposes of documentation/examples the following is used:-
gpselect item ?options? ?column? match|row|line|node
Examples:
To delete row "3" of ".mytable" any of the following are valid:-
gpdelete .mytable -row 3 gpdelete -row .mytable 3 gpdelete .mytable 3 -row
Some examples also using the "-focus" option:-
gpdelete .mytable -focus -row 3 gpdelete -focus -row .mytable 3 gpdelete .mytable 3 -row -focus gpdelete .mytable -row 3 -focus gpdelete .mytable -row -focus 3
When using gpdelete to match by column content where the content to match begins with "-" the "|" option can be used to turn off option processing.
Examples:
To delete the row in ".mytable" where the first column matches "-ABC123" the following are valid:-
gpdelete .mytable | "-ABC123" gpdelete .mytable -focus | "-ABC123" gpdelete -focus .mytable | "-ABC123"
Note: For Tablelist deletion by match it is recommended that the "|" option always be used.
Deleting a Tablelist Row |
A Tablelist row can be deleted in the following ways:-
By default, if a row is selected, the row which takes the place of the deleted row will be selected. If the deleted row is the last row, the last row will be selected. The option database can be used to disable this behaviour using "gpoptions autoSelect 0". When "autoSelect" is disabled the the -select option can be used explicitly.
The -focus option has the same effect as -select but also gives focus to the Tablelist.
Syntax:-
gpdelete item ?-focus? ?-select?
gpdelete item ?-focus? ?-select? | ?column? match
gpdelete item ?-focus? ?-select? -row row
gpdelete item ?-focus? ?-select? -first
gpdelete item ?-focus? ?-select? -last
For Example:
gpdelete .mytable
...Will delete the currently selected row in ".mytable".
gpdelete .mytable | "ABC123"
...Will delete the row in ".mytable" where the content of the first column is "ABC123".
gpdelete .mytable | reference "ABC123"
...Will delete the row in ".mytable" where the content of the column with name "reference" is "ABC123".
gpdelete .mytable -select | reference "ABC123"
...Will delete the row in ".mytable" where the content of the column with name "reference" is "ABC123" and select the row which takes the place of the deleted row.
gpdelete .mytable -row 3
...Will delete the fourth row in ".mytable".
gpdelete .mytable -focus -row 3
...Will delete the fourth row in ".mytable",select the row which takes the place of the deleted row and give focus to the Tablelist.
gpdelete .mytable -last
...Will delete the last row in ".mytable".
Deleting a Text Line |
A Text line can be deleted in the following ways:-
Syntax:-
gpdelete item line
For Example:
gpdelete .mytext 3
...Will delete line "3" in ".mytext".
gpdelete .mytext 1
...Will delete the first line in ".mytext".
gpdelete .mytext first
...Will delete the first line in ".mytext".
gpdelete .mytext last
...Will delete the last line in ".mytext".
gpdelete .mytext end
...Will delete the last line in ".mytext".
Deleting a Tree Node |
A Tree node can be deleted in the following ways:-
By default, if a node is selected, the node which takes the place of the deleted display node will be selected. If the deleted node is the last display node, the last display node will be selected. The option database can be used to disable this behaviour using "gpoptions autoSelect 0". When "autoSelect" is disabled the the -select option can be used explicitly.
The -focus option has the same effect as -select but also gives focus to the Tree.
Syntax:-
gpdelete item ?-focus? ?-select?
gpdelete item ?-focus? ?-select? node
For Example:
gpdelete .mytree
...Will delete the currently selected node in ".mytree".
gpdelete .mytree "/Dir1/Dir2/File1"
...Will delete the node in ".mytree" where the node path is "/Dir1/Dir2/File1".