AnalytiCalc Datatrieve (DTR) Interface Functions These functions are selected by the PCCMAKIVD.COM procedure which links with DTRIF.FOR instead of the dummy DTRIF.FTN. They interface VAX AnalytiCalc (one of the versions of it anyway) with DTR-32. Command level functions are given as DTRccc where ccc is the actual command. Equivalent functions are available from cells using the syntactic form *U DBccc arguments (where the "arguments" part is any arguments, generally some required.) The *U DBccc forms generally will return a 0. if there was an error detected and a 1. if not, in the % accumulator. The value return function however uses the % accumulator for the return value and so returns no special error flag. The DTRxxxxxxx commands cause redraw of the entire screen on completion besides their other effects. Since this is not always desirable, an alternative form is provided, namely FILxxxxxxxx where the extra characters are the same as DTRxxxxxxxx. In that case recomputation may be performed but the entire screen will not always be repainted. DTRIMM (command only; no *U form) - Passes remainder of line to DTR to act on and allows direct passing of commands to DTR with DTR Terminal Driver handling of results. This may be used instead of DTRCMD if results printouts are desired. DTRINT (command only) - Executes command and gets into interactive DTR. Returns to spreadsheet when a control-Z is typed to DTR> prompt. DTRDIS Disables *U DBxxx functions so they return without any action. Intitially these functions are enabled. DTRENA Enables *U DBxxx functions to have their normal function. Use these controls to allow DTR to fill in data or have it filled in only once, avoiding the delays for every calculation of the sheet. CHARACTERS ccc NAME FUNCTION CMD Do Command DTRCMD command passes command to DTR and flushes any resulting output. Error conditions are handled via DTR Terminal handler. Failure (in *U forms) is flagged as if an illegal function. VAL Get Value DTRVALd command passes command to DTR and expects a value (floating point) to be returned. Converts this value (if any) to binary and returns it in the % accumulator. If the comma is omitted the value is retrieved from the DTR message buffer. The "d" is a delimiter character and may be in the ASCII range from : to ? for 0 to 6 records skipped from DTR prior to evaluation of the value. IF the first character of the command is a period (.), it will be stripped and the program will skip past any colon character (:) seen and add a decimal (.) to the end of the text string returned from DTR if no decimal already exists there so that it can be converted properly to a floating point number. Example: Suppose you have readied a domain and done a SELECT and now want to retrieve a value from a field named COST in cell C12. You can then execute the following commands: L C12 ; move to cell C12 EV *U DBVAL<. PRINT COST The < causes the program to skip the blank and label lines DTR prints out and the . causes DTR to add a decimal after the cost. (This assumes the COST field would print out an integer; if the field will be printed as 45.33, the formatting period is not needed.) If the COST field needs to be divided by 100., insert the following formula instead: *U DBVAL<. PRINT COST\ %/100. Note that if you plan to turn off DTR evaluation sometimes, the *U DBxxx functions do nothing, so you will probably want the number in your cell to be stable. To achieve this use instead the command: EV %=P#0#0\*U DBVAL<. PRINT COST so that the result will remain even if the DBVAL command is disabled. This command replaces the EV above. You simply are setting the % accumulator to the value of the current cell (P#0#0) before calling on DTR to update the % accumulator in this case. The second *U DBVAL command could be also rewritten as: %=100.*(P#0#0)\*U DBVAL<. PRINT COST\ %/100. which multiplies the current value by 100., gets the DTR value if that function is turned on, and divides by 100. TXT Get Text DTRTXT cell,command or DTRTXT celld command passes command to DTR and expects a text string back. Places this string into named cell's formula and flags the cell as containing text. Returns 0. in % on detected failures, 1. if success apparently was seen. (Has no way of knowing whether the text returned is what was desired, so this is incomplete.)_ If the comma is omitted (and DTR is in a permissible state) the text is retrieved without a DTR command. If the "d" form is given the "d" is a delimiter character which may be one of the following: : - skip 1 line ; - skip 2 lines < - skip 3 lines = - skip 4 lines > - skip 5 lines ? - skip 6 lines These lines from DTR will be skipped prior to taking the return value in text so that leading field labels and/or extra blank lines can be omitted. The function will (attempt to) flush all remaining trailing output from DTR prior to proceeding to leave DTR in a state ready for another command. The command would frequently be a PRINT or LIST command. Trailing whitespace is automatically deleted from the text returned. Example: Suppose you have readied a domain and done a SELECT and now want to retrieve a text string from a field named COST in cell C12. You can then execute the following commands: DTRTXT C12< PRINT COST The < causes the program to skip the blank and label lines DTR prints out. As an alternative you could insert the command right into the cell or in another cell in the following format: *U DBTXT C12