User Tools

Site Tools


cmd:create

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cmd:create [2020/06/06 16:33] devacmd:create [2020/06/08 18:27] (current) deva
Line 1: Line 1:
 ======Create New Node====== ======Create New Node======
-This command creates a new node in a specified parent. the node id can either be set explicitly or a placeholder variable can be used, which can then in the same command string be used, instead of node id, in other commands.+This command creates a new node in a specified parent. the node id can either be set explicitly or a placeholder variable can be used, which can then in the same command string be used, instead of node id, in commands after the create command.
  
 <code> <code>
-create <parent node id> <node id|placeholder>+create <node id|placeholder> <parent node id> <before id>
 </code> </code>
  
 If the ''parent node id'' does not exist an [[cmd:s_error|error]] is returned. If the ''parent node id'' does not exist an [[cmd:s_error|error]] is returned.
  
-Placeholder example:+The node will be inserted in the child list of the parent, before the ''before id''. It can be -1, meaning "insert last"
 + 
 +Placeholder example - create new node as child of node 2 and set its title to "Helo", and then "Hello": 
 +<code> 
 +create x 2 -1; update x title "Helo"; update x title "Hello" 
 +</code> 
 + 
 +Multiple placeholders example - create two new nodes as children of node 2 and set their titles to "Hello1", and then "Hello2":
 <code> <code>
-create 42 x; update x title 'Hello World'+create x 2 -1; create y 2 -1; update x title "Hello1"; update y title "Hello2"
 </code> </code>
cmd/create.1591453998.txt.gz · Last modified: 2020/06/06 16:33 by deva