const

std.const is a library for constants used by many scripts.

 

tolerance

It is of type number and has a value of 10-5. It is mostly used when testing if two numbers are equal, such as |num1-num2|<tolerance.

>>std.const.tolerance
1e-05

 

 

exedir

Returns the full path of the folder containing sciencesuit.exe file as string. This is rather useful to work with relative paths within the sciencesuit folder instead of working with full paths referrals.

For example, say you have placed an image, namely myimage.png, in the home folder which is directly under the sciencesuit folder. Now you can refer to the image by std.const.exedir.."/home/myimage.png". Later on if you move sciencesuit folder to another location on the OS, the path will still work correctly.

In cases, where ScienceSuit is installed in a path with non-ASCII characters, the path will be encoded. For example, if you have installed ScienceSuit in a fantasy directory such as C:\熊\αρκούδα\медведь\Bjørn, when you run following command:

>>std.const.exedir
C:\熊\αρκούδα\медведь\Bjørn\

It is seen that, system has encoded the path as it contains non-ASCII characters.

 

 

color

It is defined for convenience and provides most of the commonly used colors as string in the format of "R G B". For example, red color has the value of "255 0 0". These constants are especially useful when using formatted output to Worksheet using the Worksheet class.

>>ws=std.activeworkbook():cur()
>>ws[1][1]={value="A1", fgcolor=std.const.color.red}

 

 

fillstyle

Fill style requested by functions take an integer value to perform the required style. These constants provides convenience when a fill style is needed.

The constants are as follows:
{solid=100, transparent=106, bdiaghatch=111, crossdiaghatch=112, fdiaghatch=113, crosshatch=114, horizhatch=115, verthatch=116}

The following image shows the difference between a solid and a crossdiaghatch fill:

 

 

linestyle

Similar to fill style, line style requested by functions take an integer value to perform the required style. These constants provides convenience when a line style is needed.

The constants are as follows:
{solid=100, dot=101, longdash=102, shortdash=103, dotdash=104, transparent=106}

 

 

font

Provides convenience when using formatted output to Worksheet using the Worksheet class. The available keys and values are:

>>std.const.font
style_normal=normal
style_italic=italic

weight_normal=normal
weight_bold=bold

underline_none=none
underline_single=single

>>type(std.const.font.style_italic)
string

 

>>ws=std.activeworkbook():cur()

>>ws[1][1]={value="A1", italic=std.const.font.style_italic}
>>ws[2][1]={value="A2", weight=std.const.font.weight_bold}