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)
y<-pi

Assign

->

Contain->var

Pi->y
sin(t)->z

Assign

?

Var?
expr?

Sin(pi)?
y?

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
variable y:float

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

Cls
clear

Clear
cls

Clear screen

Write
dowrite

Write <message>
dowrite <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)
Note: It can be float or integer

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
Dir:change

Cd (path)

Cd C:\users\name\

Change directory

Rd

Rd (path)

Rd c:\users\name\temp
rd 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>
position <left> <top>

Set Position 800
Set Position 100 200

Modify position

Size

Size <width>
size <width> <height>

Set Size 800
Set size 800 600

Modify size

Font

Font color <R> <G> <B>
Font color <color>

Set Font color 128 192 255
Set Font color green

Color of the font

Font

Font Name <Name>

Set Font name Arial
Set Font name Showcard Gothic

Modify font

Font

Font size <size>

Set Font size 14

Modify font size

Backcolor

Backcolor <R> <G> <B>
backcolor <color>

Set backcolor 128 192 255
Set backcolor gray

Modify background color

Color
forecolor

Forecolor <R> <G> <B>
color <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 file.bat

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