Script


Ge script is a way to program ge commands. In the script function there are also possibilities
to perform calculations, if statements, loop statements, declarations of variables and
functions.

A script is started with '@' followed by the name of the script file and possible arguments.

A ge-script should have the filetype .ge_com.

Example

ge> @my_script

In Wtt script there is a description of the script language and a description of built in
functions. Here follows a list of build in functions that also can be used in Ge script.

Ge functions

Function                                Description
BuildGraph                              Build the current graph.
ClearAll                                Remove all objects.
CreateArc                               Create an Arc object.
CreateAxis                              Create an Axis object.
CreateAxisArc                           Create an AxisArc object.
CreateBar                               Create a Bar object.
CreateBarArc                            Create a BarArc object.
CreateDsTrend                           Create a DsTrend object.
CreateDsTrendCurve                       Create a DsTrendCurve object.
CreateFastCurve                         Create a FastCurve object.
CreateImage                             Create an Image object.
CreateLayer                             Create a Layer.
CreateLine                              Create a Line object.
CreateObject                            Create a subgraph object.
CreatePie                               Create a Pie object.
CreatePolyLine                          Create a PolyLine object.
CreateRectangle                         Create a Rectangle object.
CreateRecRounded                        Create a rounded rectangle object.
CreateSevHist                           Create a SevHist object.
CreateText                              Create a Text object.
CreateToolbar                           Create a MethodsToolbar object.
CreateTrend                             Create a Trend object.
CreateWindow                            Create a Window object.
CreateXYCurve                           Create an XYCurve object.
DashInsertObject                        Insert an object into a DashCell.
DeleteObject                            Delete an object.
GetCurrentObject                        Returns the identity of the last created object.
GetFirstObject                          Get the first object.
GetGraphAttribute                       Get an attribute value of a graph.
GetGraphConfig                          Get value of GraphConfiguration attribute.
GetGraphName                            Get name of current graph.
GetInstanceObject                       Get the instance object of the graph.
GetNextObject                           Get the next object.
GetModified                             Check if graph is modified.
GetObjectAttribute                       Get an attribute value of an object.
GetObjectBorder                         Get object border.
GetObjectBorderColor                       Get the border color of an object.
GetObjectClass                          Get object class.
GetObjectDynType                        Get dynamic and action type of an object.
GetObjectFill                           Get object fill.
GetObjectFillColor                       Get fill color of an object.
GetObjectGradient                       Get gradient of an object.
GetObjectName                           Get object name.
GetObjectShadow                         Get shadow of an object.
GetObjectText                           Get object text.
GetObjectTextColor                       Get text color of an object.
GetObjectTransparency                       Get object transparency.
GetObjectType                           Get object type.
GetRgbColor                             Get rgb values of a color.
GetTextExtent                           Calculate the extent of a text.
GetUI_Env                               Get UI environment.
GetWindowSize                           Get size in pixels of the current window.
GetWindowDimension                       Get size in Ge units of the current window.
GroupGetFirstObject                       Get first object in a group.
GroupGetNextObject                       Get next object in a group.
GroupSelected                           Group the selected objects.
LayerGetFirstObject                       Get first object in a layer.
LayerGetNextObject                       Get next object in a layer.
LayerResetActiveAll                       Set all layers inactive.
LayerSetActive                          Set a layer active or inactive.
Layout                                  Calculate a layout.
MeasureObject                           Get object extent.
MergeVisibleLayers                       Merge visible layers.
MergeAllLayers                          Merge all layers.
MoveAbsObject                           Move an object to a position.
MoveObject                              Move an object a distance.
MoveSelectToLayer                       Move selected objects to active layer.
PopSeleted                              Pop the selected objects.
PushSeleted                             Push the selected objects.
OpenGraph                               Open a graph.
PolyLineAdd                             Add a segment to a PolyLine.
Reload                                  Read current graph from file.
RotateSelected                          Rotate selected objects.
SaveGraph                               Save the current graph.
ScaleObject                             Scale an object.
SelectAdd                               Add an object to select list.
SelectClear                             Clear select list.
SetBackgroundColor                       Set graph background color.
SetColorTheme                           Set color theme.
SetCurrentObject                        Set CurrentObject.
SetDraw                               Set drawing on or off.
SetExtern                               Set subgraph extern.
SetExternAll                            Set all subgraphs extern.
SetIntern                               Set subgraph intern.
SetInternAll                            Set all subgraph intern.
SetGraphAttribute                       Set an attribute value of a graph.
SetGraphName                            Set name of current graph.
SetGraphOptions                         Set options for the current graph.
SetObjectAttribute                       Set an attribute value of an object.
SetObjectBackgroundColor                       Set background color of an object.
SetObjectBorder                         Set object border.
SetObjectBorderColor                       Set border color of an object.
SetObjectClass                          Replace the subgraph of an object.
SetObjectFill                           Set object fill.
SetObjectFillColor                       Set fill color of an object.
SetObjectGradient                       Set gradient of an object.
SetObjectShadow                         Set object shadow.
SetObjectTextColor                       Set text color of an object.
SetObjectTransparency                       Set object transparency.
SetRgbColor                             Set rgb values of a color.
SetSelectTextBold                       Set text bold on selected objects.
SetSelectTextFont                       Set text font on selected objects.
SetSelectTextSize                       Set text size on selected objects.
TranslateObjectName                       Translate Ge syntax name to database name.

Input and output

Function            Description
ask                 Print a question and read an answere.
say                 Print a text.
printf              Formatted print.
scanf              Formatted read.

File handling

Function            Description
fclose              Close a file
felement            Extract one element from the last read line.
fgets               Read a line from a file.
file_search         Search for file or files.
fopen               Open a file.
fprintf             Formatted write to file.
fscanf              Formatted read from file.
translate_filename   Replace environment variables in a file name.

Handling of strings

Function            Description
edit                Removes leading and trailing spaces and tabs, and replaces multiple
               tabs and spaces with a single space.
element             Extract one element from a string of elements.
extract             Extracts the specified characters from a string.
sprintf             Formatted print to a string variable.
strchr              Find the first occurrence of a character in a string.
strlen              The length of a string.
strrchr             Find the last occurrence of a character in a string.
strstr              Find the first occurrence of a character sequence in a string.
tolower             Convert a string to lower case.
toupper             Convert a string to upper case.

Database functions

Function            Description
CutObjectName       Extract the last segment of an object name.
GetAttribute        Fetch the value of an attribute.
GetChild            Get the first child of an object.
GetNextSibling      Get next sibling of an object.
GetNextVolume       Get next volume.
GetParent           Get the parent of an object.
GetObjectClass      Get the class of an object.
GetRootList         Get first object in the root list.
GetVolumeClass      Get the class of a volume.

System functions

Function            Description
exit                Terminate the execution of a script.
system              Execute a shell command.
terminate           Terminate the process.
time                Fetch the system time.
verify              Set verify on or off.

Predefined variables

There are a number of predefined varlables for

Object types
Dynamic and action types
Fonts
Directions
Colors
Access