Announcement

Collapse
No announcement yet.

Sample Data Entry Screen Wanted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sample Data Entry Screen Wanted

    I am new to PowerBasic for DOS and am interested in writing various
    data entry screens for a number of reasons such as personal
    contacts, expenses, and many other database applications.
    I am looking for sample source code for any application written in PowerBasic
    that demonstrates the use of data entry preferably one that has a
    graphical user interface. My intent is to study the sample code and
    build from it. I have been looking for books that have
    tutorials but have had no luck in finding them. If you can send me any
    sample source code I would GREATLY appreciate it and the name of a good book.

    Sincerely,

    Yuri Signori

    ------------------

  • #2
    Hi Yuri. Welcome to the wonderful world of PB/DOS.

    First of all, IMO, try to avoid a GUI in PB/DOS. Although a
    well built GUI looks great, in reality it adds nothing to the
    functionality of the program and detracts greatly due to the
    fact it it uses CPU cycles that could be better utilized
    elsewhere.

    Assuming you want data entry from the keyboard, the simplest
    form would be to use the Line Input statement.

    row = 5
    col = 10
    locate row,col
    Line Input,"Last Name: ";lastname$

    I have found it better to use Line Input instead of the plain
    'ol Input statement due to the fact that Input has a problem
    with entrys that include the comma. If you enter, for example,
    "Smith, John", an input statement would have to appear:

    Input "Enter Name: ";lastname$,firstname$

    Whereas Line Input takes everything up to the point where you
    press end Enter key.

    Hopes this gets you started. Good luck.


    ------------------
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      I think PB/Vision is not longer offered but if you can get it it
      works great for creating a nice GUI interface.

      I have to disagree with Mel, a good GUI makes a world of difference
      and steals very little or no CPU cycles.

      ------------------
      Every day I try to learn one thing new,
      but new things to learn are increasing exponentially.
      At this rate I’m becoming an idiot faster and faster !!!
      ------------------
      George W. Bleck
      Lead Computer Systems Engineer
      KeySpan Corporation
      My Email
      <b>George W. Bleck</b>
      <img src='http://www.blecktech.com/myemail.gif'>

      Comment


      • #4
        Pb-vision is not GUI, it's Text Base made to look like GUI, and
        it's still offered in the products department. $20

        ------------------

        Comment


        • #5

          hi yuri,
          there's egui, which is a truly graphical gui builder. there was
          no charge for the then-current version, when it was announced: http://www.powerbasic.com/support/pb...ead.php?t=1353

          here's the download site: http://www.tgh3.com/

          tony burcham


          ------------------
          TheirCorp's projects at SourceForge

          TheirCorp's website

          sigpic

          Comment


          • #6
            Hi, folks -

            To throw some weight to both sides of the argument here, let me
            explain a little about the app I've been working on again.

            When I initially came onboard this project, it was to design
            and implement a proprietary database according to my client's
            parameters.

            In so doing, I had to use their existing input screens.

            In some cases, the data entry screens are extremely useful,
            in others, they makes little difference. By "extremely
            useful", I mean that the User is much less error-prone while
            putting data in while using the screens, whereas if monochrome
            text were scrolling by as the data were being entered, there
            would be many more errors as the data was typed in.

            However, much of the execution time for the app is spent
            constructing (and reconstructing) these screens, and a lot of
            my debugging time is wasted by them as well (even with
            breakpoints available) when I trace execution.

            So, in general, I'm kind of ambivalent about this issue. I
            think it's more important to give the customer what they'll pay
            for. If they need data entry screens IOT reduce data entry
            error rates, then I'll write them for the customer. If it's
            some tool I'm writing for personal use that's also going to go
            out as shareware, I'll probably leave it more generic.

            As always, folks - USE THE RIGHT TOOL FOR THE JOB

            (Hey, how did I get up on this soap box?)


            Kurt Schultz


            ------------------
            Don't sweat it, it's only ones and zeros

            Comment


            • #7
              Hello, Yuri -

              One of the most useful books I've used is "The Programmer's
              Problem Solver". My edition (the Second Edition) is 11 years
              old now.

              There was one other book that had the source code for some kind
              of User Input Screen. I think it might have been "Advanced
              TurboBASIC". If so, that book would be hard to find now.

              One of the other good resources was a free thing: the ABC
              ("All BASIC Code") newsletter. It wasn't much news, but they
              distributed a lot of code, and showed parallel ways of doing
              things in different BASICs. I don't know if it's available on
              the internet anywhere, but it's likely in someone's archives;
              it would be worthwhile to run a search for "all basic code" and
              see if you get hits. If you can't find it, let me know & I can
              send you copies of mine. Try to find it on the 'net first, so
              you can get a complete copy (I'm pretty sure my copy is not
              complete).


              Kurt Schultz


              ------------------
              Don't sweat it, it's only ones and zeros

              Comment


              • #8
                hello all
                i have written serveral routines and would be glad to share to give back
                some of the time given tom back.
                i have routines for inputting only numbers with decimal placement limitations
                and routines for any characters
                and routines for characters that you limit the input to.
                i am just now converting some code to PB3.5 from cbasic
                i just want to look over my work as it is 99% complete
                i will post it on july 11,2003

                oh what the hell
                here it is now
                notice that i convert all my characters to uppercase
                also the input routine will add two special characters to the front
                of the returned string
                a carret if a function key was pressed and a second character for what function key
                so "^A" is function key F1, "^B" is function key F2
                F11 AND F12 ARE NOT USED
                ^T IS SHIFTED F10

                ALSO VERY IMPORTANT
                ANSI.SYS HAS TO BE LOADED IN THE CONFIG.SYS(CONFIG.NT)

                the down arrow key is treated as a carriage turn
                if you press escape key it will bring back the original text
                these inputs are designed for only one line


                GOOD LUCK
                paul

                rem ----------------------------------------------------------------------------------------------------------------
                rem first two input routines input routine
                rem ----------------------------------------------------------------------------------------------------------------

                REM INPUTPC.PBS
                REM SOURCE FOR POWERBASIC DOS COMPILER
                REM FUNCTIONS FOR INPUT
                REM TO DECLARE FUNCTIONINE EXTERNAL FUNCTIONS USED

                REM TO MOVE THE CRT TO THE RIGHT ONE SPACE OR A NUMBER OF SPACES
                FUNCTION CRTRIGHT(NUMBER%)
                WHILE NUMBER%
                STDOUT CHR$(27)+"[C";
                NUMBER%=NUMBER%-1
                WEND
                END FUNCTION

                REM TO MOVE THE CRT TO THE LEFT ONE SPACE OR A NUMBER OF SPACES
                FUNCTION CRTLEFT(NUMBER%)
                WHILE NUMBER%
                STDOUT CHR$(27)+"[D";
                NUMBER%=NUMBER%-1
                WEND
                END FUNCTION

                REM ROUTINE FOR INPUT OF A STRING WITH MAX LENGTH SPECIFIED

                FUNCTION INPUTSTRING$(DEFAULT$,LENGTH%) PUBLIC

                REM RSTRING$ IS THE RETURNED STRING
                REM STRFORM$ IS THE VALID INPUT CHARACTER IN STRING
                REM TEMP$ IS A TEMPORARY STRING FOR INSERT AND DELETE FUNCTIONS OF
                REM THE STRING
                REM NULL$ AND NULL% AREVARIABLES TO DEALLOCATE THE VARIABLES USED
                REM AT THE END OF THE FUNCTION
                REM DEFAULT$ IS THE STRING BEING GIVEN TO OPERATE ON AT START OF
                REM THE PROGRAM
                REM CCHAR% IS THE FIRST ASCII DECIMAL OF KEY PRESSED
                REM COUNTER% IS THE LENGTH OF THE STRING BEING INPUT AND NOT THE
                REM MAX LENGTH THAT CAN BE USED
                REM POSITION% IS THE POSITION OF THE CURSOR ON THE INPUT LINE
                REM POSITION% ALWAYS STARTS A 1(ONE)
                REM LENGTH% IS THE MAX LENGTH YOU WANT THE STRING

                1
                RSTRING$=DEFAULT$

                2
                PRINT RSTRING$;
                PRINT STRING$(LENGTH%-LEN(RSTRING$),"_");
                CRTLEFT(LENGTH%)
                COUNTER%=LEN(RSTRING$)+1
                POSITION%=1

                REM START OF INPUTTING HERE
                GOTO 10


                3
                IF CCHAR%=13 GOTO 50
                IF CCHAR%=0 THEN GOTO 30


                IF CCHAR%>31 AND CCHAR%<127 THEN GOTO 5

                IF CCHAR%=8 AND POSITION%=1 AND COUNTER%=1 THEN GOTO 1

                IF CCHAR%=8 AND COUNTER%-1=LEN(RSTRING$) AND POSITION%=COUNTER% THEN
                CRTLEFT(1)
                PRINT "_";
                CRTLEFT(1)
                COUNTER%=COUNTER%-1
                RSTRING$=LEFT$(RSTRING$,COUNTER%-1)
                POSITION%=COUNTER%
                GOTO 10
                END IF

                IF CCHAR%=27 THEN CRTLEFT(POSITION%-1):GOTO 1

                GOTO 10


                5
                IF POSITION%>LENGTH% THEN GOTO 50

                STRFORM$=UCASE$(CHR$(CCHAR%))

                IF POSITION%=COUNTER% THEN
                PRINT STRFORM$;
                RSTRING$=RSTRING$+STRFORM$
                COUNTER%=COUNTER%+1
                POSITION%=POSITION%+1
                GOTO 10
                ELSEIF LEN(RSTRING$)=POSITION% THEN
                TEMP$=""
                ELSE
                TEMP$=MID$(RSTRING$,POSITION%+1,(LEN(RSTRING$)-POSITION%))
                END IF

                PRINT STRFORM$;
                PRINT TEMP$;
                CRTLEFT(LEN(TEMP$))
                RSTRING$=LEFT$(RSTRING$,POSITION%-1)+STRFORM$+TEMP$
                POSITION%=POSITION%+1
                10
                IF POSITION%>LENGTH% THEN GOTO 50

                CCHAR$=INKEY$
                IF LEN(CCHAR$)=0 THEN GOTO 10
                CCHAR%=ASC(CCHAR$,1)

                GOTO 3

                REM ROUTINE TO FIND FUNCTION AND CONTROL KEYS SECOND VALUE


                30
                CCHAR%=ASC(CCHAR$,2)

                IF CCHAR%=75 AND POSITION%>1 THEN
                CRTLEFT(1)
                POSITION%=POSITION%-1
                GOTO 10
                END IF

                IF CCHAR%=77 AND POSITION%<COUNTER% THEN
                CRTRIGHT(1)
                POSITION%=POSITION%+1
                GOTO 10
                END IF

                IF CCHAR%=72 THEN CONTROL$="^U":GOTO 50
                IF CCHAR%=80 THEN CONTROL$="^V":GOTO 50
                IF CCHAR%=71 THEN CONTROL$="^W":GOTO 50

                IF CCHAR%<>82 THEN GOTO 31
                IF COUNTER%=POSITION% OR COUNTER%>LENGTH% THEN
                GOTO 10
                ELSE
                TEMP$=CHR$(32)+RIGHT$(RSTRING$,COUNTER%-POSITION%)
                COUNTER%=COUNTER%+1
                PRINT TEMP$;
                CRTLEFT(LEN(TEMP$))
                RSTRING$=LEFT$(RSTRING$,POSITION%-1)+TEMP$
                GOTO 10
                END IF

                31
                IF CCHAR%<>83 THEN GOTO 32
                IF COUNTER%=POSITION% OR POSITION%>LENGTH% THEN
                GOTO 10
                ELSE
                TEMP$=RIGHT$(RSTRING$,COUNTER%-POSITION%-1)
                COUNTER%=COUNTER%-1
                PRINT TEMP$;
                PRINT "_";
                CRTLEFT(LEN(TEMP$)+1)
                RSTRING$=LEFT$(RSTRING$,POSITION%-1)+TEMP$
                IF COUNTER%<POSITION% THEN POSITION%=COUNTER%
                END IF


                32
                IF CCHAR%=117 THEN
                RSTRING$=NULL$
                CRTLEFT(POSITION%-1)
                GOTO 2
                END IF

                IF CCHAR%<59 OR CCHAR%>68 THEN
                IF CCHAR%<84 OR CCHAR%>93 THEN
                GOTO 10
                END IF
                END IF

                IF CCHAR%>58 and CCHAR%<69 THEN
                CONTROL$=CHR$(94)+CHR$(CCHAR%+6):GOTO 50
                END IF

                IF CCHAR%>83 and CCHAR%<94 THEN
                CONTROL$=CHR$(94)+CHR$(CCHAR%-9)
                END IF

                50
                INPUTSTRING$=CONTROL$+RSTRING$
                CRTRIGHT(COUNTER%-POSITION%)
                PRINT STRING$(LENGTH%-COUNTER%+1," ");
                TEMP$=NULL$
                RSTRING$=NULL$
                STRFORM$=NULL$
                CONTROL$=NULL$
                CCHAR%=NULL%
                COUNTER%=NULL%
                POSITION%=NULL%
                LENGTH%=NULL%


                END FUNCTION

                REM ROUTINE TO SCANN NUMBER INPUT WITH DECIMALS INPUT IS A STRING
                FUNCTION INPUTNUMBER$(DEFAULT$,LENGTH%,DECIMALS%) PUBLIC
                111
                RSTRING$=DEFAULT$
                122
                PRINT RSTRING$;
                PRINT STRING$(LENGTH%-LEN(RSTRING$),"_");
                CRTLEFT(LENGTH%)
                COUNTER%=1
                CONTROL$=""
                DECIMALSPOS%=0

                GOTO 150
                125

                IF CCHAR%=13 GOTO 199

                IF CCHAR%=0 THEN GOTO 160

                IF CCHAR%=8 AND COUNTER%=1 THEN GOTO 150

                IF CCHAR%=8 AND COUNTER%=2 THEN
                CRTLEFT(1)
                RSTRING$=""
                GOTO 122
                END IF

                IF CCHAR%=8 THEN
                CRTLEFT(1)
                PRINT "_";
                CRTLEFT(1)
                COUNTER%=COUNTER%-1
                RSTRING$=LEFT$(RSTRING$,COUNTER%-1)
                GOTO 150
                END IF

                IF CCHAR%=27 THEN CRTLEFT(COUNTER%-1):GOTO 111

                IF CCHAR%=46 THEN IF DECIMALS%=0 OR DECIMALSPOS%<>0 THEN GOTO 150 ELSE DECIMALSPOS%=COUNTER%:GOTO 149

                IF DECIMALSPOS%>0 AND COUNTER%>DECIMALSPOS%+DECIMALS% THEN GOTO 150
                IF COUNTER%>LENGTH% THEN GOTO 150

                IF CCHAR%=45 THEN
                IF COUNTER%=1 THEN
                GOTO 149
                ELSE
                GOTO 150
                END IF
                END IF

                IF CCHAR%<48 OR CCHAR%>57 THEN GOTO 150
                149
                IF COUNTER%=1 THEN
                RSTRING$=""
                PRINT STRING$(LENGTH%,"_");
                CRTLEFT(LENGTH%)
                END IF

                COUNTER%=COUNTER%+1
                PRINT CHR$(CCHAR%);
                RSTRING$=RSTRING$+CHR$(CCHAR%)

                150
                IF COUNTER%-1<DECIMALSPOS% THEN DECIMALSPOS%=0

                151
                CCHAR$=INKEY$
                IF LEN(CCHAR$)=0 THEN GOTO 151
                CCHAR%=ASC(CCHAR$,1)

                GOTO 125

                REM ENDING TO THE ROUTINE HERE AND ALSO CHECKS FINAL VALUES IN STRING

                160
                CCHAR%=ASC(CCHAR$,2)


                IF CCHAR%=75 THEN CCHAR%=8:GOTO 151
                IF CCHAR%=117 THEN RSTRING$=NULL$:CRTLEFT(COUNTER%-1):GOTO 122
                IF COUNTER%<>1 THEN GOTO 150
                IF CCHAR%=72 THEN CONTROL$="^U":GOTO 199
                IF CCHAR%=80 THEN GOTO 199
                IF CCHAR%=71 THEN CONTROL$="^W":GOTO 199

                IF CCHAR%<59 OR CCHAR%>68 THEN
                IF CCHAR%<84 OR CCHAR%>93 THEN
                GOTO 150
                END IF
                END IF

                IF CCHAR%>58 and CCHAR%<69 THEN
                CONTROL$=CHR$(94)+CHR$(CCHAR%+6)
                GOTO 199
                END IF

                IF CCHAR%>83 and CCHAR%<94 THEN
                CONTROL$=CHR$(94)+CHR$(CCHAR%-9)
                END IF

                199

                IF LEN(RSTRING$)=0 THEN RSTRING$="0"

                IF INSTR(1,RSTRING$,ANY "0123456789")=0 THEN CRTLEFT(LEN(RSTRING$)):GOTO 111

                IF COUNTER%=1 THEN CRTRIGHT(LEN(RSTRING$))

                PRINT STRING$(LENGTH%-LEN(RSTRING$)," ");
                RSTRING$=CONTROL$+RSTRING$
                INPUTNUMBER$=RSTRING$
                RSTRING$=NULL$
                CONTROL$=NULL$
                CCHAR%=NULL%
                COUNTER%=NULL%
                LENGTH%=NULL%
                DECIMALS%=NULL%
                DECIMALSPOS%=NULL%

                END FUNCTION

                rem -----------------------------------------------------------
                rem routine that allows on limit characters
                rem ------------------------------------------------------------
                REM INPUTPCK.PBS
                REM SOURCE FOR POWERBASIC DOS COMPILER
                REM FUNCTIONS FOR CONTROLED INPUT
                REM TO DEFINE EXTERNAL FUNCTIONS USED
                FUNCTION CRTRIGHT(NUMBER%)
                WHILE NUMBER%
                STDOUT CHR$(27)+"[C";
                NUMBER%=NUMBER%-1
                WEND
                END FUNCTION

                REM TO MOVE THE CRT TO THE LEFT ONE SPACE OR A NUMBER OF SPACES
                FUNCTION CRTLEFT(NUMBER%)
                WHILE NUMBER%
                STDOUT CHR$(27)+"[D";
                NUMBER%=NUMBER%-1
                WEND
                END FUNCTION

                REM ROUTINE FOR INPUT OF A STRING WITH MAX LENGTH SPECIFIED

                FUNCTION INPUTCHECKER$(DEFAULT$,LENGTH%,TESTCHAR$) PUBLIC
                REM RSTRING$ IS THE RETURNED STRING
                REM STRFORM$ IS THE VALID INPUT CHARACTER IN STRING
                REM TEMP$ IS A TEMPORARY STRING FOR INSERT AND DELETE FUNCTIONS OF
                REM THE STRING
                REM NULL$ AND NULL% ARE VARIABLES TO DEALLOCATE THE VARIABLES USED
                REM AT THE END OF THE FUNCTION
                REM DEFAULT$ IS THE STRING BEING GIVEN TO OPERATE ON AT START OF
                REM THE PROGRAM
                REM CCHAR% IS THE FIRST ASCII DECIMAL OF KEY PRESSED
                REM COUNTER% IS THE LENGTH OF THE STRING BEING INPUT AND NOT THE
                REM MAX LENGTH THAT CAN BE USED
                REM POSITION% IS THE POSITION OF THE CURSOR ON THE INPUT LINE
                REM POSITION% ALWAYS STARTS A 1(ONE)
                REM LENGTH% IS THE MAX LENGTH YOU WANT THE STRING
                1
                RSTRING$=DEFAULT$
                2
                PRINT RSTRING$;
                PRINT STRING$(LENGTH%-LEN(RSTRING$),"_");
                CRTLEFT(LENGTH%)
                COUNTER%=LEN(RSTRING$)+1
                POSITION%=1

                REM START OF INPUTTING HERE
                GOTO 10
                3
                IF CCHAR%=13 GOTO 99

                IF CCHAR%=0 THEN GOTO 30

                IF CCHAR%=32 AND POSITION%=1 THEN GOTO 10

                IF CCHAR%>31 AND CCHAR%<127 THEN GOTO 5

                IF CCHAR%=8 AND POSITION%=1 AND COUNTER%=1 THEN GOTO 1

                IF CCHAR%=8 AND COUNTER%-1=LEN(RSTRING$) AND POSITION%=COUNTER% THEN
                CRTLEFT(1)
                PRINT "_";
                CRTLEFT(1)
                COUNTER%=COUNTER%-1
                RSTRING$=LEFT$(RSTRING$,COUNTER%-1)
                POSITION%=COUNTER%
                GOTO 10
                END IF

                IF CCHAR%=27 THEN CRTLEFT(POSITION%-1):GOTO 1

                GOTO 10

                5
                IF POSITION%>LENGTH% THEN GOTO 10

                STRFORM$=UCASE$(CHR$(CCHAR%))

                TEST%=INSTR(1,TESTCHAR$,STRFORM$)

                IF TEST%=0 THEN GOTO 10

                IF POSITION%=COUNTER% THEN
                PRINT STRFORM$;
                RSTRING$=RSTRING$+STRFORM$
                COUNTER%=COUNTER%+1
                POSITION%=POSITION%+1
                GOTO 10
                END IF

                IF LEN(RSTRING$)=POSITION% THEN
                TEMP$=""
                ELSE
                TEMP$=MID$(RSTRING$,POSITION%+1,LEN(RSTRING$)-POSITION%)
                END IF
                PRINT STRFORM$;
                PRINT TEMP$;
                CRTLEFT(LEN(TEMP$))
                RSTRING$=LEFT$(RSTRING$,POSITION%-1)+STRFORM$+TEMP$
                POSITION%=POSITION%+1

                10

                IF POSITION%>LENGTH% THEN GOTO 99

                11
                CCHAR$=INKEY$
                IF LEN(CCHAR$)=0 THEN GOTO 11
                CCHAR%=ASC(CCHAR$,1)
                GOTO 3

                rem ENDING TO THE ROUTINE HERE

                GOTO 99

                rem ROUTINE TO FIND FUNCTION AND CONTROL KEYS SECOND VALUE
                30
                CCHAR%=ASC(CCHAR$,2)

                IF CCHAR%=75 AND POSITION%>1 THEN
                CRTLEFT(1)
                POSITION%=POSITION%-1
                GOTO 10
                END IF

                IF CCHAR%=77 AND POSITION%<COUNTER% THEN
                CRTRIGHT(1)
                POSITION%=POSITION%+1
                GOTO 10
                END IF

                IF CCHAR%=72 THEN CONTROL$="^U":GOTO 99
                IF CCHAR%=80 THEN CONTROL$="^V":GOTO 99
                IF CCHAR%=71 THEN CONTROL$="^W":GOTO 99
                IF CCHAR%=73 THEN CONTROL$="^X":GOTO 99
                IF CCHAR%=81 THEN CONTROL$="^Y":GOTO 99

                IF CCHAR%=82 AND COUNTER%=POSITION% THEN GOTO 10
                IF CCHAR%=82 AND COUNTER%>LENGTH% THEN GOTO 10

                IF CCHAR%=82 THEN
                TEMP$=CHR$(32)+RIGHT$(RSTRING$,COUNTER%-POSITION%)
                COUNTER%=COUNTER%+1
                PRINT TEMP$;
                CRTLEFT(LEN(TEMP$))
                RSTRING$=LEFT$(RSTRING$,POSITION%-1)+TEMP$
                GOTO 10
                END IF

                IF CCHAR%=83 AND COUNTER%=POSITION% THEN GOTO 10
                IF CCHAR%=83 AND POSITION%>LENGTH% THEN GOTO 10

                IF CCHAR%=83 THEN
                TEMP$=RIGHT$(RSTRING$,COUNTER%-POSITION%-1)
                COUNTER%=COUNTER%-1
                PRINT TEMP$;
                PRINT "_";
                CALL CRTLEFT(LEN(TEMP$)+1)
                RSTRING$=LEFT$(RSTRING$,POSITION%-1)+TEMP$
                END IF

                IF CCHAR%=83 AND COUNTER%<POSITION% THEN POSITION%=COUNTER%


                IF CCHAR%=117 THEN
                RSTRING$=NULL$
                CRTLEFT(POSITION%-1)
                GOTO 2
                END IF


                IF CCHAR%<59 OR CCHAR%>68 THEN
                IF CCHAR%<84 OR CCHAR%>93 THEN
                GOTO 10
                END IF
                END IF


                IF CCHAR%>58 and CCHAR%<69 THEN
                CONTROL$=CHR$(94)+CHR$(CCHAR%+6)
                GOTO 99
                END IF

                IF CCHAR%>83 and CCHAR%<94 THEN
                CONTROL$=CHR$(94)+CHR$(CCHAR%-9)
                END IF

                99
                INPUTCHECKER$=CONTROL$+RSTRING$
                CRTRIGHT(COUNTER%-POSITION%)
                PRINT STRING$(LENGTH%-COUNTER%+1," ");

                TEMP$=NULL$
                RSTRING$=NULL$
                STRFORM$=NULL$
                CONTROL$=NULL$
                TESTCHAR$=NULL$
                CCHAR$=NULL$
                CCHAR%=NULL%
                COUNTER%=NULL%
                POSITION%=NULL%
                LENGTH%=NULL%
                TEST%=NULL%

                END FUNCTION


                ------------------
                p purvis

                Comment


                • #9
                  Originally posted by Yuri (NMI) Signori:
                  I am new to PowerBasic for DOS and am interested in writing various
                  data entry screens for a number of reasons such as personal
                  contacts, expenses, and many other database applications.
                  I am looking for sample source code for any application written in PowerBasic
                  that demonstrates the use of data entry preferably one that has a
                  graphical user interface. My intent is to study the sample code and
                  build from it. I have been looking for books that have
                  tutorials but have had no luck in finding them. If you can send me any
                  sample source code I would GREATLY appreciate it and the name of a good book.
                  Hello Yuri,

                  I've just gone through moving some DOS base programs up to PBCC3.02
                  and found the source code available from "Full Power Toolbox" http://www.infoms.com/fptbx.htm

                  This code set has a lot of neat features that are handy for both
                  DOS screens, if you get that version or PBCC3.02.

                  Once you've got the form handling completed, consider Jerry Feilden's http://fieldens.tripod.com/

                  Jerry's screen painter makes simple work of laying screens that
                  would take a lot of effort any other way.


                  ------------------
                  Roger...
                  (Mail to rdrines at SpamCop dot Net)
                  Roger...

                  Comment


                  • #10
                    i would like to reply once more.
                    be sure when using the locate function in pb/dos
                    you do not forget to turn the cursor on
                    i spent 5 hours tring to do that 2 days ago
                    ha ha ha.
                    to locate to line 5 column 10 and use the cusor is
                    LOCATE 5,10,1
                    without the cursor
                    LOCATE 5,10,0
                    OR LOCATE 5,10

                    On my routines when you press ctrl-end it clears out the input line

                    escape replaces any strings that where given the function so you can
                    edit the line and replace the original string if one was pass to
                    the function

                    if you press delete key it will delete a key

                    if you press insert it will insert a space

                    my function does not have a so called insert mode

                    if the cursor is on the last character a backspace key will delete
                    the last character you entered

                    also i think on the function inputchecker it might not let you enter
                    a space if it is the first character

                    most of my functions convert characters to uppercase
                    before i use the functions i usually assign variables like this

                    TESTCHAR$="ABCD......XYZ 123456789?/\()" or whatever you want to enter
                    if you take out the uppercase be sure to add lower case letters in the testchar$ string
                    length%=25 i usually do not go past 79 characters
                    default$="" or default$= some other variable like
                    vehicletype$="TRUCK"
                    default$=vehicletype$

                    on the number function
                    it will let you add a minus sign just before the number
                    i use a lot of dollar inputs so i might use something like
                    decimals%=2
                    length%=10
                    default$=""
                    or default$ can be assigned some other variable

                    i test the returned variable for being negative or some other range after the
                    string is returned by the number function

                    remember my programs do not put a carret in the returned string
                    unless some kind of a key is pressed other than the return key
                    also i only let a few function keys pass through as it screens for them

                    if i can be of any help to anybody please let me know

                    i will not be on this site until after july 10,2003

                    paul


                    ------------------
                    p purvis

                    Comment


                    • #11
                      Hi

                      the ABC archives are available for free download at
                      www.allbasiccode.com

                      and I highly recommend them for referencing how to do
                      just about anything in basic.

                      Buck


                      ------------------

                      Comment

                      Working...
                      X