$table total columns
From UBot Studio
(Difference between revisions)
(2 intermediate revisions by one user not shown) | |||
Line 9: | Line 9: | ||
<pre> | <pre> | ||
navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") | navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") | ||
− | create table from file("C:\\Users | + | create table from file("C:\\Users\\Documents\\my table.txt", &my table) |
set(#columns, 0, "Global") | set(#columns, 0, "Global") | ||
loop($table total columns(&my table)) { | loop($table total columns(&my table)) { | ||
Line 19: | Line 19: | ||
</pre> | </pre> | ||
+ | |||
Running the script will set the loop to loop according to how many column are in the table. The [[Increment|increment]] command then increments the row position each time the command is run. | Running the script will set the loop to loop according to how many column are in the table. The [[Increment|increment]] command then increments the row position each time the command is run. | ||
+ | |||
<pre> | <pre> | ||
Line 25: | Line 27: | ||
list item3,list item 4 | list item3,list item 4 | ||
</pre> | </pre> | ||
+ | |||
The list items are arrange in the following order: | The list items are arrange in the following order: | ||
+ | |||
<pre> | <pre> | ||
Line 32: | Line 36: | ||
row 1 column 0, row 1 column 1 | row 1 column 0, row 1 column 1 | ||
</pre> | </pre> | ||
+ | |||
The script will then fill the field with items in row 0 column 0, row 0 column 1, row 1, column 0 and row 1, column 1. | The script will then fill the field with items in row 0 column 0, row 0 column 1, row 1, column 0 and row 1, column 1. | ||
− | [[File: | + | |
+ | [[File:vphs44.jpg]] |
Latest revision as of 15:50, 28 December 2016
$table total columns is a Data Function. This function will grab the total columns within a table.
This is especially useful within a loop. The loop command is usually set to the function to make sure the loop loops according to how many columns are in the table.
Table: The desire populated table where the table total column will be pulled from.
[edit] Example
navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") create table from file("C:\\Users\\Documents\\my table.txt", &my table) set(#columns, 0, "Global") loop($table total columns(&my table)) { type text(<about me textarea>, $table cell(&my table,0, #columns), "Standard") type text(<about me textarea>, $table cell(&my table, 1, #columns), "Standard") wait(4) increment(#columns) }
Running the script will set the loop to loop according to how many column are in the table. The increment command then increments the row position each time the command is run.
list item 1,list item 2 list item3,list item 4
The list items are arrange in the following order:
row 0 column 0, row 0 column 1 row 1 column 0, row 1 column 1
The script will then fill the field with items in row 0 column 0, row 0 column 1, row 1, column 0 and row 1, column 1.