User Tools

Site Tools


en:documentation:script_reference

This is an old revision of the document!


Script reference

This page contain reference material for scripting functions.

See the Tool Box description page for general information.

See the script example page for a quick start with the programming functions.

Script language

The language to use is Pascal Script.
For a complete reference of the Object Pascal language your can read the Free Pascal Reference guide. But beware that many feature are not implemented by the script language.

In addition to the standard Pascal Script feature the following Skychart specific function are added.

Global variables access

function GetS(varname:string; var str: string):Boolean;
Get the global string variable identified by varname
varnamevalue
ChartNameThe name of the last chart that send an event
RefreshTextThe text of the ChartRefresh event
SelectionTextThe short text of the selected object
DescriptionTextThe object full description
DistanceTextThe text of the last distance measurement event
Str1 .. Str10Ten global variable for your use
function SetS(varname:string; str: string):Boolean;
Set the global string variable identified by varname for later use
varnamevalue
Str1 .. Str10Ten global variable for your use
function GetI(varname:string; var i: Integer):Boolean;
Get the global integer variable identified by varname
varnamevalue
Int1 .. Int10Ten global variable for your use
function SetI(varname:string; i: Integer):Boolean;
Set the global integer variable identified by varname for later use
varnamevalue
Int1 .. Int10Ten global variable for your use
function GetD(varname:string; var x: double):boolean;
Get the global double variable identified by varname
varnamevalue
TelescopeRAThe telescope position right ascension
TelescopeDEThe telescope position declination
TimeNowThe current time in TDateTime format
Double1 .. Double10Ten global variable for your use
function SetD(varname:string; x: Double):Boolean;
Set the global double variable identified by varname for later use
varnamevalue
Double1 .. Double10Ten global variable for your use
function GetV(varname:string; var v: Variant):Boolean;
Get the global variant variable identified by varname
varnamevalue
Telescope1 , Telescope2Two ASCOM Telescope objects
Dome1 , Dome2Two ASCOM Dome objects
Camera1 , Camera2Two ASCOM Camera objects
Focuser1 , Focuser2Two ASCOM Focuser objects
Filter1 , Filter2Two ASCOM Filter wheel objects
Rotator1 , Rotator2Two ASCOM Rotator objects
Variant1 .. Variant10Ten global variable for your use
function SetV(varname:string; v: Variant):Boolean;
Set the global variant variable identified by varname for later use
varnamevalue
Telescope1 , Telescope2Two ASCOM Telescope objects
Dome1 , Dome2Two ASCOM Dome objects
Camera1 , Camera2Two ASCOM Camera objects
Focuser1 , Focuser2Two ASCOM Focuser objects
Filter1 , Filter2Two ASCOM Filter wheel objects
Rotator1 , Rotator2Two ASCOM Rotator objects
Variant1 .. Variant10Ten global variable for your use

Formating and conversion

Function ARtoStr(var ar: Double) : string;
Return a string formated Right Ascension of ar value
Function DEtoStr(var de: Double) : string;
Return a string formated Declination of de value
Function StrtoAR(str:string; var ar: Double) : boolean;
Convert a formated string to Right Ascension decimal value
Function StrtoDE(str:string; var de: Double) : boolean;
Convert a formated string to Declination decimal value
Function JDtoStr(var jd: Double) : string;
Format a julian date to YYYY-MM-DD string
Function StrtoJD(dt:string; var jdt: Double) : boolean;
Convert a formated string YYYY-MM-DD to julian date value
Function FormatFloat(Const Format : String; var Value : double) : String;
Format a decimal number according to the Format specification
Function Format(Const Fmt : String; const Args : Array of const) : String;
The Format Pascal function
function IsNumber(str: String): boolean;
Return True if the string represent a valid number

Dialog

function OpenDialog(var fn: string): boolean;
The standard Open File dialog. Return True if the OK button is pressed after the file selection.
function SaveDialog(var fn: string): boolean;
The standard Save File dialog. Return True if the OK button is pressed after the file selection.
function MsgBox(const aMsg: string):boolean;
A message confirmation dialog. Return True if YES is clicked.
function CalendarDialog(var dt: double): boolean;
The Skychart Calendar dialog. Return dt julian date

Chart and Celestial objects

function Cmd(cname:string; arg:Tstringlist):string;
Execute one of the Skychart server command. Add the command name first to the string list, then each parameter.
procedure SendInfo(origin,str:string);
Send a message to the clients connected to the Skychart server.
en/documentation/script_reference.1402838854.txt.gz · Last modified: 2015/11/06 20:35 (external edit)