$table search

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
$table search is a [[Variable Functions|Variable Function]].
+
$table search is a [[Data Functions|Data Function]].
  
 
This function will return the row index or the column index where a specific string is located in a table.
 
This function will return the row index or the column index where a specific string is located in a table.
  
 +
'''Table:''' The table being searched.
 +
 +
'''Search For:''' The search string.
 +
 +
'''Return:''' Returns either the row number the item is located in or the column number the item is located in.
  
 
== Example ==
 
== Example ==
 +
  
 
<pre>
 
<pre>
 
clear table(&mytable)
 
clear table(&mytable)
navigate("http://w3schools.com/html/html_colornames.asp", "Wait")
+
navigate("http://www.w3schools.com/colors/colors_names.asp", "Wait")
 
wait(3)
 
wait(3)
 
scrape table(<innerhtml="Color Name">, &mytable)
 
scrape table(<innerhtml="Color Name">, &mytable)
Line 17: Line 23:
 
In this example, searching for the Row index of the string "BlueViolet" returns the Row number 10.
 
In this example, searching for the Row index of the string "BlueViolet" returns the Row number 10.
  
[[File:tablesearch.jpg]]
+
 
 +
 
 +
[[File:ts0.png]]
 +
 
 +
 
  
  
 
<pre>
 
<pre>
 
clear table(&mytable)
 
clear table(&mytable)
navigate("http://w3schools.com/html/html_colornames.asp", "Wait")
+
navigate("http://www.w3schools.com/colors/colors_names.asp", "Wait")
 
wait(3)
 
wait(3)
 
scrape table(<innerhtml="Color Name">, &mytable)
 
scrape table(<innerhtml="Color Name">, &mytable)
 
set(#search, $plugin function("TableCommands.dll", "$table search", &mytable, "BlueViolet", "Column Index"), "Global")
 
set(#search, $plugin function("TableCommands.dll", "$table search", &mytable, "BlueViolet", "Column Index"), "Global")
 
</pre>
 
</pre>
 +
 +
  
 
In this example, searching for the Column index of the string "BlueViolet" returns the Column number 0.
 
In this example, searching for the Column index of the string "BlueViolet" returns the Column number 0.
  
[[File:tablesearch0.jpg]]
+
 
 +
 
 +
[[File:ts1.png]]

Latest revision as of 16:42, 20 December 2016

$table search is a Data Function.

This function will return the row index or the column index where a specific string is located in a table.

Table: The table being searched.

Search For: The search string.

Return: Returns either the row number the item is located in or the column number the item is located in.

[edit] Example

clear table(&mytable)
navigate("http://www.w3schools.com/colors/colors_names.asp", "Wait")
wait(3)
scrape table(<innerhtml="Color Name">, &mytable)
set(#search, $plugin function("TableCommands.dll", "$table search", &mytable, "BlueViolet", "Row Index"), "Global")

In this example, searching for the Row index of the string "BlueViolet" returns the Row number 10.


Ts0.png



clear table(&mytable)
navigate("http://www.w3schools.com/colors/colors_names.asp", "Wait")
wait(3)
scrape table(<innerhtml="Color Name">, &mytable)
set(#search, $plugin function("TableCommands.dll", "$table search", &mytable, "BlueViolet", "Column Index"), "Global")


In this example, searching for the Column index of the string "BlueViolet" returns the Column number 0.


Ts1.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox