.TITLE DTRFND VAX-11 Datatrieve Function Definitions .IDENT /V2.0/ ;++DTRFND.MAR ; ; Facility: ; VAX-11 Datatrieve. ; ; Abstract: ; Function definitions for VAX-11 Datatrieve. ; ; Environment: ; DTRSHR shareable image. ; ;-- ; ; Modification History: ; ; V1.1 12-Aug-82 --- Installation version ; V1.2 14-Aug-82 FJN Added FN_CVT_HTB function. Also editted ; this file for automatic HELP text extraction. ; V1.3 16-Aug-82 FJN Added FN_CVT_OTB and FN_CHK_HEX/OCT functions. ; V1.4 26-Sep-82 FJN Added FN_CVT_BIN function ; V1.5 02-Mar-83 FJN Add hexadecimal<->quadword functions ; V2.0 04-May-83 FJN Added functions from V1.3 DTRFND ; .PSECT FND,NOWRT,PIC .LIBRARY /SYS$LIBRARY:DTRFUNLIB/ ;.LIBRARY /DTRFUNLIB/ ; for diagnostics ;.SHOW EXPANSIONS ; ; Calculates: ; Input: ; Output: ; Example: DTR> PRINT name ( ; name ; result ; DTR> ; ;*************************************************** ; ; F U N C T I O N D E F I N I T I O N S ; ;*************************************************** $DTR$FUN_INIT .PAGE .SUBTITLE FN$ABS - Absolute value ;+ FN$ABS ; ; Calculates: Absolute value of input ; Input: Signed decimal number ; Output: Unsigned decimal number ; Example: DTR> PRINT FN$ABS(-128) ; FN$ABS ; 128.000000 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$ABS, MTH$ABS, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$AMOD - Floating-point modulus ;+ FN$AMOD ; ; Calculates: Value of input according to specified modulus ; Input: Floating point value and modulus ; Output: Floating point value ; Example: DTR> PRINT FN$AMOD(31.0,7.0) ; FN$AMOD ; 3.000E+00 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is two floating values passed by reference ; ; The result is calculated by arg1-arg2*(arg1/arg2) ; $DTR$FUN_DEF FN$AMOD, MTH$AMOD, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 2 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$ATAN - Arc tangent ;+ FN$ATAN ; ; Calculates: Arctangent of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$ATAN (45) ; FN$ATAN ; 1.54857778 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$ATAN, MTH$ATAN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$COS - Cosine Function ;+ FN$COS ; ; Calculates: Cosine of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$COS (45) ; FN$COS ; .525321960 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$COS, MTH$COS, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$EXP - Exponential Function ;+ FN$EXP ; ; Calculates: Value of e to specified power ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$EXP (2) ; FN$EXP ; 7.38905620 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$EXP, MTH$EXP, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$FLOOR - Greatest integer ;+ FN$FLOOR ; ; Calculates: Integer part of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$FLOOR (59.99) ; FN$FLOOR ; 59.0000000 ; DTR> ; ;- ; Output is a floating number ; Input is a floating number ; $DTR$FUN_DEF FN$FLOOR, MTH$FLOOR, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$HEX - Hexadecimal string ;+ FN$HEX ; ; Calculates: Hexadecimal equivalence of input ; Input: Signed decimal number ; Output: Hexadecimal character string ; Example: DTR> PRINT FN$HEX (183) ; FN$HEX ; B7 ; DTR> ; ;- ; Output is a fixed length string ; Input is a longword ; $DTR$FUN_DEF FN$HEX, FOR$CNV_OUT_Z, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = 8, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, ALL_LEN = 9, OUT_PUT = TRUE $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$INIT_TIMER - initialize timer ;+ FN$INIT_TIMER ; ; Calculates: Nothing, initializes a timer ; Input: NONE ; Output: NONE ; Example: DTR> PRINT FN$INIT_TIMER ; FN$INIT ; TIMER ; 1 ; DTR> ; ;- ; No Output. ; No Input. ; $DTR$FUN_DEF FN$INIT_TIMER, LIB$INIT_TIMER, 0 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$LN - Natural logarithm ;+ FN$LN ; ; Calculates: Natural log of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$LN (36) ; FN$LN ; 3.58351898 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$LN, MTH$ALOG, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$LOG10 - Common logarithm ;+ FN$LOG10 ; ; Calculates: Common (base 10) log of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$LOG10 (36) ; FN$LOG10 ; 1.5563E+00 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$LOG10, MTH$ALOG10, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$MOD - Modulo Function ;+ FN$MOD ; ; Calculates: Value of input according to specified modulus ; Input: Signed number, modulus ; Output: Unsigned integer ; Example: DTR> PRINT FN$MOD (31,7) ; FN$MOD ; 3 ; DTR> ; ;- ; Output is a longword in R0 ; Input is two longwords ; the result is calculated by arg1-arg2*(arg1/arg2) ; $DTR$FUN_DEF FN$MOD, MTH$JMOD, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, ORDER = 2 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$NINT - Nearest integer from floating ;+ FN$NINT ; ; Calculates: Integer nearest to input ; Input: Signed number ; Output: Signed number ; Example: DTR> PRINT FN$NINT (59.99) ; FN$NINT ; 60 ; DTR> ; ;- ; Output is an integer ; Input is a floating number ; $DTR$FUN_DEF FN$NINT, MTH$JNINT, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$OPENS_LEFT - Remaining open file quota ;+ FN$OPENS_LEFT ; ; Calculates: Number of additional files you can open ; Input: None ; Output: Unsigned integer ; Example: DTR> PRINT FN$OPENS_LEFT ; FN$OPENS ; LEFT ; 3 ; DTR> ; ;- ; Output is a longword value in R0 ; $DTR$FUN_DEF FN$OPENS_LEFT, DTR$$OPENS_LEFT, 0 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$SHOW_TIMER - display timer statistics ;+ FN$SHOW_TIMER ; ; Calculates: Nothing, displays timer statistics ; Input: NONE ; Output: NONE ; Example: DTR> PRINT FN$SHOW_TIMER ; FN$SHOW ; TIMER ; ELAPSED 00.... ; 1 ; DTR> ; ;- ; No Output. ; No Input. ; $DTR$FUN_DEF FN$SHOW_TIMER, LIB$SHOW_TIMER, 0 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$SIGN - Sign of a number ;+ FN$SIGN ; ; Calculates: Sign of input ; Input: Floating value in R0 ; Output: Floating value passed by reference ; Example: DTR> PRINT FN$SIGN (-45) ; FN$SIGN ; -1 ; DTR> ; ;- ; Output is a floating value in R0 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$SIGN, MTH$SGN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$SIN - Sine Function ;+ FN$SIN ; ; Calculates: Sine of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$SIN (45) ; FN$SIN ; .850903511 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$SIN, MTH$SIN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$SQRT - Square root ;+ FN$SQRT ; ; Calculates: Square root of input ; Input: Zero or positive decimal number ; Output: Zero or positive decimal number ; Example: DTR> PRINT FN$SQRT (196) ; FN$SQRT ; 14.0000000 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$SQRT, MTH$SQRT, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$STR_EXTRACT - String extract ;+ FN$STR_EXTRACT ; ; Calculates: Extracts substring from input ; Input: Character string, ordinal number of starting ; character, length of desired substring ; Output: Substring ; Example: DTR> DECLARE X PIC X(12). ; DTR> X = "603-555-1212" ; DTR> PRINT FN$STR_EXTRACT (X,5,3) ; FN$STR ; EXTRACT ; 555 ; DTR> ; ;- ; Output is a string ; Input is an output string descriptor, an input string descriptor, ; a start position and a length. ; $DTR$FUN_DEF FN$STR_EXTRACT, STR$LEN_EXTR, 4 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, ORDER = 3 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$STR_LOC - Locate a substring ;+ FN$STR_LOC ; ; Calculates: Starting position of substring in input ; Input: Character string, substring ; Output: Unsigned integer ; Example: DTR> DECLARE X PIC X(12). ; DTR> X = "603-555-1212" ; DTR> PRINT FN$STR_LOC (X,"555") ; FN$STR ; LOC ; 5 ; DTR> ; ;- ; Output is the position of the substring (a number) ; Input is a source string descriptor, and a descriptor ; of a substring ; $DTR$FUN_DEF FN$STR_LOC, STR$POSITION, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 4 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 2 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$STR_FIRST_CHAR - ASCII value of first character ;+ FN$STR_FIRST_CH ; ; Name: FN$STR_FIRST_CHAR ; Calculates: ASCII value of first character of input ; Input: Character string ; Output: ASCII value as unsigned integer ; Example: DTR> DECLARE X PIC X(12). ; DTR> X = "603-555-1212" ; DTR> PRINT FN$STR_FIRST_CHAR (X) ; FN$STR ; FIRST ; CHAR ; 54 ; DTR> ; ;- ; Output is a longword value in R0 ; Input is a string descriptor ; $DTR$FUN_DEF FN$STR_FIRST_CHAR, LIB$ICHAR, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$TAN - Tangent function ;+ FN$TAN ; ; Calculates: Tangent of input ; Input: Signed decimal number ; Output: Signed decimal number ; Example: DTR> PRINT FN$TAN (45) ; FN$TAN ; 1.61977529 ; DTR> ; ;- ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference ; $DTR$FUN_DEF FN$TAN, MTH$TAN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 10 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 10, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$TRANS_LOG - Translate a logical name ;+ FN$TRANS_LOG ; ; Calculates: Value of logical name ; Input: Character string ; Output: Character string ; Example: DTR> PRINT FN$TRANS_LOG("DTR$SYNONYM") USING X(30) ; FN$TRANS ; LOG ; DB0:[JONES.DAT]SYNONYM.DAT ; DTR> ; ;- ; Output is a string descriptor ; Input is a string descriptor ; $DTR$FUN_DEF FN$TRANS_LOG, LIB$SYS_TRNLOG, 3 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_END_DEF .PAGE .SUBTITLE FN$UPCASE - Upshift all characters in a string ;+ FN$UPCASE ; ; Calculates: Upshift all characters in input string ; Input: Character string ; Output: Character string ; Example: DTR> PRINT FN$UPCASE("This is a test string") USING X(30) ; FN$UPCASE ; THIS IS A TEST STRING ; DTR> ; ;- ; Output is a string descriptor ; Input is a string descriptor ; $DTR$FUN_DEF FN$UPCASE, STR$UPCASE, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE Date Routines ; ; Date Routines: ; Input is a 64 bit date passed by ref. ; ;+ FN$DAY ; ; Calculates: Day part of input ; Input: Date ; Output: Unsigned integer from 1 to 31 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$DAY (Y) ; FN$DAY ; 1 ; DTR> ; ;- ;+ FN$HOUR ; ; Calculates: Hour part of input ; Input: Date ; Output: Unsigned integer from 1 to 24 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$HOUR (Y) ; FN$HOUR ; 8 ; DTR> ; ;- ;+ FN$HUNDREDTH ; ; Calculates: Hundredth-of-a-second part of input ; Input: Date ; Output: Unsigned integer from 0 to 99 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$HUNDREDTH (Y) ; FN$HUNDREDTH ; 55 ; DTR> ; ;- ;+ FN$JULIAN ; ; Calculates: Julian date of input ; Input: Date ; Output: Unsigned integer from 1 to 366 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$JULIAN (Y) ; FN$JULIAN ; 51 ; DTR> ; ;- ;+ FN$MINUTE ; ; Calculates: Minute part of input ; Input: Date ; Output: Unsigned integer from 0 to 59 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$MINUTE (Y) ; FN$MINUTE ; 51 ; DTR> ; ;- ;+ FN$MONTH ; ; Calculates: Month part of input ; Input: Date ; Output: Unsigned integer from 1 to 12 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$MONTH (Y) ; FN$MONTH ; 4 ; DTR> ; ;- ;+ FN$SECOND ; ; Calculates: Second part of input ; Input: Date ; Output: Unsigned integer from 0 to 59 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$SECOND (Y) ; FN$SECOND ; 11 ; DTR> ; ;- ;+ FN$TIME ; ; Calculates: Time part of input ; Input: Date ; Output: Time in VAX/VMS format ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$TIME (Y) ; FN$TIME ; 08:51:11.5 ; DTR> ; ;- ;+ FN$YEAR ; ; Calculates: Year part of input ; Input: Date ; Output: Unsigned integer for years from 1858 to 9999 ; Example: DTR> DECLARE Y USAGE DATE EDIT_STRING X(23). ; DTR> Y = "NOW" ; DTR> PRINT Y ; Y ; 1-Apr-1982 08:51:11.55 ; DTR> PRINT FN$YEAR (Y) ; FN$YEAR ; 1982 ; DTR> ; ;- $DTR$FUN_DEF FN$DAY, DTR$$DAT_DAY, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$HOUR, DTR$$DAT_HOUR, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$HUNDREDTH, DTR$$DAT_HUNDREDTH, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$JULIAN, DTR$$DAT_JULIAN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$MINUTE, DTR$$DAT_MINUTE, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$MONTH, DTR$$DAT_MONTH, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$SECOND, DTR$$DAT_SECOND, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$TIME, DTR$$DAT_TIME, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_INPUT $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_END_DEF $DTR$FUN_DEF FN$WEEK, DTR$$DAT_WEEK, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF $DTR$FUN_DEF FN$YEAR, DTR$$DAT_YEAR, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 35, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_CHK_HEX - Check for hexadecimal syntax ;+ FN_CHK_HEX ; ; Calculates: Checks for hexadecimal input string ; Input: Input string ; Output: Boolean value ; Example: DTR> PRINT FN_CHK_HEX ("A2") ; FN ; CHK ; HEX ; 1 ; DTR> ; ;- ; Output is a longword value ; Input is a string descriptor ; $DTR$FUN_DEF FN_CHK_HEX,DTR___CHK_HEX,1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 4 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_CHK_OCT - Check for octal syntax ;+ FN_CHK_OCT ; ; Calculates: Checks for octal input string ; Input: Input string ; Output: Boolean value ; Example: DTR> PRINT FN_CHK_OCT ("77") ; FN ; CHK ; OCT ; 1 ; DTR> ; ;- ; Output is a longword value ; Input is a string descriptor ; $DTR$FUN_DEF FN_CHK_OCT,DTR___CHK_OCT,1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = 4 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_CVT_BIN - Convert unsigned byte/word to longword ;+ FN_CVT_BIN ; ; Calculates: Converts unsigned byte or word to signed longword ; Input: Unsigned integer value and length (1,2,4 bytes) ; Output: Signed integer ; Example: DTR> PRINT FN_CVT_BIN (255,1) ; FN ; CVT ; BIN ; -128 ; DTR> ; ;- ; Output is a signed longword value ; Input is an unsigned longword value and a input length code ; $DTR$FUN_DEF FN_CVT_BIN,DTR___CVT_BIN,3 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = 4, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = 4, ORDER = 2 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_CVT_HTB - Convert hexadecimal to binary ;+ FN_CVT_HTB ; ; Calculates: Binary equivalent of hexadecimal input ; Input: Hexadecimal input string ; Output: Signed integer ; Example: DTR> PRINT FN_CVT_HTB ("A2") ; FN ; CVT ; HTB ; 162 ; DTR> ; ;- ; Output is a longword value ; Input is a string descriptor ; $DTR$FUN_DEF FN_CVT_HTB,DTR___CVT_HTB,2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_CVT_OTB - Convert octal to binary ;+ FN_CVT_OTB ; ; Calculates: Binary equivalent of octal input ; Input: Octal input string ; Output: Signed integer ; Example: DTR> PRINT FN_CVT_OTB ("144") ; FN ; CVT ; OTB ; 100 ; DTR> ; ;- ; Output is a longword value ; Input is a string descriptor ; $DTR$FUN_DEF FN_CVT_OTB,DTR___CVT_OTB,2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 8, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_CVT_QHTB - Convert hexadecimal to binary ;+ FN_CVT_QHTB ; ; Calculates: Binary equivalent of hexadecimal input ; Input: Hexadecimal input string ; Output: Unsigned quadword integer ; Example: DTR> PRINT FN_CVT_QHTB ("A2") ; FN ; CVT ; HTB ; 162 ; DTR> ; ;- ; Output is an unsigned quadword value ; Input is a string descriptor ; $DTR$FUN_DEF FN_CVT_QHTB,DTR___CVT_QHTB,2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 5, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = 14, ORDER = 1 $DTR$FUN_END_DEF .PAGE .SUBTITLE FN_QHEX - Hexadecimal string ;+ FN_QHEX ; ; Calculates: Hexadecimal equivalence of input ; Input: Unsigned quadword number ; Output: Hexadecimal character string ; Example: DTR> PRINT FN_QHEX (183) ; FN_QHEX ; B7 ; DTR> ; ;- ; Output is a fixed length string ; Input is an unsigned quadword ; $DTR$FUN_DEF FN_QHEX, DTR___QHEX, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = 5, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, ALL_LEN = 17, OUT_PUT = TRUE $DTR$FUN_END_DEF .PAGE .SUBTITLE End of functions ; ; This marks the end of the definitions of the VAX-1 Datatrieve functions. ; $DTR$FUN_FINI .END