Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: System Functions :: Standard System Functions |
Bartels User Language - Programmer's GuideC.2 Standard System Functions |
![]() |
This section describes (in alphabetical order) the standard system functions of the Bartels User Language. See Appendix C.1 for function description notations.
int abs( // Returns result value int; // Input integer value );
The abs function calculates and returns the absolute value of the given integer value.
double acos( // Returns result value (STD3) double [-1.0,1.0]; // Input cosine value );
The acos function calculates and returns the arc cosine value of the given double value. The resulting angle value is in radians.
int angclass( // Returns angle class code double; // Input angle value (STD3) );
The angclass function determines and returns a class code for the given angle value. Possible return values are 0 for 0 degree angle, 1 for 90 degree angle, 2 for 180 degree angle, 3 for 270 degree angle or (-1) for other angle values. The input angle value must be in radians.
int arylength( // Returns array element count void; // Any input value );
The arylength function returns the array element count for the given (array) input value.
double asin( // Returns result value (STD3) double [-1.0,1.0]; // Input sine value );
The asin function calculates and returns the arc sine value of the given double value. The resulting angle value is in radians.
int askcoord( // Returns status & double; // Returns X coordinate value (STD2) & double; // Returns Y coordinate value (STD2) int [0,1]; // Input mode: // 0 = Coordinates relative to last position // 1 = Coordinates absolute );
The askcoord function activates a dialog X and Y coordinate value input. The input mode specifies whether absolute ( ) or relative ( ) coordinates are to be queried. The user input is returned with the first two function parameters. For absolute coordinate queries, these parameters are also input parameters for preset coordinate values. The function returns zero if the query was successful or nonzero if the query was aborted.
int askdbl( // Returns status & double; // Returns double value string; // Prompt string int; // Maximum input string length );
The askdbl function asks the user for a double value, indicating the required interaction with the given prompt string. The user input double value is returned with the first parameter. The function return value is nonzero, if an invalid input value has been specified.
int askdist( // Returns status // -1 = Eingabe ungültig/abgebrochen // 0 = Valid distance input value entered // 1 = Valid distance input value entered, // corner button pressed & double; // Returns distance value string; // Prompt string int [0,15]; // Input control: // 1 = Negative input allowed // 2 = Circular input allowed // 4 = String item prompt message // 8 = Round corner button );
The askdist function asks the user for a distance value, indicating the required interaction with the given prompt string. The third parameter determines the type of valid inputs. The user input value is interpreted in default user units, and is returned with the first parameter. The function returns zero for valid distance value inputs, 1 for valid distance value inputs with corner button pressed, or (-1) for invalid inputs or if the input function was aborted.
int askint( // Returns status & int; // Returns integer value string; // Prompt string int; // Maximum input number length );
The askint function asks the user for an integer value, indicating the required interaction with the given prompt string. The user input integer value is returned with the first parameter. The function returns nonzero if an invalid input value has been specified.
string askstr( // Returns string string; // Prompt string int; // Maximum input string length );
The askstr function asks the user for a string value, indicating the required interaction with the given prompt string. The user input string value is passed with the function return value.
double atan( // Returns result value double; // Input angle value (STD3) );
The atan function calculates and returns the arc tangent value of the given angle value. The input angle value must be in radians.
double atan2( // Returns result value (STD3) double; // Input point Y coordinate double; // Input point X coordinate );
The atan2 function calculates and returns the arc tangent value of the angle defined by the given input point coordinates (and the origin point). The resulting angle value is in radians.
double atof( // Returns floating point value string; // Input string );
The atof function converts and returns the double value represented by the given string value. The result is undefined if the double value cannot be represented.
int atoi( // Returns integer value string; // Input string );
The atoi function converts and returns the integer value represented by the given string value. The result is undefined if the integer value cannot be represented.
int bae_askddbename( // Returns status & string; // Returns element name string; // DDB file name int ]0,[; // DDB element class (STD1) string; // Prompt string // empty string: Standard file dialog //!
prefix: Save file dialog // otherwise: Load file dialog );
The bae_askddbename function allows the user to select a DDB element name by either keyboard input or mouse-selection in a request popup window showing the list of available elements. If the prompt string is an empty string the function uses the standard prompt for DDB element name queries. Any name passed with the first parameter is used as default element name selection. I.e., an empty string must be passed to the first parameter if no default element name is required and/or allowed. The function returns nonzero if no valid element name was selected or zero otherwise.
int bae_askddbfname( // Returns status & string; // Returns file name int [0,1]; // Existence check int [0,3]; // File name dialog mode (bit flags): // 1 = Check if file exists // 2 = specified file name is default string; // Prompt string // empty string: Standard file dialog //!
prefix: Save file dialog // otherwise: Load file dialog );
The
bae_askddbfname function allows the user to select a DDB file name by either keyboard input or mouse-selection in a request popup window showing the list of available DDB files. The standard BAE DDB file name prompt is used if an empty prompt string is specified. A file save dialog is activated instead of a file open dialog if the first character of the file name prompt string is an exclamation mark
(!
), i.e., the exclamation mark is faded out and the confirmation button of the Windows file name dialog changes from
to
. The function returns nonzero if no valid file name was selected and/or existence check is nonzero and the file doesn't exist or zero otherwise.
int bae_askdirname( // Returns status & string; // Returns directory name string; // Directory name for scan start string; // Prompt string );
The bae_askdirname function allows the user to select a directory name by either keyboard input or mouse-selection in a request popup window showing the list of available directories. The directory name for scan start specifies the top level directory for the popup window directory selection display. If the prompt string is an empty string the function uses the standard prompt for directory name queries. The function returns nonzero if no valid directory name was selected or zero otherwise.
int bae_askfilename( // Returns status & string; // Returns file name string; // File name extension string string; // Prompt string // empty string: Standard file dialog //!
prefix: Save file dialog // otherwise: Load file dialog );
The bae_askfilename function allows the user to select a file name by either keyboard input or mouse-selection in a popup window showing the list of available files. The file name extension string can be used to set a file name extension filter. On empty string input, all files are scanned/displayed. On extension specification (e.g.,.ddb
,.dat
,.txt
,.
,.*
, etc.), only those files matching the extension are scanned and/or displayed. The-
tag works for file name exclusion. On-
input all files matching BAE system or data file extensions (.ass
,.con
,.ddb
,.def
,.exe
,.fre
,.ulc
and.usf
, respectively) are faded-out from display (this feature can be used for output/plot file queries where system/library/project files must not be selected). The standard BAE file name prompt is used if an empty prompt string is specified. A file save dialog is activated instead of a file open dialog if the first character of the file name prompt string is an exclamation mark (!
), i.e., the exclamation mark is faded out and the confirmation button of the Windows file name dialog changes from to . The function returns nonzero if no valid file name was selected or zero otherwise.
int bae_askmenu( // Returns selected menu item index (0..49),
// or (-1) on menu selection abort
int [1,50]; // Menu item count
string; // First menu item string
[] // Subsequent menu item strings
);
The bae_askmenu function activates a user-specific menu with up to 48 mouse-selectable menu items. The function returns the number of the selected menu item or (-1) if the menu selection was aborted. Menu item numbering starts at 0.
Function bae_defmenusel.
int bae_askname( // Status & string; // Returns selected name string; // Prompt string (or empty string) int; // Maximum input string length );
The bae_askname function activates a dialog for selecting a name from the name list which is currently defined with the bae_nameadd function. The second parameter specifies a non-standard input prompt. The system uses a predefined standard prompt if an empty string is passed as prompt string. The third parameter sets the maximum user input string length. The selected name is returned through the first parameter. The function returns zero if a name was selected or nonzero if the function was aborted without valid name selection.
Functions bae_nameadd, bae_nameclr, bae_nameget.
int bae_asksymname( // Returns status & string; // Returns library element name & string; // Returns DDB library file name int ]0,[; // Database class (STD1) string; // Library file directory string; // Default library path name string; // Default symbol/element name );
The bae_asksymname function activates a dialog for selecting a library element of the specified database class from a selectable library file. The function returns zero if a library element was successfully selected or non-zero if the user aborted the dialog without valid element selection.
int bae_callmenu( // Returns status int [0,9999]; // Menu function number (STD4) );
The bae_callmenu function calls the specified BAE menu function passing the interactions defined with the bae_store*iact functions. The function returns nonzero on menu function errors or invalid menu function numbers.
void bae_charsize( & double; // Returns character width (pixels) & double; // Returns character height (pixels) );
The bae_charsize function determines the current BAE character dimensions and returns the corresponding pixel values with its parameters.
void bae_cleardistpoly( );
The bae_cleardistpoly function deletes the internal distance query polygon created with the bae_storedistpoly function.
Functions bae_storedistpoly.
void bae_clearpoints( );
The bae_clearpoints function deletes the internally stored polygon point list. This function should be called before the first bae_storepoint call to delete previously stored points.
Functions bae_getpolyrange, bae_storedistpoly, bae_storepoint.
void bae_clriactqueue( );
The bae_clriactqueue function deletes all interactions stored in the interaction queue. The interaction queue is used for passing interactions to the BAE menu functions activated through bae_callmenu.
int bae_crossarcarc( // Crosspoint count double; // Arc 1 start point X coordinate (STD2) double; // Arc 1 start point Y coordinate (STD2) double; // Arc 1 center point X coordinate (STD2) double; // Arc 1 center point Y coordinate (STD2) int [1,2]; // Arc 1 center point type code (STD15) double; // Arc 1 end point X coordinate (STD2) double; // Arc 1 end point Y coordinate (STD2) double; // Arc 2 start point X coordinate (STD2) double; // Arc 2 start point Y coordinate (STD2) double; // Arc 2 center point X coordinate (STD2) double; // Arc 2 center point Y coordinate (STD2) int [1,2]; // Arc 2 center point type code (STD15) double; // Arc 2 end point X coordinate (STD2) double; // Arc 2 end point Y coordinate (STD2) & double; // Crosspoint 1 X coordinate (STD2) & double; // Crosspoint 1 Y coordinate (STD2) & double; // Crosspoint 2 X coordinate (STD2) & double; // Crosspoint 2 Y coordinate (STD2) );
The bae_crossarcarc function determines the crossing points for the specified arcs. The function returns the number of crosspoints (0, 1, or 2). The coordinates of existing crosspoints are also returned through the crosspoint functions parameters.
Functions bae_crosslineline, bae_crosslinepoly, bae_crosssegarc, bae_crosssegseg.
int bae_crosslineline( // Crossing flag double; // Line 1 start point X coordinate (STD2) double; // Line 1 start point Y coordinate (STD2) double; // Line 1 end point X coordinate (STD2) double; // Line 1 end point Y coordinate (STD2) double ]0.0,[; // Line 1 width (STD2) double; // Line 2 start point X coordinate (STD2) double; // Line 2 start point Y coordinate (STD2) double; // Line 2 end point X coordinate (STD2) double; // Line 2 end point Y coordinate (STD2) double ]0.0,[; // Line 2 width (STD2) );
The bae_crosslineline function checks whether the specified wide line segments are crossing each other. The function returns 1 if the segments are crossing each other or zero otherwise.
Functions bae_crossarcarc, bae_crosslinepoly, bae_crosssegarc, bae_crosssegseg.
int bae_crosslinepoly( // Crossing flag double; // Line start point X coordinate (STD2) double; // Line start point Y coordinate (STD2) double; // Line end point X coordinate (STD2) double; // Line end point Y coordinate (STD2) double ]0.0,[; // Line width (STD2) );
The bae_crosslinepoly function checks whether the specified wide line segment crosses the temporary polygon created with bae_storepoint. The function returns 1 if the segment crosses the polygon or zero otherwise.
Functions bae_crossarcarc, bae_crosslineline, bae_crosssegarc, bae_crosssegseg, bae_storepoint.
int bae_crosssegarc( // Crosspoint count double; // Segment start point X coordinate (STD2) double; // Segment start point Y coordinate (STD2) double; // Segment end point X coordinate (STD2) double; // Segment end point Y coordinate (STD2) double; // Arc start point X coordinate (STD2) double; // Arc start point Y coordinate (STD2) double; // Arc center point X coordinate (STD2) double; // Arc center point Y coordinate (STD2) int [1,2]; // Arc center point type code (STD15) double; // Arc end point X coordinate (STD2) double; // Arc end point Y coordinate (STD2) int [0,1]; // Crosspoint priority flag & double; // Crosspoint 1 X coordinate (STD2) & double; // Crosspoint 1 Y coordinate (STD2) & double; // Crosspoint 2 X coordinate (STD2) & double; // Crosspoint 2 Y coordinate (STD2) );
The bae_crosssegarc function determines the crossing points for the specified segment and arc. The function returns the number of crosspoints (0, 1, or 2). The coordinates of existing crosspoints are also returned through the crosspoint functions parameters.
Functions bae_crossarcarc, bae_crosslineline, bae_crosslinepoly, bae_crosssegseg.
int bae_crosssegseg( // Crossing flag int [0,1]; // Infinite line comparison flag double; // Line 1 start point X coordinate (STD2) double; // Line 1 start point Y coordinate (STD2) double; // Line 1 end point X coordinate (STD2) double; // Line 1 end point Y coordinate (STD2) double; // Line 2 start point X coordinate (STD2) double; // Line 2 start point Y coordinate (STD2) double; // Line 2 end point X coordinate (STD2) double; // Line 2 end point Y coordinate (STD2) & double; // Crosspoint X coordinate (STD2) & double; // Crosspoint Y coordinate (STD2) );
The bae_crosssegseg function checks whether the specified segments and/or lines are crossing each other. The first function parameter specifies whether a segment comparison or a infinite line comparison should be carried out. The function returns 1 if a crosspoint was found or zero otherwise. The crosspoint coordinates are returned through the last two function parameters if a crosspoint was found.
Functions bae_crossarcarc, bae_crosslineline, bae_crosslinepoly, bae_crosssegarc.
int bae_dashpolyline( // Returns status int; // Polygon dash mode: // 0 = straight line (no dash) // 1 = dashed line // 2 = dotted line // 3 = dashed/dotted line double ]0.0,[; // Polygon dash base length (STD2) double ]-0.5,0.5[; // Polygon dash relative spacing * int; // Polygon line scan function * int; // Polygon arc scan function );
The bae_dashpolyline function vectorizes the polygon previously stored with bae_storepoint using the specified dash parameters. The polygon line and arc scan functions are automatically called for each polygon line and/or arc, respectively. The function returns zero if the vectorization was successful, or nonzero on error or if the scan was aborted.Polygon line scan function
int polylinescanfuncname( double xs, // Line start point X coordinate (STD2) double ys, // Line start point Y coordinate (STD2) double xe, // Line end point X coordinate (STD2) double ye // Line end point Y coordinate (STD2) ) { // Polygon line scan function statements : return(errstat); }The return value of the polygon line scan function should be zero if the scan was ok or nonzero on error or if the scan should be aborted.
Polygon arc scan function
int polylinescanfuncname( double xs, // Arc start point X coordinate (STD2) double ys, // Arc start point Y coordinate (STD2) double xe, // Arc end point X coordinate (STD2) double ye // Arc end point Y coordinate (STD2) double xc, // Arc center point X coordinate (STD2) double yc // Arc center point Y coordinate (STD2) int cwflag; // Arc clockwise flag: // 0 = arc counter-clockwise // else = arc clockwise ) { // Polygon arc scan function statements : return(errstat); }The return value of the polygon arc scan function should be zero if the scan was ok or nonzero on error or if the scan should be aborted.
Functions bae_clearpoints, bae_storepoint.
int bae_deffuncprog( // Returns status int [1,128]; // Function key number string; // User Language program name or //#
followed by menu item (STD4) );
The bae_deffuncprog function assigns the given User Language program (or BAE menu function) to the given function key. An empty string program name specification can be used to reset the current assignment. The function returns zero if done or nonzero on error (i.e., invalid parameters or reset request for undefined key bindings).
Functions bae_getfuncprog, bae_resetmenuprog.
int bae_defkeyprog( // Returns status int; // Key character string; // User Language program name or //#
followed by menu item (STD4) );
The bae_defkeyprog function assigns the specified User Language program (or BAE menu function) to the given standard key. An empty string program name specification can be used to reset the current assignment. The function returns zero if done, or nonzero on error (i.e., invalid parameters or reset request for undefined key bindings).
Functions bae_getkeyprog, bae_resetmenuprog.
int bae_defmenu( // Returns status int [0,999]; // Menu code number int [0,999]; // Menu area code number: // 1 = main menu area // 101 = first submenu area // 102 = second submenu area // : = : submenu area );
The bae_defmenu function starts the definition of a standard menu in the currently active BAE module. The function returns (-1) on error or zero otherwise. After calling bae_defmenu, the bae_defmenutext function should be applied for defining the menu entries. The menu definition initiated with bae_defmenu must be terminated by a call to the bae_endmenu function. The bae_resetmenuprog function can be used to reset all menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_defmenuprog, bae_defmenutext, bae_endmenu, bae_redefmenu, bae_resetmenuprog.
int bae_defmenuprog( // Selection code or (-1) on error int [0,999]; // Menu number int [0,99]; // Menu line string; // Menu text string; // User Language program name or //#
followed by menu item (STD4) int; // Menu entry processing key: // 8000000h = always available // 7FFFFFFh = available for each // element type // else = (combined) DDB class // processing key );
The bae_defmenuprog function assigns the specified menu text and the named User Language program (or BAE menu function) to the given menu entry. The menu number specifies the number of the main menu, whilst the menu line designates the position in the according submenu. An empty string program name specification can be used to reset the current assignment. The menu entry processing key activates ghost menu configurations. The processing key is a coded integer value as retrieved and/or defined using the bae_getclassbitfield and bae_getmenubitfield functions (hex value 80000000h can be entered to allow for application in any case). The bae_defmenuprog function returns zero if done or nonzero on error (i.e., invalid parameters or reset request for undefined menu assignments). The bae_resetmenuprog function can be used to reset all menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_getclassbitfield, bae_getmenubitfield, bae_getmenuprog, bae_getmenutext, bae_redefmenu, bae_resetmenuprog.
void bae_defmenusel(
int [-1,29]; // Menu item index
// or (-1) for selection text store
);
The bae_defmenusel function sets the default selection for the next bae_askmenu call. This allows for the indication of the currently selected menu option. BAE Windows versions indicate the default selection through a tick marker, Motif versions grey-shade the preselected menu item, and the DOS versions and/or the sidemenu configurations preselect the menu item specified through the menu item index parameter. The bae_defmenusel selection is only valid for the next bae_askmenu call. bae_askmenu resets this selection, i.e., bae_defmenusel must be used to re-activate any required default selection for subsequent bae_askmenu calls.
Function bae_askmenu.
int bae_defmenutext( // Returns status int [0,99]; // Menu line string; // Menu text int; // Menu entry processing key: // 8000000h = always available // 7FFFFFFh = available for each element type // else = (combined) DDB class processing key );
The bae_defmenutext function must be called after bae_defmenu and/or bae_defselmenu to store the given menu line text at the specified menu line of the current menu definition. A pulldown menu seperator line is inserted prior to the menu entry if the menu line text starts with a percent character (%
). The commercial and-character&
can be used to define menu accelerator keys, with the character preceded by the&
sign defining the key for selecting the menu item through the keyboard. The menu entry processing key activates ghost menu configurations. The processing key is a coded integer value as retrieved and/or defined using the bae_getclassbitfield and bae_getmenubitfield functions (hex value 80000000h can be entered to allow for application in any case). The function returns (-1) on error or zero otherwise. The bae_resetmenuprog function can be used to reset all menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_defmenu, bae_defselmenu, bae_getclassbitfield, bae_getmenubitfield, bae_plainmenutext, bae_redefmenu, bae_resetmenuprog.
int bae_defselmenu( // Returns status int [0,999]; // Menu code number int [0,999]; // Menu area code number: // 1 = main menu area // 101 = first submenu area // 102 = second submenu area // : = : submenu area );
The bae_defselmenu function starts the definition of a standard menu in the currently active BAE module. The function returns (-1) on error or zero otherwise. After calling bae_defselmenu, the bae_defmenutext function should be applied for defining the menu entries. The menu definition initiated with bae_defselmenu must be terminated by a call to the bae_endmenu function. The bae_resetmenuprog function can be used to reset all menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_defmenuprog, bae_defmenutext, bae_endmenu, bae_redefmenu, bae_resetmenuprog.
int bae_dialaddcontrol( // Dialog element index or (-1) on error int [0,[; // Parameter type (STD5) int; // Minimumint
parameter value int; // Maximumint
parameter value int; // Initialint
parameter value double; // Minimumdouble
parameter value double; // Maximumdouble
parameter value double; // Initialdouble
parameter value string; // Initialstring
parameter value int [0,[; // Maximumstring
parameter value length double; // Dialog element X position [character units] double; // Dialog element Y position [character units] double; // Dialog element dimension [character units] string; // Parameter name/prompt );
The bae_dialaddcontrol function defines a dialog element for the specified parameter type. Subsequent calls to the bae_dialaskparams, function activate a dialog with the dialog element displayed at the specified position and size. Any label and/or prompt to be displayed with the dialog element can be specified through the parameter name/prompt function parameter. The parameter value setting(s) for the new dialog element must be passed through the function parameter(s) matching the specified dialog element parameter type. The function returns a non-negative dialog element index if the dialog element creation was successful or (-1) otherwise. The dialog element index is used as dialog element selection parameter in subsequent calls to the bae_dialgetdata and bae_dialsetdata functions. Dialog elements created with bae_dialaddcontrol are valid and/or available until the next bae_dialclr call.
Functions bae_dialadvcontrol, bae_dialaskparams, bae_dialbmpalloc, bae_dialboxbufload, bae_dialboxbufstore, bae_dialclr, bae_dialgetdata, bae_dialsetdata.
int bae_dialadvcontrol( // Returns new dialog control index or (-1) on error int [0,[; // Parameter type (STD5) int; // Minimumint
parameter value int; // Maximumint
parameter value int; // Initialint
parameter value double; // Minimumdouble
parameter value double; // Maximumdouble
parameter value double; // Initialdouble
parameter value string; // Initialstring
parameter value int [0,[; // Maximumstring
parameter value length double; // Dialog element X coordinate [character units] double; // Dialog element Y coordinate [character units] double; // Dialog element width [character units] double; // Dialog element height [character units] string; // Parameter name/prompt );
The bae_dialadvcontrol function defines an advanced dialog element (with element height specification) for the specified parameter type. Subsequent calls to the bae_dialaskparams, function activate a dialog with the dialog element displayed at the specified position, width and height. Any label and/or prompt to be displayed with the dialog element can be specified through the parameter name/prompt function parameter. The parameter value setting(s) for the new dialog element must be passed through the function parameter(s) matching the specified dialog element parameter type. The function returns a non-negative dialog element index if the dialog element creation was successful or (-1) otherwise. The dialog element index is used as dialog element selection parameter in subsequent calls to the bae_dialgetdata and bae_dialsetdata functions. Dialog elements created with bae_dialadvcontrol are valid and/or available until the next bae_dialclr call.
Functions bae_dialaddcontrol, bae_dialaskparams, bae_dialbmpalloc, bae_dialboxbufload, bae_dialboxbufstore, bae_dialclr, bae_dialgetdata, bae_dialsetdata.
int bae_dialaskcall( // Returns positive action code, or // ( 0) on, or // (-1) on or error string; // Dialog title int [0,3]; // Distance output units: // 0 = mm // 1 = Inch // 2 = mil // 3 = um double ]0.0,[; // Dialog width [character units] double ]0.0,[; // Dialog height [character units] * int; // Listbox element callback function );
The bae_dialaskcall function activates a dialog with the dialog elements previously defined with bae_dialaddcontrol. The dialog title specified with the first function parameter is displayed in the title bar of the dialog window. The size of the dialog window can be specified through the dialog width and height function parameters. The function return value is set to zero if the dialog button is pressed. Pressing a non-default action button dialog element with a positive action code assignment causes bae_dialaskcall to return with the specified action code. A value of (-1) is returned on error or dialog button activation. The bae_dialgetdata, function can be used to retrieve dialog parameter values after successfully completing bae_dialaskcall. Distance and/or length parameter values are automatically displayed and/or returned according to the distance output units mode function parameter passed to bae_dialaskcall. The last parameter allows for the specification of a user-defined callback function which is automatically called if an element of a listbox withPA_MCALLBACK
type definition is selected.Listbox Element Callback Function
int callbackfuncname( int reason, // Callback reason int boxidx, // Dialog box index int itemidx, // List element index int itemid, // List element id string itemstr // List element text ) { // Function statements : return(errstat); }The callback function should return zero upon successfull completion, or non-zero for errors or abort requests.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskparams, bae_dialbmpalloc, bae_dialboxparam, bae_dialboxperm, bae_dialclr, bae_dialgetdata, bae_dialsetdata.
int bae_dialaskparams( // Returns positive action code, or // ( 0) on, or // (-1) on or error // (-2) on dialog size change string; // Dialog title int [0,3]; // Distance output units: // 0 = mm // 1 = Inch // 2 = mil // 3 = um double ]0.0,[; // Dialog width [character units] double ]0.0,[; // Dialog height [character units] );
The bae_dialaskparams function activates a dialog with the dialog elements previously defined with bae_dialaddcontrol. The dialog title specified with the first function parameter is displayed in the title bar of the dialog window. The size of the dialog window can be specified through the dialog width and height function parameters. The function return value is set to zero if the dialog button is pressed. Pressing a non-default action button dialog element with a positive action code assignment causes bae_dialaskparams to return with the specified action code. A value of (-1) is returned on error or dialog button activation. A value of (-2) is returned if the dialog size is changed. The bae_dialgetdata, function can be used to retrieve dialog parameter values after successfully completing bae_dialaskparams. Distance and/or length parameter values are automatically displayed and/or returned according to the distance output units mode function parameter passed to bae_dialaskparams.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskcall, bae_dialbmpalloc, bae_dialboxperm, bae_dialclr, bae_dialgetdata, bae_dialsetdata.
int bae_dialbmpalloc( // Returns non-negative bitmap id or (-1) on error double ]0.0,[; // Requested bitmap width [character units] double ]0.0,[; // Requested bitmap height [character units] int [2,31]; // Bitmap id & int; // Generated bitmap width [Pixel] & int; // Generated bitmap height [Pixel] );
The bae_dialbmpalloc function creates a bitmap with the specified parameters in a dialog box to be activated with bae_dialaskparams. The function returns (-1) on error or a non-negative bitmap id (and the generated bitmap dimensions) if the bitmap was successfully created. Once the bitmap is generated, the bae_popsetarea function is used to select the bitmap for subsequent graphic output with the bae_popdrawtext and bae_popdrawpoly functions.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskcall, bae_dialaskparams, bae_dialboxperm, bae_dialclr, bae_popdrawpoly, bae_popdrawtext, bae_popsetarea.
int bae_dialboxbufload( // Status int [1,[; // Dialog box buffer id );
The bae_dialboxbufload function is used to restore dialog box definitions which were previously saved with the bae_dialboxbufstore function. The function returns zero if the dialog box definitions were successfully loaded or nonzero on error.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialboxbufstore, bae_dialclr.
int bae_dialboxbufstore( // Dialog box id (>0) or (-1) on error );
The bae_dialboxbufstore function saves the current dialog box definitions to an internal buffer. The functions returns a buffer id or (-1) on error. The buffer id can be used in subsequent calls to the bae_dialboxbufload function for restoring these dialog box definitions.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialboxbufload, bae_dialclr.
int bae_dialboxperm( // Returns positive dialog box id, or // (-1) on dialog box creation error, or // (-2) if maximum dialog box count reached string; // Dialog title int [0,3]; // Distance output units: // 0 = mm // 1 = Inch // 2 = mil // 3 = um double ]0.0,[; // Dialog width [character units] double ]0.0,[; // Dialog height [character units] );
The bae_dialboxperm function activates a modeless dialog with the dialog elements previously defined with bae_dialaddcontrol. The dialog title specified with the first function parameter is displayed in the title bar of the dialog window. The size of the dialog window can be specified through the dialog width and height function parameters. The function returns the positive dialog box id if the dialog was successfully generated, or a negative value on error. The bae_dialgetdata function can be used to retrieve dialog parameter values after successfully completing bae_dialboxperm (and dialog activation with bae_dialsetcurrent). Distance and/or length parameter values are automatically displayed and/or returned according to the distance output units mode function parameter passed to bae_dialboxperm.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskcall, bae_dialaskparams, bae_dialbmpalloc, bae_dialclr, bae_dialgetdata, bae_dialsetcurrent, bae_dialsetdata.
int bae_dialclr( // Returns status );
The bae_dialclr function clears/deletes all BAE dialog elements previously defined with bae_dialaddcontrol. The function return value is nonzero if dialogs are not supported in the current BAE user interface environment. To clear any dialog elements from previous dialog definitions, bae_dialclr should be called before starting a new BAE dialog definitions The function return value should be checked, and alternative user input facilities should be provided if dialogs are not supported.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskcall, bae_dialaskparams, bae_dialbmpalloc, bae_dialboxbufload, bae_dialboxbufstore, bae_dialboxperm, bae_dialgetdata, bae_dialsetdata.
int bae_dialgetdata( // Returns status int [0,[; // Dialog element index & int; // Dialog element integer value & double; // Dialog element double value & string; // Dialog element string value );
The bae_dialgetdata function is used to retrieve dialog element parameter values after successful bae_dialaskparams calls. The query dialog element is selected through the dialog element index returned by bae_dialaddcontrol at the creation of the dialog element. The parameter value is returned through the function parameter matching the data type of the queried dialog element. The function returns nonzero if the dialog element parameter query failed.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskparams, bae_dialclr, bae_dialsetdata.
double bae_dialgettextlen( // Returns text length [character units] int [0,[; // Dialog text (font) type string; // Dialog text string );
The bae_dialgettextlen function calculates and returns the spacial requirements for displaying the specified dialog text string.
int bae_dialsetcurrent( // Returns status int [0,[; // Dialog box id );
The bae_dialsetcurrent activates the (modeless) dialog box specified through the dialog box id for subsequent dialog box operations. The functions returns zero if a dialog was successfully selected, or nonzero otherwise.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskcall, bae_dialaskparams, bae_dialbmpalloc, bae_dialboxperm, bae_dialclr, bae_dialgetdata, bae_dialsetdata.
int bae_dialsetdata( // Returns status int [0,[; // Dialog element index int [0,[; // Dialog element parameter type (STD5) int; // Dialog element integer value double; // Dialog element double value string; // Dialog element string value );
The bae_dialsetdata function is used to set dialog element parameter types and/or values previously defined with the bae_dialaddcontrol function. The dialog element to be changed is selected through the dialog element index returned by bae_dialaddcontrol at the creation of the dialog element. The new dialog element parameter value must be passed through the function parameter matching the specified dialog element parameter type. The function returns nonzero if the dialog element parameter value change failed.
Functions bae_dialaddcontrol, bae_dialadvcontrol, bae_dialaskparams, bae_dialclr, bae_dialgetdata.
int bae_endmainmenu( // Returns status );
The bae_endmainmenu function terminates a main menu redefinition previously initiated with the bae_redefmainmenu function. The function returns (-1) on error or zero otherwise.
Function bae_redefmainmenu.
int bae_endmenu( // Returns status );
The bae_endmenu function terminates a menu definition previously initiated with either of the functions bae_defmenu or bae_defselmenu. The function returns (-1) on error or zero otherwise.
Functions bae_defmenu, bae_defselmenu.
int bae_fontcharcnt( // Returns font character count );
The bae_fontcharcnt function returns the number of characters defined in the currently active BAE text font.
string bae_fontname( // Returns text font name );
The bae_fontname function returns the text font name of the currently loaded BAE element.
int bae_getactmenu( // Returns menu entry number (STD4) );
The bae_getactmenu function returns the menu entry number (STD4) of the currently active BAE menu function or (-1) if no menu function is active. This feature is useful for key-called User Language programs.
int bae_getanglelock( // Returns angle lock flag (STD9) );
The bae_getanglelock function returns the current BAE angle lock mode (0=angle unlocked, 1=angle locked).
Function bae_setanglelock.
void bae_getbackgrid( & double; // Returns X display grid (STD2) & double; // Returns Y display grid (STD2) );
The bae_getbackgrid function returns the current BAE X/Y display grid values with its parameters. Zero grid values refer to switched-off grids.
Function bae_setbackgrid.
string bae_getcasstime( // Returns Packager net lsit name & int; // Returns time second & int; // Returns time minute & int; // Returns time hour & int; // Returns date day & int; // Returns date month & int; // Returns date year );
The bae_getcasstime function can be used to retrieve the date and time of the last project netlist updated caused by Packager or .
Functions bae_getpackdata, bae_getpacktime.
int bae_getclassbitfield( // Returns processing key int ]0,[; // DDB database class code (STD1) );
The bae_getclassbitfield function returns the processing key code assigned to the specified DDB database class. The function returns (-1) for invalid and/or unknown database class specifications.The processing key is a coded integer value which - in a BAE module - is unique for each processable DDB database class. Such key codes can be combined using bit-or operations and can subsequently be assigned to specific menu entries using either of the bae_defmenutext, bae_defmenuprog or bae_redefmenu functions, thus allowing for the configuration of menu functions which can only be applied on certain database classes.
Functions bae_defmenuprog, bae_defmenutext, bae_getmenubitfield, bae_redefmenu.
int bae_getcmdbuf( // Returns status int [-50,2099]; // Command buffer index 0 to 49 // or 1000 to 1099 for Undo items 1 to 100 // or 2000 to 2099 for Redo items 1 to 100 // or negative value for message history & string; // Command (sequence) string & string; // Command notification text );
The bae_getcmdbuf function is used to query the current context menu command history, i.e., the list of commands activated through the right mouse button. The command buffer index parameter selects the command to be queried (zero being the most recent command). The command (sequence) string and the command notification text (as displayed in the title bar) are returned through the second and third function parameter. The function returns 1 if the query was successful or zero if an invalid command buffer index was specified.
Function bae_storecmdbuf.
int bae_getcolor( // Color value (STD18) int; // Display item type (SCM1|LAY9|ICD9) );
The bae_getcolor function returns the color value currently set for the given display item type. The display item type value must be set according to the currently active User Language Interpreter environment.
Function bae_setcolor.
int bae_getcoorddisp( // Returns coordinate display mode (STD7) );
The bae_getcoorddisp function returns the current BAE coordinate display mode. The return value is 0 for mm display units (micrometer units in IC Design) or 1 for Inch display units (mil units in IC Design).
Function bae_setcoorddisp.
int bae_getdblpar( // Returns status int [0,[; // Parameter type/number: // 0 = maximum dialog box width // 1 = maximum dialog box height // 2 = display zoom factor // 3 = Rubberband corner radius (STD2) // 4 = Rubberband X vector coordinate (STD2) // 5 = Rubberband Y vector coordinate (STD2) // 6 = fixed X pick coordinate (STD2) // 7 = fixed Y pick coordinate (STD2) // 8 = Dialog box width: // 9 = Dialog box height: // 10 = Screen pick aperture (STD2) // 11 = Element selection preview area relative size [0.05, 0.95] // 12 = Dialog box X unit pixels // 13 = Dialog box Y unit pixels & double; // Returns parameter value );
The
bae_getdblpar function is used to query
Bartels AutoEngineerdouble
parameter settings. The functions returns zero if the query was successful or (-1) otherwise.
Functions bae_getintpar, bae_getstrpar, bae_setdblpar, bae_setintpar, bae_setstrpar.
string bae_getfuncprog( // Program name int [1,128]; // Function key number );
The bae_getfuncprog function returns the name of the User Language program (or the hash-preceded BAE menu function number) assigned to the specified function key. An empty string is returned if no program is assigned to the key or if the function key number specification is invalid.
int bae_getgridlock( // Returns grid lock flag (STD8) );
The bae_getgridlock function returns the current BAE grid lock mode (0=grid unlocked, 1=grid locked).
Function bae_setgridlock.
int bae_getgridmode( // Returns automatic grid setting mode // 0x01: input grid = 0.25 × display grid // 0x02: input grid = 0.50 × display grid // 0x04: input grid = 1.00 × display grid // 0x08: input grid = 2.00 × display grid // 0x10: display grid = 0.25 × input grid // 0x20: display grid = 0.50 × input grid // 0x40: display grid = 1.00 × input grid // 0x80: display grid = 2.00 × input grid );
The bae_getgridmode function returns the current BAE grid dependency mode.
Function bae_setgridmode.
void bae_getinpgrid( & double; // Returns X input grid (STD2) & double; // Returns Y input grid (STD2) );
The bae_getinpgrid function returns the current BAE X/Y input grid values with its parameters. Zero grid values refer to switched-off grids.
Function bae_setinpgrid.
int bae_getintpar( // Returns status int [0,[; // Parameter type/number: // 0 = Input coordinate range checking: // 0 = range check enabled // 1 = range check disabled // 1 = Module change autosave mode: // 0 = autosave without prompt // 1 = prompt before autosave // 2 = Display disable mode: // 0 = display enabled // 1 = display disabled // 3 = User interface menu/mouse mode: // 0 = Sidemenu configuration // 1 = Pulldown menu, LMB context // 2 = Pulldwon menu, RMB context // 4 = Workspace text color mode: // 0 = standard colors // 1 = inverted standard colors // 2 = workspace related colors // 5 = Load display mode: // 0 = display overview after load // 1 = handle load display in bae_load // 6 = File dialog view: // 0 = old BAE style file selection // 1 = Explorer style default view // 2 = Explorer style list view // 3 = Explorer style details // 4 = Explorer style small icons // 5 = Explorer style large icons // 6 = Use default style and size // 7 = Element selection box mode: // 0 = display name only // 1 = display name and date // 8 = Element selection sort mode: // 0|1 = sort by name // 2 = sort numerically // 3 = sort by date // 9 = Placement visibility: // 0 = placed elements visible // 1 = unplaced elements visible // 10 = Last file system error // 11 = Command history disable flag: // 0 = Command history enabled // 1 = Command history disabled // 12 = Popup menu mouse warp mode: // 0 = No popup menu mouse warp // 1 = First popup menu entry mouse warp // 2 = Preselected menu entry mouse warp // +4 = Mouse position restore warp // +8 = Element pick position warp // 13 = Save disable flag: // 0 = save enabled // 1 = save disabled // 14 = Mouse rectangle min. size: // ]0,[ = min. rectangle size // 15 = Mouse info display mode: // 0 = Tooltip info display // 1 = Continuous crosshair info display // 2 = Crosshair info display with Ctrl // 16 = Next dialog box id // 17 = Last created tooltip id // 18 = Polygon drop count // 19 = Polygon check disabled flag: // 0 = Polygon check enabled // 1 = Polygon check disabled // 20 = Cursor key grid mode: // 0 = Input grid // 1 = Pixel grid // 21 = Unsaved plan flag // 22 = Element batch load mode: // 0 = no batch load // 1 = Batch load // 2 = batch load, restore zoom window // 23 = Grid lines display: // 0 = Dot grid // 1 = Line grid // 24 = Display mirroring flag // 25 = Input grid display flag // 26 = Mouse function repeat mode: // 0 = Repeat menu function // +1 = Repeat keystroke function // +2 = Repeat context menu function // 27 = Maximum Undo/Redo count // 28 = Menu tree view mode: // 0 = No menu tree view window // 1 = Left attached menu tree view window // 2 = Right attached menu tree view window // 29 = Menu tree view pixel width // 30 = Message history disabled flag // 31 = Element load message mode: // 0 = Standard message // 1 = User message // 2 = User error message // 32 = Pick marker display mode: // 0 = Circle marker // 1 = Diamond marker // 33 = Mouse drag status: // 0 = No mouse drag // 1 = Request mouse drag // 2 = Mouse dragged // 3 = Request mouse drag release // 34 = Menu function repeat request flag // 35 = Function aborted flag // 36 = Plan selection preview flag // 37 = File error display mode: // 0 = Status message only // 1 = Confirm message box // 38 = Element selection reference display mode: // 0 = Display project file references // 1 = Display library file references // 39 = Mouse double-click mode: // 0 = Map double-click and select 0 to right mouse button // 1 = Ignore double-click // 2 = Map double-click to right mouse button // 40 = Mouse pick double-click mode: // 0 = Map double-click to right mouse button // 1 = Ignore double-click // 41 = Dialog control support flags: // 0 = No dialog control elements supported // |1 = Base dialog control set supported // |2 = List view supported // |4 = Progress display supported // |8 = Toolbar button supported // 42 = Progress box display mode: // 0 = No progress box window // 1 = Display progress window // 43 = Progress box abort request flag // 44 = Middle mouse button disable flag // 45 = Current undo items count // 46 = File drag and drop operation flag // 47 = Autoraise BAE window flag // 48 = Menu function active count // 49 = Internal polygon list point count // 50 = Alternate configuration file priority // 51 = Dialog position save mode: // 0 = Store absolute coordinates // 1 = Store main window relative coordinates // 2 = Store main window monitor absolute coordinates // 52 = Message box default button index: // (-1) = No default (Abort or No) // 0-2 = Default button index & int; // Returns parameter value );
The bae_getintpar function is used to query Bartels AutoEngineer integer parameter settings. The functions returns zero if the query was successful or (-1) otherwise.
Functions bae_getdblpar, bae_getstrpar, bae_setdblpar, bae_setintpar, bae_setstrpar.
int bae_getinvcolor( // Returns inverted color palette flag );
The
bae_getinvcolor function checks whether the BAE system color palette is "inverted". The system color palette is considered inverted if the darkest color in palette (as defined through a
bae.col
file in the BAE programs directory) is not black. The function returns nonzero if the BAE system color palette appears to be inverted or zero else.
int bae_getmenubitfield( // Returns processing key int [0,999]; // Menu code int [0,99]; // Menu line );
The bae_getmenubitfield function returns the processing code assigned to the menu entry specified with the main menu code and the menu line number in the corresponding submenu. The function returns (-1) for invalid and/or unknown menu entry specifications.
The processing key is a coded integer value specifying a set of element types which can be subject to the menu function. This key is utilized throughout the Bartels AutoEngineer to activate and/or deactivate specific menu functions according to the type of element currently loaded (note that the ghost menu layouts of the BAE Windows versions are a typical application of this feature). With the hex value 80000000h assigned to its processing key, a menu function can always be applied (i.e., even if no element is loaded). With the hex value 7FFFFFFFh assigned to its processing key, a menu function can be applied to any currently loaded element type. Other processing key codes are defined in each BAE module according to the DDB database classes which can be processed. The processing key code for a specific database class can be retrieved with the bae_getclassbitfield function. Such processing key codes can be combined using bit-or operations and can subsequently be assigned to specific menu entries using either of the bae_defmenutext, bae_defmenuprog or bae_redefmenu functions, thus allowing for a user-defined ghost menu setup.
Functions bae_defmenuprog, bae_defmenutext, bae_getclassbitfield, bae_redefmenu.
string bae_getkeyprog( // Program name int; // Key character );
The bae_getkeyprog function returns the name of the User Language program (or the hash-preceded BAE menu function number) assigned to the specified standard key. An empty string is returned if no program is assigned to the key or if the key character specification is invalid.
Functions bae_defkeyprog, bae_resetmenuprog.
int bae_getmenuitem( // Return status & int; // Menu code & string; // Menu text(s) & string; // Menu command );
The
bae_getmenuitem function activates a menu function selection for menu item information query (i.e., the selected menu function is not executed). The menu code parameter returns the numeric menu call code of the selected menu item. The menu text parameter returns the selected hierarchical menu item text sequence (with menu texts separated by
->
). The menu command parameter returns the menu command string/sequence assigned to the selected menu item. The function returns zero if the query was successful or nonzero for failed or aborted queries.
Functions bae_callmenu, bae_defmenuprog, bae_getmenuprog, bae_getmenutext.
string bae_getmenuprog( // Program name int [0,999]; // Menu code int [0,99]; // Menu line );
The bae_getmenuprog function returns the name of the User Language program (or the hash-preceded BAE menu function number) assigned to the specified menu entry. The menu code parameter specifies the main menu number, whilst the menu line parameter specifies the position in the corresponding submenu. An empty string is returned if no program is assigned to the menu entry or if the menu entry does not exist.
Functions bae_defmenuprog, bae_getmenuitem, bae_getmenutext, bae_resetmenuprog.
string bae_getmenutext( // Menu text int [0,999]; // Menu code int [0,99]; // Menu line );
The bae_getmenutext function returns the menu text which is assigned to the given menu entry. The menu code parameter specifies the main menu number, whilst the menu line parameter specifies the position in the corresponding submenu. An empty string is returned if the specified menu entry does not exist.
Functions bae_defmenuprog, bae_getmenuitem, bae_getmenuprog, bae_plainmenutext, bae_resetmenuprog.
string bae_getmoduleid( // Returns module id );
The bae_getmoduleid retrieves the module name/identification of the currently active BAE program module.
Function bae_setmoduleid.
string bae_getmsg( // Returns current message string );
The bae_getmsg function is only available in BAE HighEnd. bae_getmsg is used for receiving pending messages from the BAE HighEnd message system. Messages are send to program instances of a BAE HighEnd session using the bae_sendmsg function. A BAE HighEnd session is started with a BAE call and includes any other BAE program instance subsequently started with the function from the BAE main menu or with the function from the Schematic Editor. Each BAE HighEnd module receiving a message automatically activates the User Language program named bae_msg. If bae_msg is not available, the system tries to start an interpreter-specific User Language program (scm_msg in the Schematic Editor, ged_msg in the Layout Editor, ar_msg in the Autorouter, etc.). The bae_getmsg function must be used in the *_msg User Language program to retrieve pending messages. Pending messages are only available during the execution of the *_msg User Language program, i.e., any message not retrieved by the *_msg program using the bae_getmsg function is lost. The message text string can be used for triggering certain actions in the destination program instances.
Function bae_sendmsg.
int bae_getpackdata( // Returns status string; // Project file name & string; // Returns layout library file name & string; // Returns net list name );
The bae_getpackdata retrieves the layout library file and net list name parameters used for the last Packager run on the specified project file. The function returns zero if the query was successful or non-zero if the paramater data was not found.
Functions bae_getcasstime, bae_getpacktime.
int bae_getpacktime( // Returns status string; // Project file name & int; // Returns time second & int; // Returns time minute & int; // Returns time hour & int; // Returns date day & int; // Returns date month & int; // Returns date year );
The bae_getpacktime retrieves the date and time of the last Packager run for the specified project file. The function returns zero if the query was successful or non-zero if the date/time information was not available.
Functions bae_getcasstime, bae_getpackdata.
int bae_getpolyrange( // Returns status & double; // Returns polygon range left boundary & double; // Returns polygon range lower boundary & double; // Returns polygon range right boundary & double; // Returns polygon range upper boundary );
The bae_getpolyrange function is used to query the range of the internal BAE polygon defined with bae_storepoint. The function returns zero if the query was successful or non-zero otherwise.
Functions bae_clearpoints, bae_storepoint.
int bae_getstrpar( // Rückgabe Status int [0,[; // Parameter type/number: // 0 = Current element comment text // 1 = Current element specification // 2 = Last file access error file // 3 = Last file access error item // [ 4 = System parameter - no read access ] // [ 5 = System parameter - no read access ] // 6 = Last loaded color table // 7 = Menu text of last called function // 8 = Current menu item element text // 9 = Current element load user message // 10 = Clipboard text string // 11 = Next module call file argument // 12 = Next module call element argument // 13 = Next module call command/type argument // 14 = Last output file name // 15 = Host name // [ 16 = System parameter - no read access ] // 17 = All users data directory // 18 = Current user data directory // 19 = Alternate configuration data directory // 20 = Local data column // 21 = Global data column & string; // Returns parameter value );
The bae_getstrpar function is used to query Bartels AutoEngineer string parameter settings. The functions returns zero if the query was successful or (-1) otherwise.
Functions bae_getdblpar, bae_getintpar, bae_setdblpar, bae_setintpar, bae_setstrpar.
void bae_inittextscreen( );
The bae_inittextscreen function clears the BAE graphic workarea and initializes the BAE text screen. The text cursor is set to the upper left corner of the text screen.
int bae_inpoint( // Returns status double; // Start X coordinate (STD2) double; // Start Y coordinate (STD2) & double; // Returns input X coordinate (STD2) & double; // Returns input Y coordinate (STD2) int; // Drawing mode: // 0 = no tracking display // 1 = rubberband frame display // 2 = rubberband line display // 3 = rubberband circle display // 4 = rubberband distance display // 5 = rubberband zoom window display // 6 = rubberband square display // 7 = rubberband centered square display // 8 = rubberband centered window display // 9 = rubberband line polygon display // 10 = rubberband outline polygon display // 11 = rubberband circle center display // 12 = rubberband fixed // 13 = rubberband centered zoom window // 14 = No window display, RMB immediate abort // 15 = Fixed offset display );
The bae_inpoint function activates an interactive coordinate point specification request (with mouse and optional submenu). The start coordinates specify the start point for commands. The selected point coordinates are passed with the return parameters. A drawing mode value of 1 activates rubberband frame drawing from the start coordinate to the current mouse coordinate during coordinate selection. A drawing mode value of 2 activates rubberband line drawing from the start coordinate to the current mouse coordinate during coordinate selection. The function returns nonzero if a point has been selected or (-1) if the point selection has been aborted.
Function bae_inpointmenu.
int bae_inpointmenu( // Returns status double; // Start X coordinate (STD2) double; // Start Y coordinate (STD2) & double; // Returns input X coordinate (STD2) & double; // Returns input Y coordinate (STD2) int; // Drawing mode: // 0 = no tracking display // 1 = rubberband frame display // 2 = rubberband line display // 3 = rubberband circle display // 4 = rubberband distance display // 5 = rubberband zoom window display // 6 = rubberband square display // 7 = rubberband centered square display // 8 = rubberband centered window display // 9 = rubberband line polygon display // 10 = rubberband outline polygon display // 11 = rubberband circle center display // 12 = rubberband fixed // 13 = rubberband centered zoom window // 14 = unused // 15 = Fixed offset display );
The bae_inpointmenu function activates an interactive coordinate point specification request (with mouse and optional submenu). The start coordinates specify the start point for commands. The selected point coordinates are passed with the return parameters. A drawing mode value of 1 activates rubberband frame drawing from the start coordinate to the current mouse coordinate during coordinate selection. A drawing mode value of 2 activates rubberband line drawing from the start coordinate to the current mouse coordinate during coordinate selection. The last parameter allows for the specification of a callback function (e.g., for displaying a specific options menu) to be activated if the right mouse button is pressed. The function returns nonzero if a point has been selected or (-1) if the point selection has been aborted.Right mouse button callback function
int callbackfunction( // Status double x // Current input X coordinate double y // Current input Y coordinate ) { // Right mouse button callback function statements : return(status); }The right mouse button callback function return value should be 0 to signal input completion, 1 to continue input, or any other value to abort input. Modified X/Y input coordinate parameters can be returned for zero callback function return values (input completed).
Function bae_inpoint.
string bae_language( // Returns language code: //DE
= German //EN
= English // for future use: //FR
= French //IT
= Italian //SP
= Spanish //SV
= Swedish );
The bae_language function returns a code for identifying the language which is currently activated in the BAE user interface. This information can be used to support dynamic multi-language support.
int bae_loadcoltab( // Returns status string; // Color table name );
The bae_loadcoltab function loads the color table with the given name to the BAE. The function returns nonzero if the color table cannot be loaded.
int bae_loadelem( // Returns status string; // File name string; // Element name int [100,[; // DDB class (STD1) );
The bae_loadelem function loads a BAE element from DDB file to memory. The element is specified by the DDB file name, the element name and the DDB class. Possible Schematic Editor DDB class codes are 800, 801, 802 and 803 for SCM sheet, SCM symbol, SCM marker and SCM label, respectively. Possible BAE Layout DDB class codes are 100, 101, 102 and 103 for PCB layout, layout part, layout padstack and layout pad, respectively. Possible IC Design DDB class codes are 1000, 1001 and 1002 for IC layout, IC cell and IC pin, respectively. The function returns zero if the element was successfully loaded, (-1) on file access errors, 1 on text font load faults, 2 if referenced macros (library elements) are missing or 3 on unplaced parts and/or missing pins, i.e., if part symbols placed on a loaded layout do not match the net list specifications.
An empty element name can be specified with PCB Layout element class 100 for automatically loading the layout element with the default layout element name (seeLAYDEFELEMENT
command for bsetup).
bae_loadelem automatically processes pending requests when loading SCM plans to the Schematic Editor.
The
bae_loadelem function changes all currently loaded BAE element data. As a result, any active index variable becomes invalid. It is strongly recommended to refrain from using
bae_loadelem in index variable accessing program blocks such as
forall
loops. Since
bae_loadelem reset the
facility, it is also strongly recommended to check (with
bae_plannotsaved) whether the current element has been saved before calling
bae_loadelem.
int bae_loadfont( // Returns status string; // Text font name );
The bae_loadfont function loads the name-specified BAE text font. The function returns nonzero on font load errors or zero otherwise.
int bae_menuitemhelp( // Status int [0,9999]; // Menu code (STD4) string; // Help file name (Windows.hlp
file) );
The bae_menuitemhelp displays the Windows online help file topic for the specified menu code. The function returns nonzero if invalid parameters are specified.
bae_menuitemhelp operates only under Windows.
void bae_msgbox( int; // Message box style/icon: // 0 = info (information) // 1 = warning (exclamation-point) // 2 = error (question-mark) // 3 = fatal error (stop-sign) // else = no icon string; // Message box text string string; // Message box title string );
The bae_msgbox function activates a message box popup with a confirmation ( ) button. The appearance of the message popup window can be selected with the first parameter. The message box text string is displayed in the popup area. The message box title string is used as header string to be displayed in the message box popup window title bar. The appearance and layout of the message box (popup positioning, title bar display, confirmation button, text alignment, word wrapping, etc.) can differ depending on the host operating system platform.
Functions bae_msgboxverify, bae_msgboxverifyquit.
int bae_msgboxverify( // Returns answer code: // 1 = Yes // 0 = No (default) string; // Message box text string string; // Message box title string );
The bae_msgboxverify function activates a message box popup with a Yes/No verification query. The function returns 1 on Yes input/selection or zero otherwise. The message box text string is displayed in the popup area. The message box title string is used as header string to be displayed in the message box popup window title bar. The appearance and layout of the message box (popup positioning, title bar display, yes/no buttons, text alignment, word wrapping, etc.) can differ depending on the host operating system platform.
Functions bae_msgbox, bae_msgboxverifyquit.
int bae_msgboxverifyquit( // Returns answer code: // 1 = Yes // 0 = No // else = Cancel/Quit (default) string; // Message box text string string; // Message box title string );
The bae_msgboxverifyquit function activates a message box popup with a Yes/No/Quit verification query. The function returns 1 on Yes input/selection or zero on No input/selection. Any other return value indicates a Cancel/Quit request. The message box text string is displayed in the popup area. The message box title string is used as header string to be displayed in the message box popup window title bar. The appearance and layout of the message box (popup positioning, title bar display, yes/no/quit buttons, text alignment, word wrapping, etc.) can differ depending on the host operating system platform.
Functions bae_msgbox, bae_msgboxverify.
int bae_msgprogressrep( // Returns non-zero on error string; // Progress display text string int [0,258]; // Progress display type: // 1 : Percentage progress // 2 : Marquee progress slider // |256 : Display abort button int [0,10000]; // Progress display completion value [%*100] int [0,[; // Progress display min. character length );
The bae_msgprogressrep activates and/or updates the current BAE progress display with the specified parameters. The function returns zero on success or non-zero on error (if invalid parameters were specified). The bae_msgprogressterm function can be used to terminate the progress display.
Function bae_msgprogressterm.
void bae_msgprogressterm( );
The bae_msgprogressterm terminates the previously with bae_msgprogressrep activated BAE progress display.
Function bae_msgprogressrep.
void bae_mtpsize( & int; // Returns popup menu text columns & int; // Returns popup menu text rows );
The bae_mtpsize function retrieves the size of the graphic workarea available for displaying popup menus or toolbars defined with bae_popshow and/or bae_settbsize. The display area width is returned with the popup menu text columns parameter, whilst the display area height is returned with the popup menu text rows parameter. The bae_charsize function can be utilized to convert these values to standard length units.
Functions bae_charsize, bae_popshow, bae_twsize, bae_settbsize.
int bae_nameadd( // Name list index/ID or (-1) on error string; // Name string; // Date string string; // Date sort string int; // Sort mode: // 0 = append (no sorting) // 1 = sort alphanumerically // 2 = sort numerically // 3 = sort by date // 4 = sort for ID creation );
The bae_nameadd function adds a name entry to the BAE name selection list. This list is used by the bae_askname function for activating name selection dialogs. The bae_nameclr function can or/should be used prior to the first bae_nameadd call to clear any previously stored entries from the name selection list. The function returns a name list index/ID or (-1) on error.
Functions bae_askname, bae_nameclr, bae_nameget.
void bae_nameclr( );
The bae_nameclr function clears the name list currently defined with bae_nameadd.
Functions bae_askname, bae_nameadd, bae_nameget.
int bae_nameget( // Status
int; // Name list index
& string; // Returns name
& string; // Returns date string
& string; // Returns date sort string
& string; // Returns comment
& int; // Returns name entry count or name ID
);
The bae_nameget can be used to query BAE name selection list entries defined by bae_nameadd. The function returns zero if the query was successfully or nonzero otherwise.
Functions bae_askname, bae_nameadd, bae_nameclr.
string bae_numstring( // Returns numeric string double; // Input value int [0,[; // Maximum precision );
The bae_numstring converts the input value into a string with the specified precision (number of decimal points.
int bae_peekiact( // Returns pending interaction status/type: // 0 = No automatic interaction pending // 1 = Mouse interaction pending // 2 = Text interaction pending // 3 = Menu interaction pending // 4 = Wait key interaction pending );
The bae_peekiact can be used to check whether an automatic interaction is pending in the current interaction queue. The function returns a type code for the next automatic interaction queue item, or zero if no automatic interaction is pending.
Functions bae_storekeyiact, bae_storemenuiact, bae_storemouseiact, bae_storetextiact.
string bae_plainmenutext( // Returns answer string string; // Menu item string );
The bae_plainmenutext function strips all special characters for menu separator line specifications (%
), key accelerators (&
), etc. from the specified menu item string. The resulting plain menu item string is returned as function result.
Functions bae_defmenutext, bae_getmenutext.
int bae_planddbclass( // Returns BAE element DDB class code (STD1) );
The bae_planddbclass functions returns the DDB class code of the currently loaded BAE element. Possible Schematic Editor return values are 800 for SCM sheet, 801 for SCM symbol, 802 for SCM marker or 803 for SCM label. Possible BAE Layout return values are 100 for PCB layout, 101 for layout part, 102 for layout padstack or 103 for layout pad. Possible IC Design return values are 1000 for IC layout, 1001 for IC cell and 1001 for IC pin. The function returns (-1) if no element is loaded.
string bae_planename( // Returns BAE element name );
The bae_planename function returns the element name of the currently loaded BAE element or an empty string if no element is currently loaded.
Function bae_plansename.
string bae_planfname( // Returns BAE element file name );
The bae_planfname function returns file name of the currently loaded BAE element or and empty string if no element is currently loaded.
Functions bae_plansfname, bae_setplanfname.
int bae_plannotsaved( // Returns BAE element not saved flag );
The bae_plannotsaved function checks whether the currently loaded BAE element has been saved. The functions zero if the element has been saved or 1 if changes have been made since the last save.
string bae_plansename( // Returns BAE destination element name );
The bae_plansename function returns the destination element name of the currently loaded BAE element or an empty string if no element is currently loaded. This function should be used for element name queries during operations.
Function bae_planename.
string bae_plansfname( // Returns BAE destination element file name );
The bae_plansfname function returns the destination file name of the currently loaded BAE element or an empty string if no element is currently loaded. This function should be used for element file name queries during operations.
Function bae_planfname.
double bae_planwslx( // Returns left workspace boundary (STD2) );
The bae_planwslx function returns the left (lower X) workspace boundary of the currently loaded BAE element.
double bae_planwsly( // Returns lower workspace boundary (STD2) );
The bae_planwsly function returns the lower (lower Y) workspace boundary of the currently loaded BAE element.
double bae_planwsnx( // Returns origin X coordinate (STD2) );
The bae_planwsnx function returns the origin X coordinate of the currently loaded BAE element.
double bae_planwsny( // Returns origin Y coordinate (STD2) );
The bae_planwsny function returns the origin Y coordinate of the currently loaded BAE element.
double bae_planwsux( // Returns right workspace boundary (STD2) );
The bae_planwsux function returns the right (upper X) workspace boundary of the currently loaded BAE element.
double bae_planwsuy( // Returns upper workspace boundary (STD2) );
The bae_planwsuy function returns the upper (upper Y) workspace boundary of the currently loaded BAE element.
int bae_popareachoice( // Returns status double [0.0,[; // From row number double [0.0,[; // From column number double [0.0,[; // To row number double [0.0,[; // To column number string; // Selection return string );
The bae_popareachoice function defines a rectangular selection field in the currently active popup menu area. The active popup menu area is selected with the bae_popsetarea function and can be either the standard popup menu area to be defined and/or displayed with bae_popshow or the toolbar menu area to be defined and/or displayed with bae_settbsize. The selection area is defined with the text row and column range function parameters, whereas row zero refers to the top of the popup area and column zero refers to the left of the popup area. The bae_tbsize function can be used to retrieve the current toolbar dimensions. The bae_charsize function can be utilized to convert text coordinates to standard length units. The selection return string parameter defines the answer string to be returned with the bae_readtext function on selections in the defined choice area. The function returns (-1) on missing and/or invalid parameter specifications, 1 if a button was created, or zero otherwise.
Functions bae_charsize, bae_popcolbar, bae_popcolchoice, bae_popsetarea, bae_popshow, bae_poptext, bae_poptextchoice, bae_readtext, bae_settbsize, bae_tbsize.
void bae_popcliparea( int [0,1]; // Clipping enable flag: // 0 = disable clipping // 1 = enable clipping double [0.0,[; // From row number double [0.0,[; // From column number double [0.0,[; // To row number double [0.0,[; // To column number );
The bae_popcliparea function enables (clipping enable flag nonzero) and/or disables (clipping enable flag zero) clipping in the currently active BAE popup menu area. The active popup menu area is selected with the bae_popsetarea function and can be either the standard popup menu area to be defined and/or displayed with bae_popshow or the toolbar menu area to be defined and/or displayed with bae_settbsize. Clipping is most useful for restricting graphic output to certain areas when displaying polygons in popup areas and/or toolbars using the bae_popdrawpoly function. The clipping area is defined with the text row and column range function parameters, whereas row zero refers to the top of the popup area and column zero refers to the left of the popup area. The bae_charsize function can be utilized to convert text coordinates to standard length units.
Functions bae_charsize, bae_popdrawpoly, bae_popsetarea, bae_popshow, bae_settbsize.
void bae_popclrtool( );
The bae_popclrtool function can be used to clear and/or deactivate all elements from the current toolbar area.
Functions bae_popsetarea, bae_settbsize.
int bae_popcolbar( // Returns nonzero on error double [0.0,[; // From row number double [0.0,[; // From column number double [0.0,[; // To row number double [0.0,[; // To column number int [0,[; // Color value (STD18) );
The bae_popcolbar function defines a non-selectable color bar in the popup menu previously activated by bae_popshow. The color bar size and position emerge from the specified row and column parameters with the zero coordinate [0,0] referring to the top left corner of the popup area. The color bar's color is specified with the given color value parameter. The function returns nonzero on invalid parameter specifications.
Functions bae_popcolchoice, bae_popshow, bae_poptext, bae_poptextchoice.
int bae_popcolchoice( // Returns nonzero on error double [0.0,[; // From row number double [0.0,[; // From column number double [0.0,[; // To row number double [0.0,[; // To column number int [0,[; // Color value (STD18) string; // Answer string to be returned );
The bae_popcolchoice function defines a mouse-selectable color bar in the popup menu previously activated by bae_popshow. The color bar size and position emerge from the specified row and column parameters with the zero coordinate [0,0] referring to the top left corner of the popup area. The color bar's color is specified with the given color value parameter. The function returns nonzero on invalid parameter specifications. The selection of a color bar defined with bae_popcolchoice can be enabled through a call to the bae_readtext function. The bae_readtext return value is then set to the bae_popcolchoice answer string parameter.
Functions bae_popcolbar, bae_popshow, bae_poptext, bae_poptextchoice, bae_readtext.
int bae_popdrawpoly( // Returns status int [0,[; // Polygon color (STD18) int [0,3]; // Polygon drawing mode (STD19) int [0,15]; // Polygon fill mode (STD20) );
The bae_popdrawpoly function draws the internal polygon defined with the bae_storepoint function to the currently active popup menu area using the color, drawing mode and filling properties specified with the corresponding function parameters. The active popup menu area is selected with the bae_popsetarea function and can be either the standard popup menu area to be defined and/or displayed with bae_popshow or the toolbar menu area to be defined and/or displayed with bae_settbsize. The polygon display can be restricted to a certain popup menu region using the bae_popcliparea function. The bae_popareachoice function can be utilized for allowing the polygon display or certain parts of it to be selected with the bae_readtext function. The bae_setpopdash function can be used to set the base length for dash lines. The bae_clearpoints function can be used to clear the internal polygon data to prepare for subsequent polygon definitions. The function returns zero if the polygon was drawn without errors or nonzero otherwise.
Functions bae_clearpoints, bae_dialbmpalloc, bae_popareachoice, bae_popcliparea, bae_popcolbar, bae_popcolchoice, bae_popdrawtext, bae_popsetarea, bae_popshow, bae_readtext, bae_setpopdash, bae_settbsize, bae_storepoint.
int bae_popdrawtext( // Returns status int; // Text row int; // Text column int [0,[; // Text display color (STD18) int [0,[; // Text background color (STD18) string; // Text string );
The bae_popdrawtext function displays the given text string at the specified row and column coordinates in the currently active popup menu area using the colors specified for text display and background. The active popup menu area is selected with the bae_popsetarea function and can be either the standard popup menu area to be defined and/or displayed with bae_popshow or the toolbar menu area to be defined and/or displayed with bae_settbsize. The bae_charsize function can be utilized to convert text coordinates to standard length units. The bae_popareachoice function can be utilized for allowing the text display or certain parts of it to be selected with the bae_readtext function. The function returns zero if the text was displayed without errors or nonzero otherwise.
Functions bae_charsize, bae_dialbmpalloc, bae_popareachoice, bae_popdrawpoly, bae_popsetarea, bae_popshow, bae_readtext, bae_settbsize.
void bae_popmouse( & double; // Returns mouse X coordinate/column & double; // Returns mouse Y coordinate/row & int; // Returns mouse state: // Bit 1 : Left mouse button pressed // Bit 2 : Right mouse button pressed // Bit 3 : Middle mouse button pressed );
The bae_wsmouse function retrieves the current mouse coordinates (column and row) with the popup and/or toolbar area. The mouse state return parameter can be used to designate which mouse buttons are currently pressed.
Function bae_wsmouse.
void bae_poprestore( );
The bae_poprestore function releases and restores the popup graphic work area previously defined with bae_popshow.
Function bae_popshow.
void bae_popsetarea(
int // Popup area code:
// 0 = Popup menu area
// 1 = Toolbar area
// 2..31 = Dialog bitmap area
);
The bae_popsetarea function activates the toolbar area (popup area code 1), the standard popup menu area (popup area code 2) or a dialog bitmap area (popup area code and/or popup bitmap number 2 through 31) for subsequent popup operations such as bae_popareachoice, bae_popcliparea, bae_popdrawpoly or bae_popdrawtext. The standard popup menu area is defined and/or displayed with the bae_popshow function. The toolbar popup menu area is defined and/or displayed with the bae_settbsize function. On default, the standard popup menu area is selected for popup operations.
Functions bae_dialbmpalloc, bae_popareachoice, bae_popcliparea, bae_popdrawpoly, bae_popdrawtext, bae_popshow, bae_settbsize.
int bae_popshow( // Returns nonzero on error & double [0.0,[; // Popup rows count & double [0.0,[; // Popup columns count & double [0,1.0]; // Popup percentage left boundary & double [0,1.0]; // Popup percentage bottom boundary & double [0,1.0]; // Popup percentage right boundary & double [0,1.0]; // Popup percentage top boundary );
The bae_popshow function defines and generates a popup menu with the given parameters. The popup menu position and size emerge from the specified popup boundary parameters; the given values are interpreted relatively to the available graphic work area size; the boundary values range from 0.0 (minimum and/or left/lower boundary) to 1.0 (maximum and/or right/upper boundary). The bae_mtpsize function can be used for determining the number of columns and/or rows available for popup display. The requested popup size is specified with the popup row and column count input parameters. These parameters are automatically re-calculated by bae_popshow to denote the row and column counts actually visible in the given popup area boundaries. The function returns nonzero on invalid and/or inconsistent parameter specifications. The popup menu colors for texts, background and frame are taken from the corresponding BAE setup menu color values stored with the bsetup utility program. The bae_popareachoice, bae_popcolbar, bae_popcolchoice, bae_popdrawpoly, bae_popdrawtext, bae_poptext and bae_poptextchoice functions can be used after calling bae_popshow to define selectable and non-selectable color bars, text buttons, graphic display and selection areas in the popup menu. The popup menu item selections can be enabled by calling the bae_readtext function.
The bae_poprestore function must be used to release and/or restore any graphic work area occupied by a popup menu.
Functions bae_mtpsize, bae_popareachoice, bae_popcliparea, bae_popcolbar, bae_popcolchoice, bae_popdrawpoly, bae_popdrawtext, bae_poprestore, bae_popsetarea, bae_poptext, bae_poptextchoice, bae_readtext, bae_settbsize, and BAE utility program bsetup.
int bae_poptext( // Returns nonzero on error double [0.0,[; // Text row number double [0.0,[; // Text column number string; // Text string );
The bae_poptext function defines a non-selectable text in the popup menu previously activated by bae_popshow. The text display position emerges from the specified row and column parameters with the zero coordinate [0,0] referring to the top left corner of the popup area. The text to be displayed is specified with the given text string parameter. The function returns nonzero on invalid parameter specifications.
Functions bae_popcolbar, bae_popcolchoice, bae_popshow, bae_poptextchoice.
int bae_poptextchoice( // Returns nonzero on error double [0.0,[; // Text row number double [0.0,[; // Text column number string; // Text string string; // Answer string to be returned );
The bae_poptextchoice function defines a mouse-selectable text in the popup menu previously activated by bae_popshow. The text display position emerges from the specified row and column parameters with the zero coordinate [0,0] referring to the top left corner of the popup area. The text to be displayed is specified with the given text string parameter. The function returns nonzero on invalid parameter specifications. The selection of a text button defined with bae_poptextchoice can be enabled through a call to the bae_readtext function. The bae_readtext return value is then set to the bae_poptextchoice answer string parameter.
Functions bae_popcolbar, bae_popcolchoice, bae_popshow, bae_poptext, bae_readtext.
void bae_postprocess( );
The bae_postprocess function runs a BAE postprocess on the currently loaded element. On layout level, the BAE postprocess forces a connectivity update and a design rule check.
string bae_progdir( // Returns BAE program directory path );
The bae_progdir function returns the currently valid BAE programs directory path name. This information is useful for accessing data in the BAE programs directory (e.g., system color tables, aperture tables, etc.).
void bae_prtdialog( string; // Message string );
The bae_prtdialog function displays the specified message string in the BAE status line.
Function perror.
int bae_querydist( // Returns status double; // Query X coordinate (STD2) double; // Query Y coordinate (STD2) & double; // Query distance return value (STD2) );
The bae_querydist gets the distance between the point specified through the X and Y coordinate parameters and the internal distance query polygon previously stored with the bae_storedistpoly function. The resulting distance is returned with the last function parameter. The distance value is positive for points outside the distance query polygon and negative for points inside the distance query polygon. The function returns zero if no error occurred or nonzero on error (missing distance query polygon).
Function bae_storedistpoly.
string bae_readedittext( // Returns answer string string; // Prompt string //!
prefix: Multiline text input/edit // otherwise: Single line text input string; // Default answer string int [0,[; // Maximum input string length );
The
bae_readedittext function activates a text edit dialog with the prompt string being displayed in the dialog title bar. A multiline edit window instead of a single-line text edit box is activated if the first prompt string character is a quotation mark
(!
).
The size of the dialog window can be changed if in multiline edit mode.
The text edit box contents is initialyzed with the specified default answer string. The edit dialog provides an
button for accepting the input and an
button for cancelling the text input operation. The maximum input/aswer string length is limited through the third function parameter.
causes the default answer string instead of the current edit text to be returned to the caller. The multiline text edit dialog provides additional buttons for loading contents from selectable input files into the text edit window
( ) and for saving the current edit text to output files
( ).
BAE Demo does not provide the option for saving the edit text and also deactivates the Windows context menu function for copying the edit text onto the clipboard.
Function bae_readtext.
string bae_readtext( // Returns answer string string; // Prompt string int; // Maximum input string length );
The bae_readtext function asks the user for a string value. The required interaction is indicated by the given prompt string. The user input string value is passed with the function return value. The maximum keyboard input string length is specified with the corresponding function parameter. Mouse click input text is returned if previously enabled with the bae_setmousetext function; such mouse click default text input is disabled through the bae_readtext call. Popup menu item selections are simultaneously enabled by bae_readtext if a popup menu was previously defined with the bae_popshow function and mouse click text input is disabled. Possible popup menu selections are defined through bae_popcolchoice and/or bae_poptextchoice. The function return value is retrieved from the corresponding answer string parameters.
The bae_readtext function deactivates all selection elements previously defined with bae_popcolchoice, bae_poptextchoice or bae_setmousetext.
Functions bae_popcolchoice, bae_popshow, bae_poptextchoice, bae_readedittext, bae_setmousetext.
int bae_redefmainmenu( // Returns status );
The bae_redefmainmenu function starts the (re)definition of the main menu of the currently active BAE module. The function returns (-1) on error or zero otherwise. After calling bae_redefmainmenu, the bae_defmenu (to be terminated with bae_endmenu) should be applied for defining the main menu entries. Then the bae_defselmenu (to be terminated with bae_endmenu) can be applied for configuring the submenus. Between bae_defmenu or bae_defselmenu calls and the call to bae_endmenu the bae_defmenutext function should be applied for defining the menu entries. The menu definition initiated with bae_redefmenu must be terminated by a call to the bae_endmainmenu function. The bae_resetmenuprog function can be used to reset all menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_defmenu, bae_defmenuprog, bae_defmenutext, bae_defselmenu, bae_endmainmenu, bae_endmenu, bae_redefmenu, bae_resetmenuprog.
int bae_redefmenu( // Returns status int [0,999]; // Menu number int [0,99]; // Menu line string; // Menu text int; // BAE menu function code (STD4) int; // Menu entry processing key: // 8000000h = always available // 7FFFFFFh = available for each element type // else = (combined) DDB class processing key );
The bae_redefmenu function assigns the specified menu text and the BAE menu function to the given menu entry. The menu number specifies the number of the main menu, whilst the menu line designates the position in the according submenu. The menu entry processing key activates ghost menu configurations. The processing key is a coded integer value as retrieved and/or defined using the bae_getclassbitfield and bae_getmenubitfield functions (the hex value 80000000h can be used to allow for application in any case). The function returns (-1) on error or zero otherwise. The bae_resetmenuprog function can be used to reset all menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_defmenuprog, bae_getclassbitfield, bae_getmenubitfield, bae_redefmenu, bae_resetmenuprog.
void bae_resetmenuprog( );
The bae_resetmenuprog function resets all key and menu assignments, thus restoring the default menu configuration of the currently active BAE module.
Functions bae_deffuncprog, bae_defkeyprog, bae_defmenu, bae_defmenuprog, bae_defmenutext, bae_defselmenu, bae_redefmainmenu, bae_redefmenu.
int bae_sendmsg( // Returns status string; // Message text string int [0,1]; // Send to projects members only flag );
The bae_sendmsg function is only available in BAE HighEnd. The function return value is nonzero if called outside BAE HighEnd or on invalid parameter specifications. bae_sendmsg sends the specified message string to the BAE HighEnd message system. The second parameter controls whether the message should be send to all other BAE modules started in the same session or only to those BAE program instances which are currently processing elements from the same DDB file. A BAE HighEnd session is started with a BAE call and includes any other BAE program instance subsequently started with the function from the BAE main menu or with the function from the Schematic Editor. Each BAE HighEnd module receiving a message automatically activates the User Language program named bae_msg. If bae_msg is not available, the system tries to start an interpreter-specific User Language program (scm_msg in the Schematic Editor, ged_msg in the Layout Editor, ar_msg in the Schematic Editor, etc.). The bae_getmsg function must be used in the *_msg User Language program to retrieve pending messages. Pending messages are only available during the execution of the *_msg User Language program, i.e., any message not retrieved by *_msg is lost. The message text string can be used to trigger certain actions in the destination program instances.
Function bae_getmsg.
int bae_setanglelock( // Returns status int [0,1]; // Required angle lock flag (STD9) );
The bae_setanglelock function sets the current BAE angle lock mode (0=angle unlocked, 1=angle locked). The function returns nonzero if an invalid angle lock flag value has been specified.
Function bae_getanglelock.
int bae_setbackgrid( // Returns status double [0.0,[; // Required X display grid (STD2) double [0.0,[; // Required Y display grid (STD2) );
The bae_setbackgrid function sets the BAE X/Y display grid values. Zero grid values refer to switched-off grids. The function returns nonzero, if invalid grid values are specified.
Function bae_getbackgrid.
int bae_setclipboard( // Returns status string; // Text string );
The bae_setclipboard function saves the specified text string to the Windows clipboard. The function returns zero if done, or nonzero on error.
int bae_setcolor( // Returns status int; // Display item type (SCM1|LAY9|ICD9) int; // Color value (STD18) );
The bae_setcolor function sets the color for the given display item type to the specified value. The display item type value must be set according to the currently active User Language Interpreter environment. The function returns nonzero on error.
To avoid redundant screen redraws at the color table redefinition, the bae_setcolor system function does not perform a screen redraw. I.e., it is the responsibility of the caller to trigger screen redraws as required at the end of a color table definition sequence.
Function bae_getcolor.
int bae_setcoorddisp( // Returns status int [0,1]; // Required coordinate display mode (STD7) );
The bae_setcoorddisp function sets the current BAE coordinate display mode. The display mode is passed with the parameter, where 0 designates mm display units (micrometer in IC Design) and 1 designates Inch display units (mil units in IC Design). The function returns nonzero for invalid display mode parameters or zero otherwise.
Function bae_getcoorddisp.
int bae_setdblpar( // Returns status int [0,[; // Parameter type/number: // 0 = maximum dialog box width // 1 = maximum dialog box height // 2 = display zoom factor // 3 = Rubberband corner radius (STD2) // 4 = Rubberband X vector coordinate (STD2) // 5 = Rubberband Y vector coordinate (STD2) // 6 = fixed X pick coordinate (STD2) // 7 = fixed Y pick coordinate (STD2) // [ 8 = System parameter - no write access ] // [ 9 = System parameter - no write access ] // 10 = Screen pick aperture (STD2) // 11 = Element selection preview area relative size [0.05, 0.95] // [ 12 = System parameter - no write access ] // [ 13 = System parameter - no write access ] double; // Parameter value );
The bae_setdblpar function is used to set Bartels AutoEngineer double system parameters. The function returns zero if the parameter assignment was successful, or (-1) otherwise. The bae_getdblpar function can be used to query parameter values set with bae_setdblpar.
Functions bae_getdblpar, bae_getintpar, bae_getstrpar, bae_setintpar, bae_setstrpar.
int bae_setgridlock( // Returns status int [0,1]; // Required grid lock flag (STD8) );
The bae_setgridlock function sets the current BAE grid lock mode (0=grid unlocked, 1=grid locked). The function returns nonzero if an invalid grid lock flag value was specified.
Function bae_getgridlock.
int bae_setgridmode( // Returns status int [0,255]; // Automatic gid setting mode: // 0x01: input grid = 0.25 × display grid // 0x02: input grid = 0.50 × display grid // 0x04: input grid = 1.00 × display grid // 0x08: input grid = 2.00 × display grid // 0x10: display grid = 0.25 × input grid // 0x20: display grid = 0.50 × input grid // 0x40: display grid = 1.00 × input grid // 0x80: display grid = 2.00 × input grid );
The bae_setgridmode function sets the BAE grid dependency mode. The function returns nonzero if an invalid grid dependency mode was specified.
Function bae_getgridmode.
int bae_setinpgrid( // Returns status double [0.0,[; // Required X input grid (STD2) double [0.0,[; // Required Y input grid (STD2) );
The bae_setinpgrid function sets the BAE X/Y input grid values. Zero grid values refer to switched-off grids. The function returns nonzero if invalid grid values are specified.
Function bae_getinpgrid.
int bae_setintpar( // Returns status int [0,[; // Parameter type/number: // 0 = Input coordinate range check mode: // 0 = range check enabled // 1 = range check disabled // 1 = Module change autosave mode: // 0 = autosave without prompt // 1 = prompt before autosave // 2 = Display disable mode: // 0 = display enabled check // 1 = display disabled // [ 3 = Menu/mouse mode: ] // [ system parameter write-protected ] // 4 = Workspace text color mode: // 0 = standard colors // 1 = inverted standard colors // 2 = workspace related colors // 5 = Load display mode: // 0 = display overview after load // 1 = handle load display in bae_load // 6 = File dialog view: // 0 = old BAE style file selection // 1 = Explorer style default view // 2 = Explorer style list view // 3 = Explorer style details // 4 = Explorer style small icons // 5 = Explorer style large icons // 6 = Use default style and size // 7 = Element selection box mode: // 0 = display name only // 1 = display name and date // 8 = Element selection sort mode: // 0|1 = sort by name // 2 = sort numerically // 3 = sort by date // 9 = Inverted placement visibility flag: // 0 = placed elements visible // 1 = unplaced elements visible // [ 10 = Last file system error: ] // [ system parameter write-protected ] // 11 = Command history disable flag: // 0 = Command history enabled // 1 = Command history disabled // 12 = Popup menu mouse warp mode: // 0 = No popup menu mouse warp // 1 = First popup menu entry mouse warp // 2 = Preselected menu entry mouse warp // +4 = Mouse position restore warp // +8 = Element pick position warp // 13 = Save disable flag: // 0 = save enabled // 1 = save disabled // 14 = Mouse rectangle min. size: // ]0,[ = min. rectangle size // 15 = Menu selection mouse info display flag: // 0 = no continuous info display // 1 = continuous info display // 16 = Next dialog box id // 17 = Last created tooltip id // 18 = Polygon drop count // 19 = Polygon check disabled flag: // 0 = Enable polygon check // 1 = Disable polygon check // 20 = Cursor key grid mode: // 0 = Input grid // 1 = Pixel grid // 21 = Unsaved plan flag // 22 = Element batch load mode: // 0 = no batch load // 1 = Batch load // 2 = batch load, restore zoom window // 23 = Grid lines display: // 0 = Dot grid // 1 = Line grid // 24 = Display mirroring flag // 25 = Input grid display flag // 26 = Mouse function repeat mode: // 0 = Repeat menu function // +1 = Repeat keystroke function // +2 = Repeat context menu function // [ 27 = Maximum Undo/Redo count: ] // [ system parameter write-protected ] // 28 = Menu tree view mode: // 0 = No menu tree view window // 1 = Left attached menu tree view window // 2 = Right attached menu tree view window // 29 = Menu tree view pixel width // 30 = Message history disabled flag // 31 = Element load message mode: // 0 = Standard message // 1 = User message // 2 = User error message // 32 = Pick marker display mode: // 0 = Circle marker // 1 = Diamond marker // 33 = Mouse drag status: // 0 = No mouse drag // 1 = Request mouse drag // 2 = Mouse dragged // 3 = Request mouse drag release // 34 = Menu function repeat request flag // 35 = Function aborted flag // 36 = Plan selection preview flag // 37 = File error display mode: // 0 = Status message only // 1 = Confirm message box // 38 = Element selection reference display mode: // 0 = Display project file references // 1 = Display library file references // 39 = Mouse double-click mode: // 0 = Map double-click and select 0 to right mouse button // 1 = Ignore double-click // 2 = Map double-click to right mouse button // 40 = Mouse pick double-click mode: // 0 = Map double-click to right mouse button // 1 = Ignore double-click // [ 41 = Dialog control support flags: ] // [ system parameter write-protected ] // 42 = Progress box display mode: // 0 = No progress box window // 1 = Display progress window // 43 = Progress box abort request flag: // 44 = Middle mouse button disable flag: // [ 45 = Current undo items count: ] // [ system parameter write-protected ] // [ 46 = File drag and drop operation flag.: ] // [ system parameter write-protected ] // 47 = Autoraise BAE window flag // [ 48 = Menu function active count ] // [ system parameter write-protected ] // [ 49 = Internal polygon list point count ] // [ system parameter write-protected ] // 50 = Alternate configuration file priority // 51 = Dialog position save mode: // 0 = Store absolute coordinates // 1 = Store main window relative coordinates // 2 = Store main window monitor absolute coordinates // 52 = Message box default button index: // (-1) = No default (Abort or No) // 0-2 = Default button index int; // Parameter value );
The bae_setintpar function is used to set Bartels AutoEngineer integer system parameters. The function returns zero if the parameter assignment was successful, or (-1) otherwise. The bae_getintpar function can be used to query parameter values set with bae_setintpar.
Functions bae_getdblpar, bae_getintpar, bae_getstrpar, bae_setdblpar, bae_setstrpar.
int bae_setmoduleid( // Status string; // Module id );
The bae_setmoduleid sets a name/identification for the currently active BAE program module. The function returns zero if the module id was successfully assigned or nonzero on error.
Function bae_getmoduleid.
int bae_setmousetext( // Returns nonzero on error string; // Answer text string to be returned );
The bae_setmousetext function enables the specified answer string to be the default mouse click return value for the next bae_readtext call. The next call to bae_readtext resets the mouse click default text.
Function bae_readtext.
int bae_setplanfname( // Returns status string; // BAE project file name );
The
bae_setplanfname function sets the BAE DDB project file name. The
.ddb
file name extension if a BAE project file name without file name extension is specified. The function returns zero if the BAE project file name was successfully assigned, 1 if parameter specifications are missing and/or invalid or 2 if a BAE project file name is already assigned through the currently loaded element.
Function bae_planfname.
void bae_setpopdash(
double ]0.0,[; // Dash base length (STD2)
double ]-0.5,0.5[; // Dash relative spacing
);
The bae_setpopdash function sets the base length and the relative spacing for dash lines to be created in popup menus and/or toolbars with the bae_popdrawpoly function.
Function bae_popdrawpoly.
int bae_setstrpar( // Returns status int [0,[; // Parameter type/number: // 0 = Current element comment text // 1 = Current element specification // [ 2 = System parameter - no write access ] // [ 3 = System parameter - no write access ] // 4 = Crosshair info text // 5 = Tooltip text // [ 6 = System parameter - no write access ] // 7 = Menu text of currently active funktion // 8 = Current menu item element text // 9 = Current element load user message // 10 = Clipboard text string // 11 = Next module call file argument // 12 = Next module call element argument // 13 = Next module call command/type argument // 14 = Last output file name // [ 15 = System parameter - no write access ] // 16 = Toolbar button character/resource item // [ 17 = System parameter - no write access ] // [ 18 = System parameter - no write access ] // 19 = Alternate configuration data directory // 20 = Local data column // 21 = Global data column string; // Parameter value );
The bae_setstrpar function is used to set Bartels AutoEngineer string system parameters. The function returns zero if the parameter assignment was successful, or (-1) otherwise. The bae_getstrpar function can be used to query parameter values set with bae_setstrpar.
Functions bae_getdblpar, bae_getintpar, bae_getstrpar, bae_setdblpar, bae_setintpar.
void bae_settbsize(
double [0.0,[; // Toolbar size
int [0,3]; // Toolbar attachment mode:
// 0 = horizontally attached to
// lower workspace boundary
// 1 = vertically attached to
// right workspace boundary
// 2 = horizontally attached to
// upper workspace boundary
// 3 = vertically attached to
// left workspace boundary
);
The bae_settbsize function defines and/or displays a toolbar. The first parameter specifies the desired toolbar size depending on the attachment mode, i.e., with vertical attachment the toolbar size is interpreted as column count, whilst with horizontal attachment the toolbar size is interpreted as row count. A zero toolbar size specification can be used to fade out a currently visible toolbar. The dimension of the graphic area available for displaying toolbars can be retrieved with the bae_mtpsize function. The bae_tbsize function can be used to retrieve the current toolbar dimensions. The bae_popsetarea function activates either the toolbar or the standard popup menu for subsequent popup operations. The bae_popclrtool function can be used to clear and/or deactivate all elements from the current toolbar area.
Functions bae_mtpsize, bae_popclrtool, bae_popsetarea, bae_tbsize.
int bae_storecmdbuf( // Returns status int [0,[; // Command store mode // 0 : append command to history string; // Command (sequence) string string; // Command notification text );
The bae_storecmdbuf function adds the specified command to the current BAE command history. The command store mode is used to specify the location for storing the command in the history and/or whether or how the command history should be reorganized. The command (sequence) string and the command notification text (as displayed in the title bar) are specified through the second and third function parameter. The function returns zero if the assignment was successful or non-zero otherwise.
Function bae_getcmdbuf.
int bae_storedistpoly( // Status );
The bae_storedistpoly function stores the internal polygon created with bae_clearpoints and bae_storepoint as distance query polygon. The bae_querydist can then be used to query the distance between a given point and the distance query polygon. The bae_cleardistpoly function can be used to delete the distance query polygon. The function returns zero if no error occurred, (-1) if the internal distance query polygon is already defined or (-2) in case of invalid polygon data.
Functions bae_cleardistpoly, bae_clearpoints, bae_querydist, bae_storepoint.
int bae_storeelem( // Returns status string; // File name string; // Element name );
The bae_storeelem function stores the currently loaded BAE element to the specified file (i.e., this function is equivalent to function from the menu). The function returns 0 if the element has been successfully stored, 1 on invalid function parameters, 2 if no BAE element is currently loaded or (-1) on file access errors.
void bae_storekeyiact( int [0,3]; // Automatic interaction mode (STD21) int; // Key character code (ASCII) );
The bae_storekeyiact function stores a key-press interaction to the interaction queue to be passed to a bae_callmenu-activated BAE menu function. The given key character code is automatically passed if the interaction flag is set, otherwise an interactive user input is required.
Functions bae_peekiact, bae_storemenuiact, bae_storemouseiact, bae_storetextiact.
void bae_storemenuiact( int [0,3]; // Automatic interaction mode (STD21) int; // Menu line number (0..n-1) int [1,3]; // Mouse key (STD17) );
The bae_storemenuiact function stores a menu interaction to the interaction queue to be passed to a bae_callmenu-activated BAE menu function. The given menu selection with mouse-click is passed automatically passed if the interaction flag is set, otherwise an interactive user input is required.
Functions bae_peekiact, bae_storekeyiact, bae_storemouseiact, bae_storetextiact.
void bae_storemouseiact( int [0,3]; // Automatic interaction mode (STD21) double; // Mouse X coordinate (STD2) double; // Mouse Y coordinate (STD2) int [0,15]; // Mouse coordinate mode: // 0 = use given coordinates with snap to input grid // 1 = use old mouse coordinates // 2 = use given coordinates gridless // +4 = set mouse pointer to specified position // +8 = activate BAE window int [0,3]; // Mouse key code (STD17) []; // Keyboard input );
The bae_storemouseiact function stores a mouse interaction to the interaction queue to be passed to a bae_callmenu-activated BAE menu function. The given positioning with mouse-click is automatically passed if the interaction flag is set, otherwise an interactive user input is required. A character must be passed to the keyboard input parameter if the mouse key code is set to zero.
Functions bae_callmenu, bae_peekiact, bae_storekeyiact, bae_storemenuiact, bae_storetextiact.
int bae_storepoint( // Returns status double; // Point X coordinate (STD2) double; // Point Y coordinate (STD2) int [0,2]; // Point type (STD15) );
The bae_storepoint function stores the specified point to the internal polygon point list. The function returns nonzero if invalid point parameters have been specified. The internal polygon point list is required for generating polygons or traces using the module-specific *_storepoly and/or *_storepath functions or the bae_storedistpoly function. The internal BAE polygon can be deleted/cleared with the bae_clearpoints function.
Functions bae_clearpoints, bae_getpolyrange, bae_storedistpoly.
void bae_storetextiact( int [0,3]; // Automatic interaction mode (STD21) string; // Input text string );
The bae_storetextiact function stores a text input interaction to the interaction queue to be passed to a bae_callmenu-activated BAE menu function. The given text string is automatically passed if the interaction flag is set, otherwise an interactive user input is required.
Functions bae_peekiact, bae_storekeyiact, bae_storemenuiact, bae_storemouseiact.
int bae_swconfig( // Returns software configuration code: // (-1) = invalid configuration class, // for configuration class 0: // 0 = unknown system // 1 = Bartels ACAD-PCB // 2 = BAE Professional // 3 = BAE HighEnd // for configuration class 1: // 0 = not BAE Demo software // 1 = BAE Demo software // 2 = BAE FabView software // for configuration class 2: // nonzero = BAE Economy software // for configuration class 3: // 0 = BAE standard menu screen // 1 = BAE Windows standard menu // 2 = BAE Windows pull-down menu // 3 = BAE Motif standard menu // 4 = BAE Motif pull-down menu // for configuration class 4: // nonzero = BAE Light software // for configuration class 5: // 0 = no BAE Schematics software // 1 = BAE Schematics // 2 = BAE HighEnd Schematics // for configuration class 6: // BAE version build number int; // Configuration class: // 0 = BAE software system query // 1 = BAE Demo software check // 2 = BAE Economy software check // 3 = BAE user interface type query // 4 = BAE Light software check // 5 = BAE Schematics software check // 6 = BAE version build number query );
The bae_swconfig function returns the currently active BAE software configuration. This information is required for performing correct menu selections using bae_defmenuprog, bae_callmenu and bae_store*iact calls in different software configurations such as BAE Professional, BAE HighEnd, BAE Economy and/or BAE Light, or in different user interfaces such as BAE standard user interface or BAE pull-down user interface under DOS/X11, Windows or Motif.
Function bae_swversion.
string bae_swversion( // Returns software version string // or operating system setting int; // Software version query mode: // 0 = BAE version number // 1 = BAE release year (formatYY
) // 2 = BAE release year (formatYYYY
) // 3 = Operating system specific // pattern for arbitrary string match // (e.g.,*
under Linux,.*
under MS-DOS) // 4 = Operating system specific // directory name delimiter // (e.g.,/
under Linux,\
under MS-DOS) );
The bae_swversion function returns BAE software version information or operating system specific BAE settings according to the specified software version query mode.
Function bae_swconfig.
void bae_tbsize( & double; // Returns toolbar text columns & double; // Returns toolbar text rows );
The bae_tbsize function retrieves the size of the toolbar area currently defined with the bae_settbsize function. The toolbar width is returned with the toolbar text columns parameter, whilst the toolbar height is returned with the toolbar text rows parameter. The bae_charsize function can be utilized to convert these values to standard length units.
Functions bae_charsize, bae_mtpsize, bae_settbsize.
void bae_twsize( & int; // Returns text column count & int; // Returns text row count );
The bae_twsize function determines the current size of the BAE text screen workarea. The text screen size is returned through the parameters, with the first parameter returning the text column count, and the second parameter returning the text row count. These functions are useful for dynamically adapting output routines to the BAE graphic environment.
Function bae_mtpsize.
double bae_wswinlx( // Left workspace window boundary (STD2) );
The bae_wswinlx function returns the left boundary coordinate of the currently visible workspace window.
double bae_wswinly( // Lower workspace window boundary (STD2) );
The bae_wswinly function returns the lower boundary coordinate of the currently visible workspace window.
double bae_wswinux( // Right workspace window boundary (STD2) );
The bae_wswinux function returns the right boundary coordinate of the currently visible workspace window.
double bae_wswinuy( // Upper workspace window boundary (STD2) );
The bae_wswinuy function returns the upper boundary coordinate of the currently visible workspace window.
void bae_wsmouse( & double; // Returns mouse X coordinate (STD2) & double; // Returns mouse Y coordinate (STD2) & int; // Returns mouse state: // Bit 0 : Beyond left workspace boundary // Bit 1 : Beyond right workspace boundary // Bit 2 : Beyond lower workspace boundary // Bit 3 : Beyond upper workspace boundary // Bit 4 : Left mouse button pressed // Bit 5 : Right mouse button pressed // Bit 6 : Middle mouse button pressed );
The bae_wsmouse function retrieves the current mouse coordinates within the graphic workarea. The mouse state return parameter can be used to designate which mouse buttons are currently pressed or whether the mouse coordinates exceed any of the workspace boundaries.
Function bae_popmouse.
void catext( & string; // File name string; // File name extension );
The catext function appends the specified file name extension to the file name provided with the first function parameter if that file name doesn't have this extension yet.
Function catextadv.
void catextadv( & string; // File name string; // File name extension int; // Extension mode: // 0 = Apply extension only if // no extension yet // 1 = Assume file name contains // none or specified extension // 2 = Force specified extension );
The catextadv function optionally appends the specified file name extension to the specified file name. The extension mode parameter control whether and/or under which circumstances the extension is appended.
Function catext.
double ceil( // Returns result value double; // Input value );
The ceil function calculates and returns the smallest "integer" greater than or equal to the specified input double value.
double clock( // Returns elapsed CPU time (seconds) );
The clock function returns (in seconds) the CPU time elapsed since the start of the currently active BAE program module. This value should be used only for comparison purposes.
void con_clear( );
The con_clear function deletes the net list data previously stored with con_storepart and/or con_storepin from main memory. con_clear should always be applied before the first call to con_storepart to avoid net list mix with previously stored net data. The con_clear function should also be called as soon as the net list data is not needed any more, e.g., after finishing a net list transformation since otherwise you might run short of main memory.
Functions con_storepart, con_storepin, con_write.
int con_compileloglib( // Returns status string; // DDB destination file name string; // Logical library definition file name string; // Logical library definition );
The
con_compileloglib function compiles the given logical library definition(s) and stores the compiled loglib definition(s) to the DDB destination file specified with the first function parameter. The logical library definition(s) must be provided according to the
loglib utility program input format specification.
con_compileloglib compiles either the logical library definition file specified with the second function parameter or the logical library definition passed through the third function parameter. The
NULL
keyword can be specified to ignore either of these parameters. The function returns zero if the compilation was successful or nonzero otherwise.
Functions con_compileloglib, con_getlogpart, lay_deflibname, scm_defloglname; BAE utility program loglib.
int con_deflogpart( // Returns status string; // DDB destination file name string; // Logical library part name string[]; // Physical library part name int [0,1]; // Default assignment flag );
The
con_deflogpart function stores the given logical library part definition to the name-specified DDB destination file. The defined assignment of a physical library part to a logical part is requested by the BAE
Packager for transferring logical to physical net lists. The library entry defined through
con_deflogpart is an 1-to-1 assignment, i.e., the
Packager does not perform any pin name transformations. Note that gates, pin/gate swaps, power supply pins or attribute assignments cannot be defined with
con_deflogpart. A virtual part assignment is defined if an empty string is specified for the physical library part name. Alternate package types are defined if a list of multiple strings is given for the physical library part name. The
$plname
attribute can be utilized for physical part name assignments if the default assignment flag is set. The function returns zero on successful library part definition, (-1) on missing and/or invalid parameters or (-2) on library file access errors.
Functions con_deflogpart, con_getlogpart; BAE utility program loglib.
int con_getddbpattrib( // Returns status string; // DDB file name string; // Part name string; // Pin name & string; // Attribut name // or empty string for plan name // or!
for first attribute // or!$attrname
for next attribute & string; // Attribute value );
The con_getddbpattrib function gets a part or pin attribute value from a DDB file. The function returns 1 if the attribute value has been found, zero if the attribute does not exist or (-1) on file access errors. Part attributes are searched if an empty pin name is specified; otherwise pin attributes are searched. The selected attribute name is returned with the attribute name function parameter if a placeholder (!
or!$attrname
) is specified for the attribute name.
Function con_setddbpattrib.
int con_getlogpart( // Returns status string; // LOGLIB DDB file name string; // Logical library part name int; // Output columns & string; // Returns logical library definition );
The con_getlogpart function extracts ASCII-formatted logical library part definition of the name-specified logical part. The function returns zero on successful part definition extraction, (-1) on missing and/or invalid parameters, (-2) if the DDB file is not available, (-3) if the logical library part is not available or (-4) on logical library part load errors. The LOGLIB DDB file name is supposed to be a job file name or the default Packager layout library name which can be determined using either the scm_defloglname or the lay_deflibname function.
Functions con_compileloglib, con_deflogpart, lay_deflibname, scm_defloglname; BAE utility program loglib.
int con_setddbpattrib( // Returns status string; // DDB file name string; // Part name string; // Pin name string; // Attribute name string; // Attribute value );
The con_setddbpattrib function sets a part or pin attribute value in the given DDB file. The function returns nonzero on error. The part name is required; the specified part must be defined in the net list of the given DDB file. The pin name is optional. The attribute value is considered a part attribute value if an empty string is specified for the pin name; otherwise, a pin attribute assignment is assumed. Neither part nor pin names can contain upper case letters. The attribute name must start with the percent sign ($
) and must not contain upper case letters. The attribute value can be an empty string for resetting previously assigned attribute values. Attribute value strings can be stored with a maximum length of up to 40 characters. ForPA_NILVAL
attribute value specifications, the attribute value assignment for the specified attribute is removed to mimic the behaviour of button in the Schematic Editor
Function con_getddbpattrib.
int con_storepart( // Returns status string; // Logical part name string; // Logical part library name );
The con_storepart function stores the given logical part to the internal logical net list kept in main memory. The function returns zero if the part has been successfully stored, (-1) on missing and/or invalid parameters or (-2) if the part is already defined. The internal logical net list can be written to a DDB file using the con_write function.
Main memory is allocated when using the con_store* functions. The con_clear function should be called as soon as the net data is not needed any more, or otherwise you might run short of main memory.
Functions con_clear, con_storepin, con_write.
int con_storepin( // Returns status string; // Logical part name string; // Logical part pin name string; // Net name );
The con_storepin function stores the given logical part pin to the internal logical net list kept in main memory. The corresponding part must be stored already with the con_storepart function. The pin is not connected if an empty string is specified for the net name; otherwise the pin is connected to the specified net. The net entry is automatically generated if no net with the given name exists. The function returns zero if the part pin has been successfully stored, (-1) on missing and/or invalid parameters, (-2) if the part is not yet defined, (-3) if the pin is already connected to the net list or (-4) on net list overflow. The internal logical net list can be written to a DDB file using the con_write function.
Main memory is allocated when using the con_store* functions. The con_clear function should be called as soon as the net data is not needed any more, or otherwise you might run short of main memory.
Functions con_clear, con_storepart, con_write.
int con_write( // Returns status string; // DDB file name string; // Net list element name );
The con_write function stores internal logical net list generated with the con_store* function to the specified net list element name in the given DDB file. con_write also deletes the internal logical net list from memory. The function returns zero if the net list has been successfully written, (-1) on missing and/or invalid parameters, (-2) if no internal net list data is available or (-3) on net list write errors. The net list format produced by con_write is identical to the format generated by the Schematic Editor of the Bartels AutoEngineer, i.e., the net lists generated with con_write can be transformed to the Bartels AutoEngineer layout system using the Packager.
The con_* functions provide powerful tools for transforming third party net lists to the Bartels AutoEngineer. It is strongly recommended to check destination files before storing net lists with the con_write function to avoid conflicts with other net list data already defined in the destination file.
Functions con_clear, con_storepart, con_storepin.
string convstring( // Returns converted string string; // Input string int; // Conversion mode: // 0 = Get file name without extension // 1 = Get file name without directory path // 2 = Get file name without extension and directory path );
The convstring function converts the input string according to the specified conversion mode and returns the converted string.
double cos( // Returns result value double; // Input angle value (STD3) );
The cos function calculates and returns the cosine value of the given angle value. The input angle value must be in radians.
double cosh( // Returns result value double; // Input angle value (STD3) );
The cosh function calculates and returns the hyperbolic cosine value of the given angle value. The input angle value must be in radians.
double cvtangle( // Returns angle value double; // Input angle value int [0,3]; // Input angle units int [0,3]; // Output angle units );
The cvtangle function converts the specified angle value from input units to output units and returns the resulting angle value. Valid input/output angle unit codes are 0 for internal units (radians, STD3), 1 for degree units (180/pi radians), 2 for radians (STD3) or 3 for grad units (200/pi radians).
double cvtlength( // Returns length value double; // Input length value int [0,4]; // Input length units int [0,4]; // Output length units );
The cvtlength function converts the specified length value from input units to output units and returns the resulting length value. Valid input/output length unit codes are 0 for internal units (meter, STD2), 1 for inch units, 2 for millimeter units (mm), 3 for mil units (1/1000 inch) or 4 for micrometer units (um).
int ddbcheck( // Returns query status string; // DDB file name int; // DDB element class (STD1) // or (-1) for valid DDB file check string; // Element name or empty string for any class element check );
The ddbcheck function checks whether an element with the specified DDB class and element name exists in the DDB file specified with the DDB file name parameter. If (-1) is specified instead of a valid DDB class code, then ddbcheck only checks whether the specified file is a DDB file. If an empty element name string is specified, then ddbcheck only checks whether the DDB file contains any element of the specified DDB class. The function returns zero if the DDB object was found and/or accessible or (-1) otherwise.
Functions ddbclassscan, ddbelemrefcount, ddbelemrefentry,
string ddbclassid( // Returns DDB class identifier or empty string int ]0,[; // DDB element class (STD1) );
The ddbclassid function returns the DDB class identifier for the specified DDB class code. An empty string is returned on invalid/unknown DDB class specifications.
int ddbclassscan( // Returns scan status string; // DDB file name int ]0,[; // Element class code (STD1) * int; // Element name callback function );
The ddbclassscan function scans all elements matching the specified DDB class in the given DDB file. A user-defined callback function (see below) is automatically activated for each element scanned, unless the keyword
NULL
is specified for the corresponding parameter. The function returns either the number of scanned elements or (-1) on invalid parameter specifications and/or errors from the callback function.Element name callback function definition
int callbackfunction( // Continue scan request flag string ename // Element name ) { // Element name callback function statements : return(scanstatus); }The element name callback function return value should be 1 for scan continue request, 0 for scan stop request or (-1) on error.
Functions ddbcheck, ddbelemrefcount, ddbelemrefentry.
int ddbcopyelem( // Returns status string; // DDB source file name string; // DDB destination file name int ]0,[; // DDB database class code (STD1) string; // DDB element name int [0,1]; // Delete allowed (merge source) flag: // 0 = do not overwrite existing // elements in destination file // 1 = allow overwriting of existing // elements in destination file );
The ddbcopyelem function copies the named DDB element of the specified DDB database class from the DDB source file to the DDB destination file. The DDB element name is preserved during the copy, i.e., the source and destination files must be different. The copy includes all dependent and/or referenced elements of the selected DDB element. The merge source switch parameter designates whether existing elements in the destination file can be overwritten (merge source; source file is master) or not (merge destination; destination file is master). The function returns zero if the copy operation was successful or (-1) otherwise (invalid/missing parameters or DDB file access failure).
The ddbcopyelem function is not subject to the facility since it works on DDB file level. It is strongly recommended to use this function with care to prevent from unintentionally overwriting BAE design and/or system data.
Functions ddbdelelem, ddbrenameelem.
int ddbdelelem( // Returns status string; // DDB file name int ]0,[; // DDB database class code (STD1) string; // DDB element name );
The ddbdelelem function deletes the named DDB file element of the specified DDB database class code from the given DDB file. The function returns zero if the delete operation was successful or (-1) otherwise (invalid/missing parameters or DDB file access failure).
The ddbdelelem function is not subject to the facility since it works on DDB file level. It is strongly recommended to use this function with care to prevent from unintentionally deleting BAE design and/or system data.
Functions ddbcopyelem, ddbrenameelem.
int ddbelemrefcount( // Returns reference count or (-1) string; // DDB file name int ]0,[; // DDB database class code (STD1) string; // DDB element name );
The ddbelemrefcount function retrieves the number of library elements referenced by the specified DDB element. The DDB element is specified with the corresponding DDB file name, DDB class code and element name function parameters. The function returns (-1) if the specified DDB element does not exist or cannot be accessed. The ddbelemrefentry function can be used to retrieve the DDB database class codes and the element names of selected library references of a DDB element.
Functions ddbelemcheck, ddbclassscan, ddbelemrefentry.
int ddbelemrefentry( // Returns reference count or (-1) string; // DDB file name int ]0,[; // DDB database class code (STD1) string; // DDB element name int ]0,[; // Reference entry list index & int ]0,[; // Reference entry DDB database class code (STD1) & string; // Reference entry name );
The ddbelemrefentry function retrieves the DDB database class code and the element name of the library element referenced by the DDB element specified with the DDB file name, DDB database class code and element name function parameters. The reference entry to be queried is specified with the reference list index parameter. The ddbelemrefcount function can be used to retrieve the number of DDB element library reference entries. This value also designates the valid reference list index range to be specified for selecting a specific DDB element reference entry. The function returns zero if the query was successful or (-1) otherwise.
Functions ddbcheck, ddbclassscan, ddbelemrefcount.
int ddbgetelemcomment( // Returns status string; // DDB file name int ]0,[, // DDB database class (STD1) string; // DDB element name & string; // Returns comment string );
The ddbgetelemcomment function is used to query DDB file element comments which have been assigned with the ddbsetelemcomment function. The functions returns zero if the query was successful or (-1) otherwise (missing/invalid parameters or DDB access failure).
Function ddbsetelemcomment.
int ddbgetlaypartpin( // Returns status: // ( 0) = no error, pin query successful // (-1) = DDB file access error // (-2) = Invalid parameters // (-3) = Layout part symbol not found // (-4) = Pin not defined string; // DDB file name string; // Layout part symbol name int [0,[; // Pin index & string; // Pin name & string; // Pin symbol name & double; // Pin X position (STD2) & double; // Pin Y position (STD2) & double; // Pin rotation angle (STD3) & int; // Pin mirror mode (STD14) );
The ddbgetlaypartpin function can be used to query layout part symbol pin information on DDB file level. Repetitive function calls with incremented pin index and the pin not defined return value as abort criteria can be applied for iterating all pins of an existing layout part symbol.
Functions ddbcheck, ddbclassscan, ddbelemrefcount, ddbelemrefentry.
int ddbrenameelem( // Returns status string; // DDB file name int ]0,[, // DDB database class (STD1) string; // Old DDB element name string; // New DDB element name );
The ddbrenameelem changes the element name of the specified DDB file element. The function returns zero if the rename operation was successful or (-1) otherwise (invalid/missing parameters or DDB file access failure).
The ddbrenameelem function is not subject to the facility since it works on DDB file level. It is strongly recommended to use this function with care to prevent from unintentionally renaming BAE design and/or system data.
Functions ddbcopyelem, ddbdelelem.
int ddbsetelemcomment( // Returns status string; // DDB file name int ]0,[, // DDB database class (STD1) string; // DDB element name string; // Comment string );
The ddbsetelemcomment function can be used to assign comment texts to DDB file elements for subsequent queries with the ddbgetelemcomment function. The functions returns zero if the assignement was successful or (-1) otherwise (missing/invalid parameters or DDB access failure). ddbsetelemcomment sets DDB element comments not only in DDB files but also in main memory if the processed DDB element is currently loaded in the Bartels AutoEngineer.
Function ddbgetelemcomment.
int ddbupdtime( // Returns status string; // Input DDB file name int [100,[; // Input DDB element class code (STD1) string; // Input DDB element name & int; // Returns update time seconds & int; // Returns update time minutes & int; // Returns update time hours & int; // Returns update time days & int; // Returns update time months & int; // Returns update time year );
The ddbupdtime function gets the date and time of the last change performed on the specified DDB file element. The function returns 1 on success, 0 if the DDB file element has not been found or (-1) on file access error or invalid parameters.
int dirscan( // Returns scan status string; // Directory path name string; // File name extension: //.EXT
= denotes extension //.*
= all files/subdirectories * int; // File name callback function );
The dirscan function scans the specified directory for all file and/or subdirectory names matching the file name extension. A user-defined callback function (see below) is activated automatically for each file name scanned, unless the keywordNULL
is specified for the corresponding parameter. The function returns either the number of scanned file names or (-1) on invalid parameter specifications and/or errors from the callback function.File name callback function
int callbackfunction( // Continue scan request flag string fname // File name ) { // File name callback function statements : return(scanstatus); }The file name callback function return value should be 1 for scan continue request, 0 for scan stop request, or (-1) on error.
int existddbelem( // Returns status string; // Input DDB file name int [100,[; // Input DDB element class code (STD1) string; // Input DDB element name );
The existddbelem function checks if the specified DDB file element exists. The function returns 1 if the DDB file element has been found, 0 if the DDB file element has not been found or (-1) on file access error or invalid parameters.
void exit( int; // Return status );
The exit function terminates the currently active User Language program immediately and passes the specified status code to the program caller.
The return status is not evaluated by the Bartels User Language Interpreter.
Function ulsystem_exit.
double exp( // Returns result value double; // Input value );
The exp function calculates and returns the exponential value of the given input value.
double fabs( // Returns result value double; // Input value );
The fabs function calculates and returns the absolute value of the given double value.
int fclose( // Returns status int; // File handle );
The fclose function closes the file specified with the given file handle. The function returns nonzero on file close errors.
int fcloseall( // Returns status );
The fcloseall function closes all files opened by the currently active User Language program. The function returns nonzero on file close errors.
int feof( // Returns status int; // File handle );
The feof function checks if the end of the file specified with the given file handle is reached. The function returns nonzero on end-of-file or zero otherwise.
int fgetc( // Returns character code (or -1 if EOF) int; // File handle );
The fgetc function reads the next character from the file specified with the given file handle. The fucntion returns the read character code on success or (-1) on file read errors or end-of-file (these states should be distinguished with the feof function; the file function error handling mode must be set accordingly with the fseterrmode function).
int fgets( // Returns status & string; // Returns text string int; // Maximum text string length int; // File handle );
The fgetc function reads the next line of text from the file specified with the given file handle. Reading stops after a newline character is encountered or if the number of characters stored to the result string exceeds the maximum text string length. The return value is nonzero on file read errors or end-of-file (these states should be distinguished with the feof function; the file functions error handling mode must be set accordingly with the fseterrmode function).
int filemode( // Return file name string; // File name );
The filemode return the access mode of the specified file. The return value is 0 for write access, 1 for read-only access, or (-1) on file access failure.
Functions filesize, filetype.
int filesize( // File size in bytes or (-1) on error string; // File name );
The filesize function returns the size of the specified file in bytes or (-1) on file access failure.
Functions filemode, filetype.
int filetype( // Returns file type: // (-1) = file access failure // ( 0) = directory // ( 1) = regular file // ( 2) = character mode file string; // File name );
The filetype function returns the type of the specified file or (-1) if file access failure.
Functions filemode, filesize.
double floor( // Returns result value double; // Input value );
The floor function calculates and returns the largest "integer" not greater than the specified input double value.
double fmod( // Returns result value double; // Dividend double; // Divisor );
The fmod function calculates and returns the floating point remainder of the division of the two input values. The result value has the same sign like the dividend. If the division result cannot be represented, the result value is undefined.
int fopen( // Returns status string; // File name int [0,14]; // File access mode: // 0 =r
read (the only valid BAE Demo mode without|8
) // 1 =w
write // 2 =a
append // 3 =rb
read binary // 4 =wb
write binary // 5 =ab
append binary // |8 = autoclose (for BAE Demo write tests) );
The fopen function opens the file with the specified file name and provides the required file access. The file access mode is 0 for file read access, 1 for file write access or 2 for file append access. On write access, the file is generated if it does not yet exist. The function returns (-1) on file open errors; on success, the return value is the file handle to be used for subsequent file access functions.
When used in BAE Demo software configurations, fopen allows for file read access only.
int fprintf( // Returns status int; // File handle string; // Format string [] // Output parameter list );
The fprintf function writes the data contained in the output parameter list to the file specified with the file handle. The format string contains information on how to format the output. The function returns nonzero on file write errors or zero otherwise.
Format string
The format string transforms the subsequent parameter values and performs a formatted output according to the format control information specified with the format string. The format string can contain normal characters and format elements. Normal character sequences are written unchanged whilst a format element causes transformation and formatted output of the next unprocessed output parameter value. Each format element starts with the percent sign
%
and is delimited by a format control character. The following table lists the valid format control characters for output data type specifications:
Character Output Data Type d
Decimal integer format o
Octal integer format x
Hexadecimal integer format (lowercase) X
Hexadecimal integer format (uppercase) u
Unsigned decimal integer format c
Character format s
String format e
Scientific floating point format (lowercase) E
Scientific floating point format (uppercase) f
Fixed floating point format g
e
orf
, with shorter form to be usedG
E
orf
, with shorter form to be used%
Print percent sign %
The following output format specifications can be used between the percent sign and the format control character (n = numeric value):
Character Output Format -
left justify (default: right justify) +
sign output with positive numeric values SPACE
blank output with positive numeric values #
octal output with leading 0
or hexadecimal output with leading0x
or0X
or output with decimal point fore
,E
,f
,g
,G
or zeros after decimal point forg
,G
n
fieldwidth; i.e., minimum output length .n
precision; i.e., length of output string (with s
)
or number of digits after decimal point (withf
,g
,G
)l
long int decimal format (with d
,o
,x
,X
)With
e
,E
,f
,g
andG
, six digits after the decimal point are printed on default. If the*
character appears instead of the fieldwidth or precision specification then the corresponding value is taken from the next unprocessed function parameter. A percent sign can be printed by specifying%%
. Control characters delimited by a backslash (\
) are treated like normal characters.
The number and types of the parameter values passed to fprintf must match the number of percent sign / format control character pairs specified with the format stringl; otherwise garbage might be printed.
Functions printf, sprintf.
int fputc( // Returns status char; // Character int; // File handle );
The fputc function writes the given character to the file specified with the file handle. The function returns nonzero on file write error or zero otherwise.
int fputs( // Returns status string; // String int; // File handle );
The fputs function writes the given string to the file specified with the file handle. The function returns nonzero on file write error or zero otherwise.
double frexp( // Returns fraction value double; // Input value & int; // Returns exponent value );
The frexp function breaks the input double value fraction and exponent and returns the calculated fraction value; the exponent is returned with the second parameter.
int fseterrmode( // Returns status int [0,1]; // Error handling mode );
The fseterrmode function sets the file functions error handling mode. The file error mode 1 causes the interpreter environment to handle file errors. The file error mode 0 leaves the User Language program with the file error handle task. The initial file error handling mode on User Language program calls is 1.
The file error handling mode should be set to 0, when using the functions fgetc and/or fgets. Otherwise a User Language program might fault with file read errors when reaching end-of-file (see also functions fgetc, fgets).
void get_date( & int; // Returns day of the month (1..31) & int; // Returns month of the year (0..11) & int; // Returns year since 1900 );
The get_date function returns with its parameters the current system date.
void get_time( & int; // Returns hours since midnight (0..23) & int; // Returns minutes after hour (0..59) & int; // Returns seconds after minute (0..59) );
The get_time function returns with its parameters the current system time.
char getchr( // Returns character );
The getchr function activates a character input request (from keyboard) and returns the input character value.
string getcwd( // Returns path name );
The getcwd function returns the path name of the current working directory.
int getenv( // Returns status string; // Variable name & string; // Variable value );
The getenv function searches the environment variable list for an entry matching the specified variable name and returns the variable value with the corresponding parameter. The function returns zero if the variable is defined or nonzero otherwise (in which case the variable value parameter is left unchanged).
Function putenv.
int getextprog( // Returns status string; // File name extension & string; // Command string );
The getextprog gets the application command string for opening file types with the specified file name extension. The function returns zero if the query was successful or (-1) if no application/command was found for the specified file name extension.
int getstr( // Returns status & string; // Returns text string int; // Maximum text string length );
The getstr function activates a string input request (from keyboard). Input characters are stored to the return text string parameter until the return/enter keykey is pressed or the maximum text string length is reached. The function returns nonzero if invalid parameters have been specified.
int isalnum( // Returns boolean test result char; // Input character );
The isalnum function returns nonzero if the input character is alphanumeric or zero otherwise.
int isalpha( // Returns boolean test result char; // Input character );
The isalpha function returns nonzero if the input character is alphabetic or zero otherwise.
int iscntrl( // Returns boolean test result char; // Input character );
The iscntrl function returns nonzero if the input character is a control character or zero otherwise.
int isdigit( // Returns boolean test result char; // Input character );
The isdigit function returns nonzero if the input character is numeric or zero otherwise.
int isgraph( // Returns boolean test result char; // Input character );
The isgraph function returns nonzero if the input character is visible or zero otherwise.
int islower( // Returns boolean test result char; // Input character );
The islower function returns nonzero if the input character is lowercase alphabetic or zero otherwise.
int isprint( // Returns boolean test result char; // Input character );
The isprint function returns nonzero if the input character is a printing character (including space) or zero otherwise.
int ispunct( // Returns boolean test result char; // Input character );
The ispunct function returns nonzero if the input character is a punctuation character (i.e., a printing character that is not a digit, letter or space) or zero otherwise.
int isspace( // Returns boolean test result char; // Input character );
The isspace function returns nonzero if the input character is a whitespace character (i.e., a space ' ', a form feed\f
, a horizontal tab\t
, a newline\n
, a carriage return\r
or a vertical tab\v
) or zero otherwise.
int isupper( // Returns boolean test result char; // Input character );
The isupper function returns nonzero if the input character is uppercase alphabetic or zero otherwise.
int isxdigit( // Returns boolean test result char; // Input character );
The isxdigit function returns nonzero if the input character is hexadecimal numeric or zero otherwise.
int kbhit( // Keyboard state );
The kbhit function returns the current state of the keyboard input. A zero value is returned if no key was pressed. A nonzero return value signals a key was pressed. The key code remains in the keyboard input buffer and can be read with getchr or other keyboard input functions.
Function kbstate.
int kbstate( // Keyboard state (bit values): // 0x***1 = Shift pressed // 0x***2 = Ctrl pressed // 0x**1* = Left Alt key pressed // 0x**2* = Right Alt key pressed );
The kbstate function can be used to check whether Shift, Ctrl and/or Alt keys are currently pressed.
Function kbhit.
int launch( // Startup status string; // Command string );
The launch function activates and/or executes the command specified in the command string parameter. The command is used to start and/or execute an application, and control is regained by BAE immediately after passing the command to the Windows operating system (the called application runs independentely from BAE). The function returns zero if the command was successfully launched or nonzero otherwise.
The launch function does not work in BAE Demo software configurations.
Executing MS-DOS (child) processes through the DOS Extender requires enough conventional memory to be available for running the executable. Conventional memory must be controlled with the
-MINREAL
and-MAXREAL
variables of the Phar Lap 386|DOS Extender. For running User Language programs using the launch function, the corresponding User Language Interpreter environments must be re-configured by applying Phar Lap's redistributed CFIG386 tool as in> cfig386 <EXEFILE> -maxreal 0ffffhwhere
<EXEFILE>
must be set to the appropriate User Language Interpreter executable(s) (scm.exe
,ged.exe
,neurrut.exe
,cam.exe
,gerview.exe
and/orced.exe
).
Note that the launch function introduces basic multi-processing/multi-tasking features which are not fully supported on PC-based systems or can cause some problems on network-based workstation systems (depending on whichever OS command is to be executed).
It is strongly recommended to redirect DOS command standard output to temporary files (and use some file view User Language function for display); otherwise DOS standard output overwrites the BAE graphic user interface.
Erroneous DOS command calls cause error output to the screen, thus overwriting the BAE graphic interface. Due to the fact that DOS lacks from some substantial standard features such as redirect error output, this problem can only be solved by refraining and/or preventing from running erroneous DOS commands, e.g., by pre-checking the consistency of each DOS command to be called.
It is strongly recommended to refrain and/or prevent from calling interactive DOS commands and/or application software with the launch function since otherwise the system will "hang up" due to the fact that DOS standard input cannot be redirected from the BAE graphic user interface. It is also strongly recommended to refrain and/or prevent from directly calling UNIX commands which expect some user input (such as
more
,vi
, etc.); this problem can be solved by a command cast to background (&) command shell start where the desired command should be called from (which however might cause a terminal device connection problem under remote login).
Function system.
double ldexp( // Returns result value double; // Input value & int; // Exponent );
The ldexp function calculates and returns the result of (input double value) multiplied with (2 power exponent value).
double localtime( // Returns elapsed CPU time (in seconds) & int; // Returns seconds after minute (0..59) & int; // Returns minutes after hour (0..59) & int; // Returns hours since midnight (0..23) & int; // Returns day of month (1..31) & int; // Returns month of year (0..11) & int; // Returns years since 1900 & int; // Returns days since Sunday (0..6) & int; // Returns days of year (0..365) );
The localtime functions returns with its parameters the system time and date (including weekday and day of year). The function returns the elapsed CPU time (in seconds).
double log( // Returns result value double ]0.0,[; // Input value );
The log function calculates and returns the natural logarithm (base e) for the given non-negative input double value.
double log10( // Returns result value double ]0.0,[; // Input value );
The log function calculates and returns the common logarithm (base ten) for the given non-negative input double value.
int mkdir( // Returns status string; // Directory path name );
The mkdir creates a directory with the specified directory path name. The functions returns zero if the directory was successfully created or (-1) if the creation of the directory failed due to missing or wrong parameters or directory access error.
double modf( // Returns fractional value double; // Input value & double; // Returns integer value );
The modf function breaks the given input double value into integer and fractional parts. The resulting "integer" value is passed with the second parameter. The resulting fractional part is passed with the function return value.
int namestrcmp( // Returns comparison result string; // First name string; // Second name );
The namestrcmp function compares the specified input strings. A case-insensitive character-by-character alphanumeric comparison is applied. The function returns zero if the strings are equal, (-1) if the first string is smaller than the second string, or 1 if the first string is greater than the second string.
Functions numstrcmp, strcmp.
int numstrcmp( // Returns comparison result string; // First input string string; // Second input string );
The numstrcmp function compares the specified input strings. The function returns zero if the strings are equal, (-1) if the first string is smaller than the second string or 1 otherwise. numstrcmp operates like the strcmp function unless for numeric parts of the compare strings for which numeric comparison is applied. I.e., this results in sequences such as R1, R2, ..., R10, R11 (instead of R1, R10, R11, ..., R2).
Functions namestrcmp, strcmp.
void perror( string; // Message string );
The perror function displays the specified message string in the status line of the BAE user interface. The status line display is inverted for a short moment (single blink effect) to attract the user's attention. The status line is cleared if an empty message string is passed to the function.
Function bae_prtdialog.
double pow( // Returns result value double; // Base input value double; // Exponent input value );
The pow function calculates and returns the value of (base input value) power (exponent input value).
void printf( string; // Format string [] // Parameter list );
The fprintf function writes the data contained in the output parameter list to the BAE text output workarea. The format string contains information on how to format the output (see also description of the fprintf function).
Functions fprintf, sprintf.
string programid( // Returns program name );
The programid function returns the name of the currently active User Language program.
int putchr( // Returns status char; // Character );
The putchr function writes the specified character to the BAE text output workarea. The function returns nonzero on error.
int putenv( // Returns status string; // Variable name string; // Variable value );
The putenv function assigns a value to the specified operating system environment variable. The function returns zero if the assignment was successfull or (-1) if the variable was not found.
Function getenv.
int puts( // Returns status string; // String );
The puts function writes the specified string to the BAE text output workarea and appends a newline. The function returns nonzero on error.
int putstr( // Returns status string; // String );
The puts function writes the specified string to the BAE text output workarea. The function returns nonzero on error.
int quicksort( // Returns status & void; // Index list (integer array) int; // Index count * int; // Element compare function );
The quicksort function sorts the specified index list. The return value is 0 if the list was successfully sorted, or (-1) on error.Element compare callback function
int sortfuncname( int idx1, // Index 1 int idx2, // Index 2 ) { // Compare index 1 to index 2 : return(compareresult); }The return value of the element compare function must be (-1) if the first index is smaller than the second index, 1 if the first index is greater than the second index, or 0 if both index values are equeal.
int remove( // Returns status string; // Path name );
The remove function deletes the file or directory with the specified path name. The function returns nonzero on error.
int rename( // Returns status string; // Old file name string; // New file name );
The rename function changes the name of a file. The function returns nonzero on error.
void rewind( int; // File handle );
The rewind function sets the file pointer of the file specified with the given file handle to the beginning of this file.
int rulecompile( // Returns status string; // Destination file name string; // Rule name string; // Rule code );
The rulecompile function compiles the specified rule code and saves the compiled rule with the given name to the destination file. The function returns zero on success or non-zero on error.
Function rulesource.
int rulesource( // Returns status string; // Rule database file name string; // Rule name & string; // Rule source code );
The rulesource function retrieves the source code for the named rule definition from the specified rule database file. The rule definition source code is returned as string through the corresponding function parameter. The functions returns zero if the query was successful, (-1) if parameters are missing or invalid, (-2) if the rule database access failed, (-3) if the rule definition wasn't found or (-5) if the rule definition access failed.
Function rulecompile.
int scanddbenames( // Returns scan status string; // DDB file name int [0,[; // DDB element class (STD1) or zero for cache flush & string; // Input/output element name );
The scanddbenames function scans the DDB file element following the one specified (the name of the scanned element is passed with the element name parameter). The first DDB file element is scanned if the input element name is an empty string. The scan works only in the specified DDB element class. The function returns 1 if an element has been found, 0 if no next element has been found or (-1) on DDB file access errors or invalid parameters.
int scandirfnames( // Returns scan status string; // Directory path name string; // Name extension: //.EXT
= extension .EXT //.*
= all files/subdirectories & string; // Input/output name );
The scandirfnames function scans the specified directory for the file or directory name entry following the input name specification; the name of the scanned file or directory is passed with the output file name parameter. The first directory name entry is scanned on empty string name input. The scan works only in the specified extension match. The function returns 1 if a name entry has been found, 0 if no next name entry has been found or (-1) on directory access errors or invalid parameters.
void setprio( int; // Process priority value // - Unix/Linux: //nice
priority value // - Windows: // <0 =HIGH_PRIORITY_CLASS
// 0 =NORMAL_PRIORITY_CLASS
// >0 =IDLE_PRIORITY_CLASS
// - otherwise ignored );
The setprio function sets the priority of the current BAE process according to the specified process priority value.
double sin( // Returns result value double; // Input angle value (STD3) );
The sin function calculates and returns the sine value of the given angle value. The input angle value must be in radians.
double sinh( // Returns result value double; // Input angle value (STD3) );
The sinh function calculates and returns the hyperbolic sine value of the given angle value. The input angle value must be in radians.
int sprintf( // Returns decoded character count & string; // Output string string; // Format string string; // Format string [] // Parameter list );
The sprintf function writes the data contained in the output parameter list to the output string, i.e., sprintf performs a format conversion in memory. The format string contains information on how to format the output (see also the description of the fprintf function). The function returns the number of successfully decoded characters, i.e., the length of the resulting output string.
Functions fprintf, printf.
int sqlcmd( // Returns status string; // Database file name string; // SQL command * int; // Data return function );
The sqlcmd function is used to control the data transfer from and to a relational database system initialized with sqlinit. This is done via a SQL like query language. The first parameter of the function sqlcmd specifies the name of the database file to be opened for usage. The second parameter specifies the SQL command to be executed for database access. The selected data fields are returned to the caller via the data callback function specified with the third parameter. If no data callback function is used the third function parameter should be set to
NULL
. The function returns nonzero on missing or invalid parameters or on SQL database errors. In case of a database error, the exact error reason can be determined by the sqlerr function.SQL Commands
The database query language interpreted by sqlcmd is a restricted subset of the Structured Query Language (SQL) for relational databases. The following basic commands are supported:
create table
drop table
insert into table values
quickinsert into table values
index table
select from table
delete from table
help
The following data types are supported for the representation of data:
Keyword Data Type integer
Integer values in range [-2147483648, 2147483647] float
Float values in range [-10^308, 10^308] with a precision of about 15 leading digits string
Strings (enclosed with apostrophes) boolean
Logical value ( FALSE
orTRUE
)date
Date; on input dd/mm/yyyy
, on outputyyyymmdd
Command
create table
The
create
command generates a database table structure. The command requires a table name and a list of field names and corresponding data types. The field name sequence defined with this list is used for data field output unless an explicit output field order is specified. The syntax of thecreate
command is:create table
tablename(
name1 type1,
...,
namen typen) ;
An index is generated for each database field. Indices are automatically during database queries. The user has not to care about the optimal use of indices. The index for string variables is restricted to the first 39 characters.
Command
drop table
The
drop
command deletes a table structure with table all entries from the database file. The syntax of thedrop
command is:drop table
tablename;
Command
insert into
The
insert
command stores a data record to a table. The specified values must match the table definition in number and data type sequence. The syntax of theinsert
command is:insert into
tablenamevalues
(
val1,
...,
valn)
;
Command
quickinsert insert into
The
quickinsert
is similar to theinsert
command. However, unlikeinsert
,quickinsert
does not update any field indices after storing data records into a database table. Theindex table
command (see below) can be used for field index updates after (multiple)quickinsert
applications. Performing a singleindex table
call is much quicker than updating indices through repeatedinsert
calls. I.e.,quickinsert
andindex table
are useful for quickly inserting large numbers of records into a database. Please note however that data entered withquickinsert
is not included in any query results until aindex table
takes place.Command
index table
The
index table
command is used to create the field indices for data records which have been inserted into a database table with thequickinsert
command (see above). The syntax of theindex
command is:index table
tablename;
Command
select from
The
select
command provides a query to the database contents. The set of output records can be restricted to records matching some condition using the optionalwhere
clause. All records are returned if nowhere
clause is specified. The syntax of theselect
command is:select
[ field1,
...,
fieldn ]from
table1,
...,
tablen [where
... ];
The specification of output fields is optional. All database fields are be returned in the order of their definition if no output fields are given. If an output field is defined in more than one table, then this ambiguity must be resolved by the specification of the field name in the form
table.field
. The same specification must be given, when referring to that field in thewhere
clause. Thewhere
clause consists of comparisons which can be combined with the logical operatorsAND
(logical and),OR
(logical or) andNOT
(logical negation). The comparison operators=
(equal),<>
(not equal),>
(greater than),>=
(greater than or equal),<
(less than) and<=
(less than or equal) are valid for all data types. ThePREVTO
(select previous similar to pattern string) andNEXTTO
(select next similar to pattern string) operators and the string pattern match operatorLIKE
are additionally provided for the string data type. The right side of these operators represents a pattern string which can contain the wildcard characters%
(specifying arbitrary substring) and?
(specifying arbitrary character). The operators of a comparison expression must be type compatible, i.e., of the same data type. The only exception to this rule is the combination ofinteger
andfloat
data types. Terms can consist of operators combining data field references and constants. The operators are+
(addition),-
(subtraction),*
(multiplication),/
(division),%
(division modulo),UPPER
(string conversion to upper case) andLOWER
(string conversion to lower case). The following table lists the valid combinations of operators and data types of referenced data fields or constants:
Operator Data Type +
integer
,float
,string
-
integer
,float
*
integer
,float
/
integer
,float
%
integer
,float
UPPER()
string
LOWER()
string
The data types
date
andboolean
can be combined by none of the defined operators.Command
delete from
The
delete
command deletes data records from a database table. The syntax of thedelete
command is:delete from
tablename [where
... ];
The optional
where
clause syntax accords to thewhere
clause of theselect
command. Thedelete
command deletes the data records from a table matching the condition specified with thewhere
clause. All data records of the specified table are deleted if nowhere
clause is specified.Command
cache
The
cache
command can be used for optionally keeping SQL databases open for multiple read/write SQL operations. These features can be used to avoid time-consuming database open and close operations between multiple SQL read/write operations. Facilitating the SQL cache can increase the performance of certain applications dramatically, especially if SQL databases are accessed over a network. The syntax ofcache
supports the following commands:cache read on ;
cache write on ;
cache off ;
Command
help
The
help
command can be used for retrieving information about the database table structures. The syntax of thehelp
command is:help
[ tablename ];
The data retrieved with the
help
command is returned to the caller by the data callback function. The table name specification is optional. If no table name is given, then thehelp
command returns the names of the defined database tables via the table name parameter of the data callback function, i.e., the data callback function is called once per table. If a table name is given, then thehelp
command returns the table field names and data types via the corresponding parameters of the data callback function, i.e. the data callback function is called once for each table field.Data return function
int datafunc( string dstr, // String or date int dint, // Integer or logical value double ddbl, // Float value int dval, // Data valid flag: // 0 = invalid data // 1 = valid data int dtype, // Data field type: // 2 = integer // 3 = float // 4 = string // 5 = date (format "yyyymmdd") // 6 = logical value (0=FALSE,1=TRUE) string dtable, // Table name string dfield, // Data field name int didx // Data output field index ) { // Data return function statements : return(errstat); }The data callback function is used to return selected data fields to the caller of sqlcmd. The function is automatically called once for each data field. Hence this function is called fifty times if 10 data records with 5 data fields each are selected. The index of the data output field specifies the position of the output field in the current record. It ranges from 1 to the number of defined data output fields. The return value of the data callback function should be zero if no (semantic) error occurred. In case of an error, a nonzero value must be returned to abort the database query.
The sqlcmd function operates directly on database file level and is therefore not attached to the mechanism.
Functions sqlerr, sqlinit.
Definition of a table named
partdata
with thesymname
(String),val
(String) andpartno
(String) data fields in thepartdata.dat
database file:if (sqlinit("partdata.dat",1)!=0) { perror("SQL Init error!"); exit(0); } if (sqlcmd("partdata.dat", "create table partdata (symname string,val string,partno string);", NULL)!=0) { perror("SQL Query error!"); exit(0); }Data insertion:
if (sqlcmd("partdata.dat", "insert into partdata values ('r','470','STK100470');",NULL)!=0) { perror("SQL Data input error!"); exit(0); }Data query:
if (sqlcmd("partdata.dat", "select partno from partdata where symname='r' AND val='470';", datafunc)!=0) { perror("SQL Query error!"); exit(0); } : int datafunc(dstr,dint,ddbl,dval,dtype,dtable,dfield,didx) string dstr; int dint; double ddbl; int dval,dtype; string dtable,dfield; int didx; { printf("Part Number : %s\n"); }Data delete:
if (sqlcmd("partdata.dat", "delete from partdata where symname='r';",NULL)!=0) { perror("SQL Delete error!"); exit(0); }
void sqlerr( & int; // Error code & string; // Error item string );
The sqlerr function is used to determine the error reason after an unsuccessful call of the sqlcmd function.
The error reason can be determined by the parameters returned by the sqlerr function. The error item string identifies the element which caused the error. The following table lists the possible error codes:
Error Code Meaning 0 SQL command executed without errors 1 SQL command read error (internal) 2 SQL command too complex (more than 2000 terms) 3 Invalid numeric expression 4 SQL command file not found (internal) 5 SQL command item too long (more than 200 characters) 6 SQL command syntax error at <c>
7 General SQL command parser error 8 Error creating database 9 File access error 10 Too many open files 11 File <d>
is of wrong type/not a database12 Database file structure is damaged 13 Database file structure is invalid 14 Key <k>
not found15 Key <k>
already defined16 File <d>
not found17 Table element <t>.<f>
has invalid data type18 Too many table elements 19 Data entry length exceeds database limit 20 Multiple table delete not allowed 21 Command contains illegal type combination 22 Output field <f>
undefined/not in any table23 Output field <f>
defined in different tables24 Output table <t>
undefined infrom
table list25 Table <t>
already defined26 Database class limit exceeded 27 Table <t>
not found28 Error from data callback function 29 No delete
record found30 Unknown/new database format 31 Query field not in table(s) 32 Query field in multiple tables 33 File read access denied 34 File write access denied 35 General database error Depending on the error condition the error item string can describe a command element
<c>
, a database file<d>
, a key<k>
, a table<t>
or a data field<f>
.
Functions sqlcmd, sqlinit.
int sqlinit( // Returns status string; // Database file name int; // Database init mode );
The sqlinit function initializes and/or creates a database system for further access by the sql* functions. The database init mode can be zero for initializing an existing database file (.ddb
,.dat
) or 1 to create and initialize a new database file. The function return value is zero on successful initialization, 1 if the database file is already initialized or another value if an error occurred on initializing the database file. Databases processed with the sql* functions are stored in Bartels AutoEngineer DDB format. This introduces powerful features for including relational databases with AutoEngineer library or design data. PPS data can be stored together with layout design data or part attributes can be set with data retrieved from a separate database. The relational database system uses the DDB classes ranged from 4096 to 8191. DDB class 4096 contains the structure of the defined tables. DDB class 4097 is used to manage free DDB classes; this class contains just one entry namedinfo
, which is created by the sqlinit function. The existence of this entry can be used to check whether a database is initialized or not. The DDB classes 4352 to 8191 are assigned dynamically when storing user-defined table records and indices. The number of DDB classes used by each table corresponds to the number of table fields plus 1.
Functions sqlcmd, sqlerr.
double sqrt( // Returns result value double [0.0,[; // Input value );
The sqrt function calculates and returns the square root of the given double input value.
int strcmp ( // Returns comparison result string; // First string string; // Second string );
The strcmp function compares the two input strings. A character-by character alphanumeric comparison is applied. The function returns zero if the strings are equal, (-1) if the first string is smaller than the second string or 1 otherwise.
Functions namestrcmp, numstrcmp.
int strcspn( // Returns match position string; // Test string string; // Suffix match pattern );
The strcspn function returns the number of test string characters not matching any character contained in the suffix match pattern string. The test string is searched from start.
void strdelchr( & string; // Input/output string string; // Delete character set int; // Delete start position int; // Delete end position );
The strdelchr function deletes from the input string all characters contained in the delete character set. The string is scanned from delete start to delete end position.
string strextract( // Returns extracted string string; // Input string int; // Extract start position (0 - strlen-1) int; // Extract end position (0 - strlen-1) );
The strextract function extracts and returns the substring of the input string, which starts at the specified extract start position (counting from zero) and ends at the extract end position. The extract start and end positions are automatically adjusted to the input string boundaries. A reverse string extraction is applied, if the end position is smaller than the start position.
string strextractfilepath( // Returns directory name string; // Path name );
The strextractfilepath function extracts and returns the directory name from the specified path name.
Function strgetpurefilename.
string strgetconffilename( // Returns configuration file path name string; // Environment variable name string; // File base name int; // Directory preference: // 0 : Prefer program directory // 1 : Prefer all users directory // 2 : Prefer user directory );
The strgetconffilename returns the configuration file path name defined through the specified environment variable. The configuration file search is carried out in different configuration file directories according to the specified directory preference.
Function strgetvarfilename.
string strgetvarfilename( // Returns file name string; // Environment variable name );
The strgetvarfilename function returns the file and/or path name defined through the specified environment variable.
Function strgetconffilename.
string strgetpurefilename( // Returns file name string; // Path name );
The strgetpurefilename function extracts and returns the file name from the specified path name.
Function strextractfilepath.
int strlen( // Returns string length string; // Test string );
The
strlen function determines and returns the length of the specified test string (the
NUL
delimiter character is ignored).
void strlistitemadd( & string; // Comma-separated string list string; // String );
The strlistitemadd adds the specified string in the comma-separated string list.
Function strlistitemchk.
int strlistitemchk( // Search result string; // Comma-separated string list string; // Search string );
The strlistitemchk searches the specified search string in the comma-separated string list. The functions returns zero if the search string is not in the string list, 1 if the search string is in the string list, or 2 if the search string matches the full length string list.
Function strlistitemadd.
void strlower( & string; // Input/output string );
The strlower function transforms the uppercase characters of the input string to lowercase.
int strmatch( // Returns string match flag string; // Test string string; // Pattern string (can contain wildcards) );
The strmatch function checks, whether the test string matches the pattern string. The pattern string can contain wildcards. The*
character refers to any character sequence and?
refers to any single character. The function returns nonzero if the test string matches the pattern string or zero otherwise.
void strnset( & string; // Input/output string char; // Fill character int; // Fill count );
The strnset function replaces the leftmost characters of the input string with the specified fill character. The number of characters to be changed is specified with the fill count.
void strreverse( & string; // Input/output string );
The strreverse function reverses the character sequence of the given input string.
int strscannext( // Returns match position string; // Test string string; // Match character set int; // Scan start position (1 - strlen) int; // Stop-on-match flag: // 0 = continue on match // 1 = stop on match );
The strscannext function scans the test string for characters contained in the match character set. The scan starts from the specified scan start position (counting from 0) and proceeds towards the end of the test string. If the stop-on-match flag is set (1), the scan stops at the first character matching the match character set. If the stop-on-match flag is not set (0), the scan stops at the first character not matching the match character set. The function returns the match character position (or the test string length plus 1 on mismatch). The scan start position is automatically adjusted to the input string boundaries.
int strscanprior( // Returns match position string; // Test string string; // Match character set int; // Scan start position int; // Stop-on-match flag: // 0 = continue on match // 1 = stop on match );
The strscanprior function scans the test string for characters contained in the match character set. The scan starts from the specified scan start position and proceeds towards the beginning of the test string. If the stop-on-match flag is set (1), the scan stops at the first character matching the match character set. If the stop-on-match flag is not set (0), the scan stops at the first character not matching the match character set. The function returns the match character position (or zero on mismatch). The scan start position is automatically adjusted to the input string boundaries.
void strset( & string; // Input/output string char; // Fill character );
The strset function replaces all characters of the input string with the specified fill character.
int strspn( // Returns mismatch position string; // Test string string; // Prefix match pattern );
The strspn returns the number of test string characters matching characters contained in the prefix match pattern string. The test string is searched from start.
void strupper( & string; // Input/output string );
The strupper transforms the lowercase characters of the input string to uppercase.
int syngetintpar( // Returns status int [0,[; // Parameter type/number: // 0 = String-Kontrollzeichenauswertungsmodus // 1 = Activate comment text callback function // 2 = Any identifier character flag & int; // Returns parameter value );
The syngetintpar function is used to query User Language BNF/syntax scanner integer parameters previously set with synsetintpar. The functions returns zero if the query was successful or (-1) otherwise.
Functions synparsefile, synparseincfile, synparsestring, synsetintpar.
synparsefile( // Returns scan status
string; // Input file name
[]; // Optional comment callback function
);
The synparsefile function activates a parser for scanning the name-specified input file. The input file is processed according to the data format described with the BNF definition of the corresponding User Language program. The BNF-defined parser action functions automatically called. The synscanline and synscanstring functions can be utilized in parser action functions to query the current input scan line number and the current input scan string. On request, the input scan string can be subject to semantic tests. The synparsefile function is terminated if the end of the input file is reached or if a syntax error (or a semantic error encountered by a parser action function) has occurred.Comment Callback Function
The second function parameter allows for the specification of a comment text callback function. This function is activated if the corresponding scanner/parser parameter has been set with the synsetintpar function. The callback function definition is as follows:
int commentfuncname( string commentstring, // Comment without comment delimiters ) { // Function statements : return(stat); }The parser is stopped if the comment callback function returns a value other than zero. Otherwise the parser continues.
The synparsefile function return value denotes a certain scan status according to the following table:
Return Value Meaning 0 No error 1 No BNF definition available 2 Parser (synparsefile) is already active 3 File open error 4 Too many open files 5 Fatal read/write error 6 Scan item too long 7 Syntax error 8 Unexpected end of file 9 Stack overflow (BNF too complex) 10 Stack underflow (BNF erroneous) 11 Error from parser action function
Functions syngetintpar, synparseincfile, synparsestring, synscaneoln, synscanigncase, synscanline, synscanstring, synsetintpar, and chapter 2.6.4 of this manual.
int synparseincfile( // Returns status string; // Include file name );
The
synparseincfile function can be utilized for processing include files when parsing input files with the
synparsefile function. The parser starts reading at the beginning of the name-specified include file when calling the
synparseincfile function. The
EOFINC
terminal symbol is returned if the end of the include file is reached, and reading continues where it was interrupted in the previously processed file. The function returns zero if no error occurred, (-1) on include file open errors or (-2) if the parser (i.e., the
synparsefile function) is not currently active.
TheEOFINC
terminal symbol is required in the BNF definition whenever the synparseincfile function is used; otherwise the parser issues an unexpected symbol syntax error when reaching the end of an include file. TheEOFINC
terminal symbol is obsolete if the synparseincfile function is not applied.
Functions syngetintpar, synparsefile, synparsestring, synscaneoln, synscanigncase, synscanline, synscanstring, synsetintpar, and chapter 2.6.4 of this manual.
synparsestring( // Returns scan status
string; // Input string
[]; // Optional comment callback function
);
The synparsestring function activates a parser for scanning the given input string. The input string is processed according to the data format described with the BNF definition of the corresponding User Language program. The BNF-defined parser action functions are automatically called. In these parser action functions, the synscanline and synscanstring functions can be utilized for getting the current input scan line number and the current input scan string. On request, the input scan string can be subject to semantic tests. The synparsestring function is terminated if the end of the input string is reached or if a syntax error (or a semantic error encountered by a parser action function) has occurred.Comment Callback Function
The second function parameter allows for the specification of a comment text callback function. This function is activated if the corresponding scanner/parser parameter has been set with the synsetintpar function. The callback function definition is as follows:
int commentfuncname( string commentstring, // Comment without comment delimiters ) { // Function statements : return(stat); }The parser is stopped if the comment callback function returns a value other than zero. Otherwise the parser continues.
The synparsestring function return value denotes a certain scan status according to the following table:
Return Value Meaning 0 No error 1 No BNF definition available 2 Parser (synparsestring) is already active 3 File open error 4 Too many open files 5 Fatal read/write error 6 Scan item too long 7 Syntax error 8 Unexpected end of string 9 Stack overflow (BNF too complex) 10 Stack underflow (BNF erroneous) 11 Error from parser action function
Functions syngetintpar, synparsefile, synparseincfile, synscaneoln, synscanigncase, synscanline, synscanstring, synsetintpar, and chapter 2.6.4 of this manual.
int synscaneoln( // Return status int [0,1]; // Scanner end-of-line recognition mode: // 0 = deactivate EOLN recognition // 1 = activate EOLN recognition );
The synscaneoln function is used to enable and/or disable the end-of-line recognition for the BNF parser activated with the synparsefile function. The end-of-line recognition is disabled on default. The function returns nonzero on error.
The usage of the
EOLN
terminal symbol in a BNF definition is only valid if the end-of-line recognition is activated; otherwise end-of-line characters cause parser syntax errors.
Functions synparsefile, synparseincfile, synparsestring, synscanigncase, synscanline, synscanstring, and chapter 2.6.4 of this manual.
int synscanigncase( // Return status int [0,1]; // Keyword case-sensitivity mode: // 0 = match case // 1 = ignore case );
The synscanigncase function is used to disable and/or enable keyword case-sensitivity for the BNF parser activated with the synparsefile function. On default, keyword case-sensitivity is activated. The function returns nonzero on error.
Functions synparsefile, synparseincfile, synparsestring, synscaneoln, synscanline, synscanstring, and chapter 2.6.4 of this manual.
int synscanline( // Returns current scan line number );
The synscanline function returns the input file line number currently processed by the synparsefile function. The synscanline function can be utilized in referenced parser action user functions to trace the scan process.
Functions synparsefile, synparseincfile, synparsestring, synscaneoln, synscanigncase, synscanstring, and chapter 2.6.4 of this manual.
string synscanstring( // Returns current scan string );
The synscanstring function returns the string currently scanned by the synparsefile function. The synscanstring function can be utilized in referenced parser action user functions to check and store certain scanner input data.
Functions synparsefile, synparseincfile, synparsestring, synscaneoln, synscanigncase, synscanline, and chapter 2.6.4 of this manual.
int synsetintpar( // Returns status int [0,[; // Parameter type/number: // 0 = String control character interpretation mode // 1 = Activate comment text callback function // 2 = Any identifier character flag int; // Parameter value );
The synsetintpar function is used to set User Language BNF/syntax scanner integer system parameters. The function returns zero if the parameter assignment was successful, or (-1) otherwise. The syngetintpar function can be used to query parameter values set with synsetintpar.
Functions syngetintpar, synparsefile, synparseincfile, synparsestring.
int system( // Completion status string; // Command string );
The system function activates and/or executes the command specified in the command string parameter. The command string is passed to the operating system command shell, and BAE waits until command execution is completed. The function returns the status code returned by the operating system, the command interpreter or the executed program (whichever is last to execute before passing control back to BAE). A zero return value usually denotes successful execution, whilst nonzero return values notify errors and/or warnings.
The system function does not work in BAE Demo software configurations.
Executing MS-DOS (child) processes through DOS Extender requires enough conventional memory to be available for running the executable. Conventional memory must be controlled with the
-MINREAL
and-MAXREAL
variables of the Phar Lap 386|DOS Extender. For running User Language programs using the system function, the corresponding User Language Interpreter environments must be re-configured by applying Phar Lap's redistributed CFIG386 tool as in> cfig386 <EXEFILE> -maxreal 0ffffhwhere
<EXEFILE>
must be set to the appropriate User Language Interpreter executable(s) (scm.exe
,ged.exe
,neurrut.exe
,cam.exe
,gerview.exe
and/orced.exe
).
Note that the system function introduces basic multi-processing/multi-tasking features which are not fully supported on PC-based systems or can cause some problems on network-based workstation systems (depending on whichever OS command is to be executed).
It is strongly recommended to redirect DOS command standard output to temporary files (and use some file view User Language function for display); otherwise, DOS standard output overwrites the BAE graphic user interface.
Erroneous DOS command calls cause error output to the screen, thus overwriting the BAE graphic interface. Due to the fact that DOS lacks from some substantial standard features such as redirect error output, this problem can only be solved by refraining and/or preventing from running erroneous DOS commands, e.g., by pre-checking the consistency of each DOS command to be called.
It is strongly recommended to refrain and/or prevent from calling interactive DOS commands and/or application software with the system function since otherwise the system will "hang up" due to the fact that DOS standard input cannot be redirected from the BAE graphic user interface. It is also strongly recommended to refrain and/or prevent from directly calling UNIX commands which expect some user input (such as
more
,vi
, etc.); this problem can be solved by a command cast to background (&) command shell start where the desired command should be called from (which however might cause a terminal device connection problem under remote login).
Function launch.
double tan( // Returns result value double; // Input angle value (STD3) );
The tan function calculates and returns the tangent value of the given angle value. The input angle value must be in radians.
double tanh( // Returns result value double; // Input angle value (STD3) );
The tanh function calculates and returns the hyperbolic tangent value of the given angle value. The input angle value must be in radians.
char tolower( // Returns lowercase character char; // Input character );
The tolower function converts and returns the specified uppercase alphabetic input character to lowercase (or returns the input character unchanged if not uppercase alphabetic).
char toupper( // Returns uppercase character char; // Input character );
The toupper function converts and returns the specified lowercase alphabetic input character to uppercase (or returns the input character unchanged if not lowercase alphabetic).
int uliptype( // Interpreter type: // 0x0000 = invalid/unknown // 0x0080 = SCM - Schematic Editor // 0x0040 = GED - Layout Editor // 0x0010 = AR - Autorouter // 0x0008 = CAM - CAM Processor // 0x0004 = CED - Chip Editor // 0x1000 = CV - CAM View );
The uliptype function returns the type of the currently active User Language Interpreter environment.
int ulipversion( // Returns interpreter version );
The ulipversion function returns the internal version number of the currently active User Language Interpreter environment.
int ulproginfo( // Returns status string; // Program name & int; // Program version & int; // Program caller type );
The ulproginfo function gets the program version and the program caller type of a name-specified User Language program. The program version is the internal version number of the User Language Compiler used for compiling the program. The program caller type is a bit-mask value designating the User Language Interpreter environments compatible for executing the User Language program. The ulproginfo function can be utilized together with the ulip* functions to check whether a certain User Language program can be executed in the current User Language Interpreter environment.
Functions uliptype, ulipversion.
int ulsystem( // Returns status string; // Program name & int; // Program counter );
The ulsystem function executes the User Language program with the specified program name. The function returns nonzero if an error occurred whilst loading or running the program (see below for diagnosis). On error, the program counter parameter returns the address of the machine program instruction, which caused the error (to be compared with the listing file generated by the User Language Compiler).
The ulsystem function can return the following return values:
Return Value Meaning 0 Program successfully executed 1 DDB/database access error 2 Program already loaded 3 Program not found 4 Incompatible User Language Program Version 5 Incompatible index/function references 6 Stack underflow 7 Stack overflow 8 Division by zero 9 Error calling system function 10 System function not available 11 System function not implemented 12 User function not found 13 Invalid data type for user function 14 Invalid parameter list for user function 15 Error accessing array variable 16 Invalid array variable index 17 General file access error 18 General file read error 19 General file write error
Function ulsystem_exit.
void ulsystem_exit( string; // Program name );
The ulsystem function executes the User Language program with the specified program name after exiting the current User Language program.
Functions exit, ulsystem.
int vardelete( // Returns status string; // Variable name );
The vardelete function is used for deleting a global User Language variable previously defined with varset. The function returns zero if the variable has been successfully deleted or (-1) if no variable with the specified name is defined.
Functions varget, varset.
int varget( // Returns status string; // Variable name & void; // Variable value );
The varget function is used for retrieving the value of global User Language variable previously defined with varset. The function return value is zero if the query was successful, (-1) if no variable with the specified name is defined or (-2) if the data type of the variable does not match the data type of the variable value return parameter.
Functions vardelete, varset.
int varset( // Returns status string; // Variable name void; // Variable value );
The varset functions defines a global User Language variable with the specified variablen name and assigns the provided variable value. The variable value must match a basic data type (int
,double
,char
orstring
), i.e., complex and/or combined data types such as arrays, structures orindex
types are not allowed. The function returns zero on successful variable definition, (-1) for invalid variable name specifications or (-2) if the variable value does not match a basic data type. Global User Language variable definitions are not deleted when the User Language program exits, i.e., they stay resident until they are explicitly deleted with the vardelete function or until the currently active BAE program module is exited. The varget function can be used to retrieve the value of a global User Language variable previously defined with varset. Global User Language variables can be used to exchange data between User Language programs which run at different times in the same BAE module.
Functions vardelete, varget.
Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: System Functions :: Standard System Functions |
Standard System Functions
© 1985-2025 Oliver Bartels F+E