SlideScript

Now that most of the basic built-in functions are aware, time to start playing with some of the more interesting parts of SlideScript. SlideScript does indeed seem more shell-like than anything but has its own unique abilities unlike other scripting languages.

Loop, comp, and if(n) statements

You can indeed compare values / process based on what's found around. For example, file functions like isdir and isfile return a true or false based on what they find. These returns can be used by some of the statement handling built into SlideScript's lexer.
if(n):


#!/usr/bin/slidescript
# Using isfile/isdir and if/ifn for determining when something needs to be done
doesitexist=`isfile "test.txt"` # returns 0 / false
ifn: %doesitexist%; write "test.txt" "created..." # If false, write
if: %doesitexist%; cat "test.txt" "adding to file..." # if true, catenate
comp(are):

#!/usr/bin/slidescript
# Using compare and if/ifn for determining if a string is similar or different
string1=Testing strings
string2=String testings
match=`comp: "%string1%" "%string2%"` 
ifn: %match%; print "Different" # If false, different
if: %match%; print "Same" # if true, same
loop:

#!/usr/bin/slidescript
# Using compare and if/ifn for determining when something needs to be done
count=5
loop: %count%; print "Printing %count% times..."

Other system functions

SlideScript is a list of other functions that can be used at a given time or place: time, and sleep.


#!/usr/bin/slidescript
# Time example:
time

# Sleep example:
sleep "3"
print "Will print after 3 seconds..."

IRC server

Still need help? Want to report a bug? Join us!

IP/Port: cddo.cc/1337
Main hang channel: #theroot
FreeBox channel: #freebox
FreonLinux channel: #freonlinux