CESH OnLine Help



Table Of Contents


What is CESH ?
Who use CESH ?
System Requirements
License
Installation
Setup
Scripting Languages

CESH specific functions:

WARRANTY

THIS SOFTWARE PRODUCT IS PROVIDED "AS IS" WITH ABSOLUTELY NO WARRANTY !!!
I'M NOT RESPONSIBLE FOR ANY LOSS OF DATA, MONEY, TIME, GOODS, LIVES, HEALTH, OR OTHER THINGS !!!

... ANYWAY ...

IF YOU HAVE PROBLEMS WITH THIS SOFTWARE PRODUCT, PLEASE LET ME KNOW, I'LL DO MY VERY BEST TO FIX THEM.


 


What is CESH ?


CESH (Windows CE Scripting Host) is a general purpose ScriptingHost for Windows CE.NET 4.2 (Windows Mobile 2003).
Scripts for CESH may be written in JScript (JavaScript) or optional VBScript (VisualBasic Script) if installed.
CESH use the standard ScriptingEngine installed on Windows Mobile 2003 devices.


CESH extends the basic functions of the scripting languages with the following features:

A detailed description of the basic functions of each scripting language (VBScript & JScript) can be found in Microsoft's excellent ScriptingHost documentation:
http://msdn.microsoft.com/scripting/

 


Installation


The installation task of CESH is very simple. Download the CeSh.zip file to your DesktopPC or directly to your PocketPC device.
Unpack it into a folder of your choice.
The distribution package contains the following files:


Step by step installation

You may change the location of the executable files and example scripts.
You may NOT change the location of the "CeSh.htm" file and the ShortCut to it in the \Windows\Help\
folder.


That's all about installing CESH.

 


Who use CESH ?


People who want to develop their own small programs (scripts) on the PocketPC device itself, while on the road.

 


System Requirements


CESH should run on any Windows Mobile 2003 device.
However ... it's currently tested on a Compaq iPAQ 5550 only.

 


License


CESH is shareware !

You may use it for an unlimited time without paying anything for it.

The disadvantage of an unregistered version is the info dialog (nag screen ;-) which is displayed each time CESH is fired up.
It informs you that this copy of CESH is currently unregistered.


To hide this info dialog during startup please purchase a license from your distributor.

 


Setup


After doing all the installation tasks it's a good idea to fire up CESH for the first time.

Bring up the SetupDialog by pressing:
Menu>Tools>Setup...

After doing these setup tasks, exit CESH and start it again.

 


Scripting Languages


As described in Topic: What is CESH ?
scripts may be programmed in
JScript (JavaScript) or

VBScript (VisualBasicScript).

CESH supports both languages and all the objects, functions and constants which are part of the Windows Mobile 2003 ScriptingEngines.

As an addition to the standard scripting language features, CESH has an alphanumeric I/O dialog, a graphics dialog, and may create and handle GUI objects which (of course) are event driven.

For a detailed description of the standard objects, their properties and methods, functions and constants of each scripting language, please consult Microsoft's original ScriptingHost documentation.

Please note, that there may be some differences between the ScriptingEngines on your DesktopPC and the ones on your Windows Mobile 2003 device.

 


General CESH functions


<evt> = DoEvents()
Advise Windows CE to process events pending in the event queue.
<evt> is "$STOP" if the stop button was pressed.


ExitHost
Exit CESH immediately without returning to the editor or file selection screen.

<str> = GetCmdLine()
Get the whole command line of CESH with all it's arguments.

<ret> = MsgBox(<text>,
<title>,<flags>)

Display a standard Windows Message Box.

Sleep <milliseconds>
Sleep for a given number of milliseconds.

<ret> = Spawn("[NO]WAIT",
<exe>,<args>)

Spawn a new process with the given executable file and arguments.
<ret> is the return value of the spawned process.

 


Alphanumeric I/O Dialog


InitDialog
Initialize dialog and clear all areas.

NameDialog "<title>"
Change the window title of the dialog.

ShowDialog
Show dialog, make it visible.

HideDialog
Hide dialog, make it invisible.

<ans> = Input(<prompt>,
<default>)

Read input from the input line.
<ans> is the entered value if the (->) button was pressed or "$CLOSE" if the (X) button was pressed.


Print "<string>"
Print text output to the dialogs text output area.

Status "<string>"
Print text output to the dialogs status (prompt) area.

 


Graphics Dialog


Variables:

<r>,<g>,<b> = red,green,blue
where each value is an integer from
0 - 255.
Black = 0,0,0 ; White = 255,255,255

<x>,<y> = screen coordinates
where 0,0 = top left



InitGraphics <r>,<g>,<b>
Initialize graphics dialog with given background color.

NameGraphics "<caption>"
Change the window title of the graphics dialog.

ShowGraphics
Show the graphics dialog.

HideGraphics
Hide the graphics dialog.

<wid> = GetWidth()
Get the width of the graphics area.

<hei> = GetHeight()
Get the height of the graphics area.

SetFont "<type>",<size>
Set default output font type and size of the graphics dialog.

DrawPixel x,y,r,g,b
Draw a pixel at x,y with given color in r,g,b.

DrawLine x1,y1,x2,y2,r,g,b
Draw a line from x1,y1 to x2,y2 with given color in r,g,b.

DrawRect x1,y1,x2,y2,r,g,b
Draw a rectangle from upper left x1,y1 to lower right x2,y2 with given color in r,g,b.

DrawEllipse x1,y1,x2,y2,
r,g,b

Draw an ellipse (or circle) from upper left x1,y1 to lower right x2,y2 with given color in r,g,b.

DrawText x,y,"<str>",r,g,b
Draw the text <str> using the default font (see SetFont) at x,y with given color in r,g,b.

 


GUI Controls & Events


Variables:

id = GUI object identifaction number

x,y = Screen coordinates (top/left)

w,h = Width and Height of GUI object

text = Initial text of the GUI object



CtlEdit
CtlEditMulti
CtlPushButton
CtlCheckButton
CtlRadioButton
CtlComboBox
CtlListBox

all the above functions take the following arguments:
x,y,w,h,text
Have a look at the GUI example to see what you can do with GUI controls.

CtlDelete <id>
Delete given control.

CtlSetText <id>,"<text>"
Set text of the given control.

CtlSetSelected <id>,<sel>
Set the selected item in the given control.

<text> = CtlGetText(<id>)
Get the text of the given control.

<sel> = CtlGetSelected(<id>)
Get the selected item in the given control.

<event> = CtlGetEvents()
Used in the event loop to get events from the controls.
<event> has the form <id>.<event>