New Dcal Routines for DataCAD Version 9.0 ------------------------------------------------------------------------------- PROCEDURE msg_OK (msg : str255); BUILTIN 245; msg is displayed in a simple dialog box with an OK button. ------------------------------------------------------------------------------- FUNCTION msg_dlg ( msg : str255; msgDlgType; msgDlgButtons : integer) : integer; BUILTIN 246; msg is displayed in a dialog box. msgDlgType can be one of the following: 1 = Warning A message box containing a yellow exclamation point symbol. 2 = Error A message box containing a red stop sign. 3 = Information A message box containing a blue "i". 4 = Confirmation A message box containing a green question mark. 5 = Custom A message box containing no bitmap. msgDlgButtons can be one of the following: 1 = YESNOCANCEL Yes, No & Cancel buttons are used. 2 = OKCANCEL OK & Cancel buttons are used. 3 = ABORTRETRYIGNORE Abort, Retry & Ignore Buttons are used. The caption of the message box will be DataCAD for windows. The function returns an integer corresponding to the following values: 1 = Yes 2 = No 3 = Cancel 4 = OK 5 = Abort 6 = Retry 7 = Ignore 8 = None. (User exited by closing the dialog without selecting a button.) These values are also defined in msgDlg.inc. ------------------------------------------------------------------------------- FUNCTION random : real; BUILTIN 247; Returns a real number between 0 and 1 ------------------------------------------------------------------------------- FUNCTION random_seed (seed : integer): integer; BUILTIN 248; Returns an integer between 0 and seed. Note seed is limited to a valid integer with a max of 32767. Values beyond this will give unpredictable results. ------------------------------------------------------------------------------- PROCEDURE execAndWait ( prog : str255; Visibility: integer; returnCode : OUT integer); BUILTIN 632; Executes prog with the programs windows displayed according to the setting of visibility. After prog is terminated returnCode will contain an integer value describing the results. This code will vary according to the application run but standard values are 0 for successful execution and termination or -1 for failure to run the program. Additional values are possible depending on the application called. Visibility values are defined in show_wdw.inc and are standard windows settings for displaying windows. Consult the windows programmers references for more information on thes values. DataCAD will be paused until the application called terminates. If you simply wish to spawn another progam and continue with DataCAD use ExecProg. ********** INI FILE ROUTINES *********** The following variables apply to the INI File Routines: IniFile = A text file. The file may have any valid name and extension. It does not need to have an 'ini' extension. If no path is given the file will be saved to the windows system directory. Section = A heading within the Inifile under which the Ident/Value will be found. The section name appears in the format [section_name] Note the brackets. Ident = The label of the value to be saved/read. Value = The value to be saved/read. Ident/Values are stored as pairs in the format 'ident = value' The quotes are not part of the format. ------------------------------------------------------------------------------- PROCEDURE writeIniStr (IniFile, Section, Ident, Value : str255); BUILTIN 624; Writes Value to Inifile as a string. ------------------------------------------------------------------------------- PROCEDURE readIniStr (IniFile, Section, Ident, Default : str255; ReturnStr : OUT str255); BUILTIN 625; Reads ReturnStr from IniFile. If the string is not found Default is returned. ------------------------------------------------------------------------------- PROCEDURE writeIniBool (IniFile, Section, Ident : str255; Value : boolean); BUILTIN 626; Writes Value to IniFile as a Boolean. The value is converted to an integer with the value of 0 for false and 1 for true. ------------------------------------------------------------------------------- PROCEDURE readIniBool ( IniFile, Section, Ident: str255; Default : boolean; ReturnBool : OUT boolean); BUILTIN 627; Reads ReturnBool from IniFile. If ReturnBool is not found Default is returned. ------------------------------------------------------------------------------- PROCEDURE writeIniInt (IniFile, Section, Ident : str255; Value : integer); BUILTIN 628; Writes Value to IniFile as an Integer. ------------------------------------------------------------------------------- PROCEDURE readIniInt ( IniFile, Section, Ident: str255; Default : integer; ReturnInt : OUT integer); BUILTIN 629; Reads ReturnInt from IniFile. If ReturnInt is not found Default is returned. ------------------------------------------------------------------------------- PROCEDURE writeIniReal (IniFile, Section, Ident : str255; Value : real); BUILTIN 630; Writes Value to IniFile as a real. Note that you are limited to 8 digits in your real value. This includes the decimal point. Any value exceeding 8 digits will be rounded when stored. For example 1.2345678 will be saved as 1.234568. This holds true for exponential formats as well. 1.234e23 will be written as is while 1.2345678e23 will be rounded to 1.234568e23. ------------------------------------------------------------------------------- PROCEDURE readIniReal ( IniFile, Section, Ident: str255; Default : real; ReturnReal : OUT real); BUILTIN 631; Reads ReturnReal from IniFile. If ReturnReal is not found Default is returned. ------------------------------------------------------------------------------- FIXES TO DCAL IN VERSION 9.0 The beep procedure has be fixed. A call to beep will play the windows system asterisk sound file as defined in the control panel.