$table search

From UBot Playground
Jump to: navigation, search

$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.


Example[edit]

clear table(&mytable)
navigate("http://w3schools.com/html/html_colornames.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://w3schools.com/html/html_colornames.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