Re: Data Input Editor Par

 BBS: Inland Empire Archive
Date: 02-05-93 (03:37)             Number: 397
From: RAYMOND KEITH                Refer#: NONE
  To: ERIC MAYS                     Recvd: NO  
Subj: Re: Data Input Editor Par      Conf: (2) Quik_Bas
The following Data Input Editor is copyrighted (c) by Raymond Keith 1992
1993. Anyone who finds it of use may inlcude it in their commercial or
non-commercial program for free. You need not include my name or any other
silly conditions often attached to code posted in this echo.

Parameters to pass to Input Editor

- InputCol% = 10 'Character column where input starts InputLin% = 80 'Pixel line where input starts TextColr% = 1792 'Text color. Mine is a graphics mode color code InputLen% = 10 'Length in characters of input field InputStr$ = SPACE$(10) 'Pad input string with spaces CurSpeed% = 1 'Code for rate of speed cursor blinks EndOfStr% = 0 'Count used for beeping when end of string reached EditMode% = 0 'Initial edit mode set to Insert On CursorLineOffset% = 14 'Offset from InputLine% to print blinking cursor CursorWidth% = 8 'Width of blinking cursor in pixel lines CursorLength% = 1 'Heigth of cusor in pixel lines CursorOnOff% = 0 'Initialy turn blinking cursor off ValCharCode% = 1 'Code for type of field being entered '1 = Any character from space to ~ (32) to (126) '2 = Date characters / through 9 '3 = Numeric with , and 0 to 9 '4 = Currency NOT fixed point $ , and 0 to 9 '5 = Currency with fixed point . $ , and 0 to 9 '6 = Floating point . , and 0 to 9 '7 = Yes or No Nn and Yy '8 = Phone with wild cards - ? and 0 to 9 SUB InputEditor (InputCol%, InputLin%, TextColr%, InputLen%, InputStr$,_ CurSpeed%, CursorPos%, EndOfStr%, EditMode%,_ CursorLineOffset%, CursorWidth%, CursorLength%,_ CursorOnOff%, ValCharCode%) 'Setup editor for type of field being entered. Here I use the concept of 'individual characters that are valid for a particular type of field and 'ranges of characters that are valid for a particular type of field. This 'version supports up to 4 individual characters and one range of 'characters. It could easily be expanded to support more if needed. DontUse$ = "000" SELECT CASE ValCharCode% CASE 1 Char1$ = DontUse$ Char2$ = DontUse$ Char3$ = DontUse$ Char4$ = DontUse$ GroupFrom$ = " " GroupTo$ = "~" CASE 2 Char1$ = DontUse$ Char2$ = DontUse$ Char3$ = DontUse$ Char4$ = DontUse$ GroupFrom$ = "/" GroupTo$ = "9" CASE 3 Char1$ = "," Char2$ = DontUse$ Char3$ = DontUse$ Char4$ = DontUse$ GroupFrom$ = "0" GroupTo$ = "9" CASE 4 Char1$ = "$" Char2$ = "," Char3$ = DontUse$ Char4$ = DontUse$ GroupFrom$ = "0" GroupTo$ = "9" CASE 5 Char1$ = "$" Char2$ = "," Char3$ = "." Char4$ = DontUse$ GroupFrom$ = "0" GroupTo$ = "9" CASE 6 Char1$ = "," Char2$ = "." Char3$ = DontUse$ Char4$ = DontUse$ GroupFrom$ = "0" GroupTo$ = "9" CASE 7 Char1$ = "Y" Char2$ = "y" Char3$ = "N" Char4$ = "n" GroupFrom$ = DontUse$ GroupTo$ = DontUse$ CASE 8 Char1$ = "-" Char2$ = "?" Char3$ = DontUse$ Char4$ = DontUse$ GroupFrom$ = "0" GroupTo$ = "9" END SELECT 'see part 2 --- DB 1.51/003468 * Origin: R/E Northwest (1:105/224)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET