Wijits
Home|Register|Login|Browse All Wijits

Wijit Programming Language

The Wijit Programming Language (WPL) is very simplified and simple to learn and use. Below are functions and procedures you may use in writing code and examples. WPL blends in with HTML so you are encouraged to use HTML to format how you wish your Wijit to look.
<!--#disp [variable/string/integer/float]-->

Displays a string literal, variable, or other data type representing a string or numeric value.
Example:
<!--#disp "Hello World!"-->

<!--#page ([name of page])-->

Separates code by dividing it for page navigation in the Wijit.
Example:
<!--#page(default)-->
<!--#disp "Hello"-->
<!--#page(ok)-->
<!--#disp "World"-->

<!--#if ([logical condition])-->
...
<!--#endif-->

Executes a set of code if a logical condition is fulfilled.
Example:
<!--#@a = 5-->
<!--#if (@a < 6)-->
<!--#disp "@A is TRUE"-->
<!--#endif-->

<!--#database.count ([query])-->

Returns the number of rows in a SELECT query to your Wijit's database.
Example:
<!--#@cnt = database.count("SELECT * FROM mytable")-->

<!--#database.querydisp ([query])-->

Displays data in a selected pattern from a SELECT query.
Example:
<table border="1">
<!--#database.querydisp("SELECT ID,username,email FROM my_users")-->
<tr>
  <td><!--#disp @id--></td>
  <td><!--#disp @username--></td>
  <td><!--#disp @email--></td>
</tr>
<!--#enddisp-->
</table>

<!--#database.query ([query])-->

Performs any query on your Wijit's database silently.
Example:
<!--#database.query("INSERT INTO my_table (ID, user) VALUES (3, 'tester')")-->

<!--#level ([condition] : [returned value] , ...)-->

Like "SWITCH" or "SELECT" in most programming languages, LEVEL returns a value on the first selected condition that returns true on conditional logic.
Example:
<!--#@a = level(25 > 100 : "25 is greater than 100", 25 < 100 : "25 is less than 100")-->

<!--#navigator.goto ([page variables])-->

Returns a link using page variables to help navigate around the Wijit.
Example:
<a href="<!--#navigator.goto("action=view,id={@ID}")">View</a>-->

<!--#navigator.pageindex ([total count], [items per page])-->

Returns a page index for navigation which can be used to navigate the index of your Wijit.
Example:
<!--#navigator.pageindex(100, 10)-->