Both string constants and numeric expressions are primitives in SPLASH.
Take the SPLASH version of the classic "hello world" program as an example:
print('hello world\n');
This statement prints the line hello world on the console of the Sybase ESP Studio or on the terminal where the Sybase ESP Server was started. This sample code contains a string constant, surrounded by single quotes. This differs from C/C++ and Java, which use double quotes for string constants.
1 + 7 * 8However, this expression will compute 64:
(1 + 7) * 8SPLASH includes a host of arithmetic functions too. This function returns the sine of the value:
sine(1.7855)
Like C/C++ and Java, boolean expressions—that return true or false—are represented by numeric expressions. The integer 0 represents false, and any non-0 integer represents true. Comparison operators like = (equal), != (not equal), < (less than), and > (greater than) return 0 if false, and 1 if true. You can use the operators and, or, and not to combine boolean expressions. For instance, not(0 >1) returns 1.