Scripting is the most advanced thing Kc SpreadSheet can do, it's also quite handy and makes it very useful in many applications.
To do scripting you must know how to modify a cells content.
To define a cell as a cell that has a script in it you must make the first character of the cell a "$" (dollar sign). After that you put whatever formula you want, and whatever it equals out to thats what you will see in the cell.
Kc SpreadSheet currently accepts the math operators, - (minus sign), + (addition sign), * (multiplication sign), / (divide sign), and the ( )'s (parantheses).
So an example script so far would be
$1+(2/5*3)-3
which would look like in the edit window
would look like this in the spreadsheet

But how do you throw in expressions from other cells? To throw in numbers from other cells you simply take the cell's x value and y value and put it like so: [x,y]. An example would be we wanted to display in cell 1,1 whats in cell 2,2, heres the script for cell 1,1
$[2,2]
That simple.
For advanced users heres functions you can use:
int( a ) - Returns the integer of a
abs( a ) - Returns the absolute value of a
sin( a ) - Returns the sine value of a
cos( a ) - Returns the cosine value of a
tan( a ) - Returns the tangent value of a
acs( a ) - Returns the arc cosine value of a
asn( a ) - Returns the arc sine value of a
atn( a ) - Returns the arc tangent value of a
log( a ) - Returns the logarithm of a
max( a , b) - Returns the biggest of a and b
min( a , b) - Returns the smallest of a and b
mod( a , b) - Returns the remainder of a/b
rnd( a ) - Returns a random number (0-a)
sqrt( a ) - Returns the sqaure root of a
power( a , b) - Returns a^b
Example of some being used
$min((int(rnd(1)*100)+1),50)
It will return 50 if the random number (0-100) is bigger than 50 and will return the random number if it is lower than 50.
|