home *** CD-ROM | disk | FTP | other *** search
- {$B-,D-,F-,I-,L+,N-,R-,S-,T-,V+} {TP4 directives}
-
- Unit Getvars;
-
- Interface
-
- Type
-
- DateType = (American,European,Japanese);
- YearType = (NY,YY,YYYY); {NY = 19YY}
- PlaceType = 0..10;
- plusbyte = 1..255;
- SymbolStr = string[12]; {US$, Mb, milliseconds, kilometres etc.}
- screen_text = string[255];
- numstring = string[40];
- ok_keys = set of char;
- CharsetName = string[13]; {'alphanumeric ' is longest, 12 + space}
-
- UserFormatRec = record
- UnitSymbol: SymbolStr;
- places: PlaceType;
- UnitFormat: $00..$0F; {bit mapped array, see UserFormatArray below}
- end;
-
-
- CharacterSetType = (Alphabetic,Alphanumeric,Numeric,Printable,YesAndNo,
- TrueOrFalse,FieldMarkers,AnyCharacter);
-
- CharSetRec = record
- CharacterSetName: CharSetName;
- CharSet: ok_keys;
- end;
-
-
- Const
-
- CharacterSet: array[Alphabetic..FieldMarkers] of CharSetRec =
- (
- (CharacterSetName: 'Alphabetic';
- CharSet: ['A'..'Z','a'..'z']),
- (CharacterSetName: 'Alphanumeric';
- CharSet: ['A'..'Z','a'..'z','0'..'9']),
- (CharacterSetName: 'Numeric';
- CharSet: ['0'..'9']),
- (CharacterSetName: 'Printable';
- CharSet: [' '..'~']),
- (CharacterSetName: 'Y or N';
- CharSet: ['Y','y','N','n']),
- (CharacterSetName: 'Boolean';
- CharSet: ['Y','y','N','n','+','-','T','F','t','f','1','0','√',' ']),
- (CharacterSetName: ''; {Field markers, name not used}
- CharSet: ['!', {@,} '#', '$', '%', '^', '&', '*',
- '(', ')', '_', '+', '|', '-', '=', '`',
- '{', '}', '[', ']', ':', ';', '"', '/',
- '<', '>', '?','B'])
- );
-
- {
- Note: DefaultAltSwitch, ShiftCharacter and RepeatCharacter should NOT be in
- the set of field markers
- }
-
- TotalUserFormats = 6;
-
- Unformatted = $00;
- SymbolFirst = $01;
- Commas = $02; {use ThousandsDelimiter, not necessarily a comma}
- Parentheses = $04;
- Financial = $06;
- SIdisplay = $08; {Système International format}
-
- SymbolFirst_Commas = $03;
- SymbolFirst_Parentheses = $05;
- SymbolFirst_Financial = $07;
-
- SI_SymbolFirst = $09;
- SI_Commas = $0A;
- SI_Parentheses = $0C;
- SI_Financial = $0E;
- SI_SymbolFirst_Commas = $0B;
- SI_SymbolFirst_Parentheses = $0D;
- SI_SymbolFirst_Financial = $0F;
-
-
- UserFormatArray: array[1..TotalUserFormats] of UserFormatRec =
-
- (
- (UnitSymbol: '$'; places: 2; UnitFormat: SymbolFirst_Commas),
- (UnitSymbol: '£'; places: 2; UnitFormat: SymbolFirst_Financial),
- (UnitSymbol: ' FFr'; places: 2; UnitFormat: SI_Financial),
- (UnitSymbol: ' SFr'; places: 2; UnitFormat: SI_Financial),
- (UnitSymbol: ' Km/sec'; places: 3; UnitFormat: unformatted),
- (UnitSymbol: ' Megahertz'; places: 3; UnitFormat: unformatted)
- );
- {
- Note:
-
- UnitSymbol should not include a '+' or '-' sign (it will be set to '').
-
- You should set up a series of suitably named constants to use with the
- getreal procedure so that you can pass the appropriate index value to
- it to select the required UserFormatRec. E.g.
-
- Const
-
- dollars = -1; sterling = -2; SwissFrancs = -3; etc.
-
- Simply substitute 'dollars' for -1 as a parameter where you would ordinarily
- enter a value for decimal_points (the negative value indicates to getreal
- that user formatting, using the appropriate entry in UserFormatArray, is
- requested).
-
- }
-
- Dollars = -1;
- Pounds = -2;
- FrenchFrancs = -3;
- SwissFrancs = -4;
- Kmpersec = -5;
- MHz = -6;
-
- YesLetter = 'Y';
- NoLetter = 'N';
- TrueChars = 'YyTt+1'; {need not include BooleanTrueChar}
- FalseChars = 'NnFf-0';
- BooleanTrueChar = '√'; {what to display for true}
- BooleanFalseChar = ' '; { and false}
- {
- Typed constants
- }
- CheckBreak : boolean = false; {true = allow ^Break}
-
- AutoTab : boolean = true; {skip to next field when field full}
- Escaped : boolean = false;
- FieldWrap : boolean = false; {wrap from 1st to last and vv}
- StringFieldWrap : boolean = false; {<- & -> exits string fields}
- ForceUppercase : boolean = false;
- Overwrite : boolean = false;
- PaintingFields : boolean = true;
- RightJustifyNumbers : boolean = true;
- SoundOn : boolean = true; {user switchable}
- Top_n_Tail : boolean = true; {trim leading & trailing spaces}
- ValidationOverride : boolean = false;
- ZeroAsBlank : boolean = false;
- ZeroFillNumbers : boolean = false;
- ErrorLineClear : boolean = true;
- Error2LineClear : boolean = true; {error lines 1,2 are clear T/F}
- PasswordField : boolean = false;
- RightJustifyNumberEntry: boolean = false;
- DateZeroAsBlank : boolean = true;
- TimeZeroAsBlank : boolean = true; {display hh:mm = ' : ' if 00:00}
- InsLock : boolean = false; {Insert mode locked off}
- RedisplayPrompts : boolean = false; {Don't redisplay when editing field}
-
- DateFormat : DateType = European;
- YearFormat : YearType = NY; {19YY}
-
- DecimalDefault : byte = 2; {default no. of decimal places for reals}
- BellTone : integer = 500;
- TabSize : byte = 8;
- ShiftCharacter : char = '\';
- RepeatCharacter : char = '@';
- DefaultAltSwitch : char = '~';
- DefaultDateSeparator : char = '/';
- SI_ThousandsDelimiter: char = '.'; {standard values are ' ' and '.'}
- PasswordChar : char = ' '; {character echoed during password entry}
- cp : byte = 1; {def starting cursor pos for string edits}
- {
- Video attributes, EGA colour assumed for default
- }
- RedAttr : byte = 79; {attribute for displaying negative reals}
- AttrNM : byte = 2; {normal video attribute}
- AttrBO : byte = 15; {bold video attribute}
- FieldCursor : byte = 112; {> 0 to override field attr when editing}
- PicCursor : byte = 127; { as above }
- Default_pattr : byte = 2;
- Default_dattr : byte = 15;
- Default_cursor_attr : byte = 32;
-
- {
- The following variables are to facilitate language independent error
- messages. Variables rather than constants are used in order to save
- code and stack space (constants are embedded in the code repeatedly if
- used repeatedly, with variables only the address is used).
-
- Note: typed constants are placed in the code segment.
- }
-
- Invalid_no_of_days_in_month : string = 'Invalid number of days in month';
- Invalid_month_number : string = 'Invalid month number';
- Press_a_numeric_key : string = 'Press a numeric key';
- No_privilege : string = 'No privilege';
- Default_is_invalid : string = 'Default is invalid';
- Invalid_key : string = 'Invalid key';
- Enter_a_number_between : string = 'Enter a number between ';
- Enter_either : string = 'Enter either ';
- Null_input_not_allowed : string = 'Null input not allowed';
- Fixed_length_input_required : string = 'Fixed length input required';
- Range_checking_suspended : string = 'Range checking suspended';
- Validation_suspended : string = 'Validation suspended';
- Number_must_be_in_range : string = 'Number must be in range: ';
- Outside_validation_range : string = ' outside validation range ';
- CharacterWord : string = ' character ';
- InputWord : string = ' input ';
- RequiredWord : string = 'required';
- NumberWord : string = 'Number ';
- AndWord : string = ' and ';
- ToWord : string = ' to ';
- OrWord : string = ' or ';
- SureYN : string = 'Sure ~Y~/~N~? '; {NB use DefaultAltSwitch}
- EnterYorN : string = 'Y or N ';
-
-
- Var
-
- LastVideoMode,
- VideoModeNow: byte;
-
- Implementation
-
- end.