[613] | 1 | ZVEMSFB ;DJB,VSHL**%DT,COMMA [04/17/94]
|
---|
| 2 | ;;12;VPE;;COPYRIGHT David Bolduc @1993
|
---|
| 3 | ;
|
---|
| 4 | %DT ;;;
|
---|
| 5 | ;;; % D T Date and Time Input and Conversion
|
---|
| 6 | ;;;
|
---|
| 7 | ;;; 1. ENTRY POINT: ^%DT
|
---|
| 8 | ;;; Returns date in VA Fileman format: YYYMMDD.HHMMSS
|
---|
| 9 | ;;; Date is a canonic number - no trailing zeroes after the decimal.
|
---|
| 10 | ;;;
|
---|
| 11 | ;;; 2. INPUT VARIABLES
|
---|
| 12 | ;;; %DT.......A = Ask for date input
|
---|
| 13 | ;;; E = Echo the answer
|
---|
| 14 | ;;; F = Future dates are assumed
|
---|
| 15 | ;;; P = Pure numeric input not allowed
|
---|
| 16 | ;;; R = Require time input
|
---|
| 17 | ;;; S = Seconds should be returned
|
---|
| 18 | ;;; T = Time input allowed but not required
|
---|
| 19 | ;;; X = Exact date required (with month and day).
|
---|
| 20 | ;;; X.........If %DT doesn't contain A, X must equal value to be processed.
|
---|
| 21 | ;;; %DT("A")..Default prompt.
|
---|
| 22 | ;;; %DT("B"...Default answer.
|
---|
| 23 | ;;; %DT(0)....Optional. Prevents input date from being before or after a
|
---|
| 24 | ;;; particular date:
|
---|
| 25 | ;;; %DT(0)=2930101 Allows input only of dates GREATER THAN or
|
---|
| 26 | ;;; EQUAL TO that date.
|
---|
| 27 | ;;; %DT(0)=-2930101 Allows input only of dates LESS THAN or EQUAL
|
---|
| 28 | ;;; TO that date.
|
---|
| 29 | ;;; %DT(0)="NOW" Allows dates from current time forward.
|
---|
| 30 | ;;; %DT(0)="-NOW" Allows dates up to the current time.
|
---|
| 31 | ;;; DTIME.....Time out.
|
---|
| 32 | ;;;
|
---|
| 33 | ;;; 3. OUTPUT VARIABLES
|
---|
| 34 | ;;; Y.........-1 (Date/time was invalid) -or- YYYMMDD.HHMMSS.
|
---|
| 35 | ;;; X.........What was passed (%DT doesn't contain A) or what was entered.
|
---|
| 36 | ;;; DTOUT.....%DT timed out.
|
---|
| 37 | ;;;
|
---|
| 38 | ;;; 1. ENTRY POINT: DD^%DT
|
---|
| 39 | ;;; Converts internal date in Y to its external format.
|
---|
| 40 | ;;;
|
---|
| 41 | ;;; 2. INPUT VARIABLES
|
---|
| 42 | ;;; Y.......Internal date.
|
---|
| 43 | ;;; %DT.....Optional. If it contains S, forces seconds to be returned.
|
---|
| 44 | ;;;
|
---|
| 45 | ;;; 3. OUTPUT VARIABLES
|
---|
| 46 | ;;; Y.......Date in external format.
|
---|
| 47 | ;;;
|
---|
| 48 | ;;; 1. ENTRY POINT: X ^DD("DD")
|
---|
| 49 | ;;; Converts a date from internal to external format. Set Y=internal date
|
---|
| 50 | ;;; and X ^DD("DD"). Y will equal external format.
|
---|
| 51 | ;;;***
|
---|
| 52 | COMMA ;;;
|
---|
| 53 | ;;; % D T C Number Formatting
|
---|
| 54 | ;;;
|
---|
| 55 | ;;; 1. ENTRY POINT: COMMA^%DTC
|
---|
| 56 | ;;; Formats a number with commas.
|
---|
| 57 | ;;;
|
---|
| 58 | ;;; 2. INPUT VARIABLES
|
---|
| 59 | ;;; X........Number to be formatted. May be positive or negative.
|
---|
| 60 | ;;; X2.......Number of decimal digits. If X2 is undefined, 2 decimal digits
|
---|
| 61 | ;;; are returned. If X2 is a number followed by a dollar sign
|
---|
| 62 | ;;; (e.g. 3$), then a dollar sign will be prefixed to X.
|
---|
| 63 | ;;; X3.......Length of the desired output. If X3 is less than the formatted X,
|
---|
| 64 | ;;; X3 will be ignored. If X3 is not defined, then a length of 12
|
---|
| 65 | ;;; is used.
|
---|
| 66 | ;;;
|
---|
| 67 | ;;; 3. OUTPUT VARIABLES
|
---|
| 68 | ;;; X........The initial value of X formatted.
|
---|
| 69 | ;;; Examples of COMMA^%DTC output:
|
---|
| 70 | ;;; S X=12345.678 D COMMA^%DTC X=" 12,345.68 "
|
---|
| 71 | ;;; S X=9876.54,X2="0$" X=" $9,877 "
|
---|
| 72 | ;;; S X=-3,X2="2$" X=" ($3.00)"
|
---|
| 73 | ;;; S X=12345.678,X3=10 X="12,345.68 "
|
---|
| 74 | ;;;***
|
---|