KDL language
(Reference
for Alpha 1.1)
All rights
reserved, Kallel A.Y KDL language © 2009-2012
For
Help, click here
Types :
Functions, Variables and Sub Programs
· Constants : PI = 3.1415926536 … , Infinity, epsilon
·
Constants Characters : Alpha,alpha,
Beta, beta , …. (Greek alphabets) : Allows to use Greek Alphabets
·
Variables: defined by users
·
Functions: Currently comes bundled with KDL (and for now,
can’t be changed): They return a result
·
Subprograms: Currently comes bundled with KDL: they don’t
return any result
Variables Types:
Keyword (KDL) |
Keyword (Algo) |
Input |
Goal |
Bool |
Boolean |
True False |
Get a Boolean (true or false) |
Int |
Integer |
1, 2, …, 1000,…, 32767 -1,-2,…,-1000,…, -32768 |
Integer |
Doubleint |
Long |
1,2,…, 2147483647 -1,-2,…, - 2147483648 |
Integer (but goes more than 32768) |
Float |
Float |
1.2, 1.3, … 16.8 … |
Real numbers |
Doublefloat |
real |
16.8 … |
Real numbers with more precision |
Char |
Char |
a,b,c,d,…,z |
Contains characters |
String |
String |
“KDL” |
Contains string of characters |
Byte |
Byte |
1,2,…,255 |
Integer from 1 to 255 |
Obj Expr |
Object Expression |
All of above |
Contains anything and everything including expression/1-line function |
Assign, 1-line Functions and Processing
Return
simple results
Instruction |
Usage |
Example |
Goal |
<- |
Var <- contain |
t<- sin(y) |
Assign |
-> |
Contain->var |
Pi->y |
Assign |
? |
Var? |
Sin(pi)? |
Return an immediate result after processing variables and constants |
?? |
var?? |
y?? |
Return variable type |
!? |
var!? |
t!? |
Return variable expression without processing results or constants |
Declare variables
There are two ways to define a variable ; I use KDL’s
Instruction |
Usage |
Example |
Goal |
Define |
Define <var> as <type> |
Define x as real |
KDL way to define a variable |
Var |
Var <var>:<type> |
Var x:real |
Algorithm way to define a variable |
Sub Programs/procedures (GENERAL)
will not output anything, just do what they were supposed to do
procedures syntax:
PROCEDURE VARIABLE
Instruction |
Usage |
Example |
Goal |
Algorithme |
Algorithme <title> |
Algorithme KDL |
Enter Algorithmique Syntax (*) |
clear |
Cls |
Clear |
Clear screen |
Write |
Write <message> |
Write Message Dowrite KDL
message |
Write into screen |
Speak |
Speak <message> |
Speak Hello |
Make computer speak message (vocally) |
Read |
read(var) |
Read(x) |
Input a variable |
Wait |
Wait <time> |
Wait 2 |
Wait before going to next command (in seconds) |
Beep |
Beep |
Beep |
Beep from computer (or Speakers for Windows 7) |
Script |
Script <scriptfile> |
Script myscript.txt |
Load a script file (or KDL batch file) |
About |
About |
About |
About |
Exit |
Exit |
Exit |
Exit |
Sub Programs/procedures (Directory and files)
Modify files and directory
Instruction |
Usage |
Example |
Goal |
Dir |
Dir |
Dir |
Get current directory files (*) |
Cd |
Cd (path) |
Cd C:\users\name\ |
Change directory |
Rd |
Rd (path) |
Rd c:\users\name\temp |
Remove directory’s files then directory itself |
Rdall |
Rdall (path) |
Rdall temp |
Remove All of directories and subdiretories |
Rm |
Rm (path1)=>
(path2) |
Rm temp=>temp2 |
Rename directory |
|
|
|
|
Copy |
Copy (file1)=>(file2) |
Copy file.mp3=>file2.mp3 |
Copy file |
move |
move (file1)=>(file2) |
move file.mp3=>file2.mp3 |
Move/rename a file |
Kill |
Kill (file) |
Kill file.txt |
Delete (permantely) a file |
Delete |
Delete (file) |
Delete file.txt |
Send file to recycle bin |
Sub Programs/procedures (SET)
will not output anything, just do what they were supposed to do
procedures syntax: SET
SOMETHING VARIABLE
Instruction |
Usage |
Example |
Goal |
Alwaysontop |
Alwaysontop |
Set alwaysontop |
Make window always on top |
Normal |
Normal |
Set normal |
Opposite of ‘always on top’ |
Title |
Title <title> |
Set title KDL |
Set title |
Position |
Position <left> |
Set Position 800 |
Modify position |
Size |
Size <width> |
Set Size 800 |
Modify size |
Font |
Font color <R>
<G> <B> |
Set Font color 128 192 255 |
Color of the font |
Font |
Font Name <Name> |
Set Font name Arial |
Modify font |
Font |
Font size <size> |
Set Font size 14 |
Modify font size |
Backcolor |
Backcolor <R> <G>
<B> |
Set backcolor 128 192 255 |
Modify background color |
Color |
Forecolor <R> <G>
<B> |
Set color gray Set forecolor lightblue |
Modify font color |
Sub Programs/procedures (Shell)
Shell stuffs
Instruction |
Usage |
Example |
Goal |
Explore |
Explore |
Explore |
Open explorer |
Run |
Run <executable> |
Run file.exe |
Run a file |
Sub Programs/procedures (Extra)
will not output anything, just do what they were supposed to do
procedures syntax:
PROCEDURE VARIABLE
Instruction |
Usage |
Example |
Goal |
Play |
Play <audiopath> |
Play KDL.mp3 |
Play audio (.mp3, .wma, .wav) |
Pause |
Pause |
Pause |
Pause current audio |
Stop |
Stop |
Stop |
Stop current audio |
Dict |
Dict <word> |
Dict awkward |
Refer to Internet based dictionary to get definition |
Wiki |
Wiki <word> |
Wiki PI |
Search wiki for a word |
Eject |
Eject |
Eject |
Eject CD/DVD tray |
Closetray |
Closetray |
Closetray |
Close CD/DVD tray |