Announcement

Collapse
No announcement yet.

how do you control order of input entries in ddt textboxs?

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

  • how do you control order of input entries in ddt textboxs?

    I have a program that needs numbers entered into a gui.
    I want do not want the user to just be able to focus(use) any textbox they please. I want ordered entry like you would have with most msdos interfaces.

    How can i do that, maybe there is an example out there but i cannot seem to find any.

    I was able to use CONTROL DISABLE to keep people from accessing a textbox.
    I will try also to implement a return for input of text boxes.
    I believe if i where given a general description, i could follow that.

    the program i am working on is listed below as example as a picture is worth a thousand words

    i am doing my best to learn this gui stuff and it is really hard to learn all those type messages placed into a callback and properties on controls and dialogs down.

    Thanks in advance
    paul

    Code:
    'compiled with pbwin 8.04
    #PBFORMS CREATED V1.51
    '------------------------------------------------------------------------------
    ' The first line in this file is a PB/Forms metastatement.
    ' It should ALWAYS be the first line of the file. Other
    ' PB/Forms metastatements are placed at the beginning and
    ' end of "Named Blocks" of code that should be edited
    ' with PBForms only. Do not manually edit or delete these
    ' metastatements or PB/Forms will not be able to reread
    ' the file correctly.  See the PB/Forms documentation for
    ' more information.
    ' Named blocks begin like this:    #PBFORMS BEGIN ...
    ' Named blocks end like this:      #PBFORMS END ...
    ' Other PB/Forms metastatements such as:
    '     #PBFORMS DECLARATIONS
    ' are used by PB/Forms to insert additional code.
    ' Feel free to make changes anywhere else in the file.
    '------------------------------------------------------------------------------
    
    #COMPILE EXE
    #DIM ALL
    
    '------------------------------------------------------------------------------
    '   ** Includes **
    '------------------------------------------------------------------------------
    #PBFORMS BEGIN INCLUDES
    #IF NOT %DEF(%WINAPI)
        #INCLUDE "WIN32API.INC"
    #ENDIF
    #PBFORMS END INCLUDES
    '------------------------------------------------------------------------------
    
    '------------------------------------------------------------------------------
    '   ** Constants **
    '------------------------------------------------------------------------------
    #PBFORMS BEGIN CONSTANTS
    %IDD_DIALOG1   =  101
    %IDC_TEXTBOX1  = 1001
    %IDC_TEXTBOX2  = 1002
    %IDC_TEXTBOX3  = 1003
    %IDC_TEXTBOX4  = 1004
    %IDC_TEXTBOX5  = 1005
    %IDC_TEXTBOX6  = 1006
    %IDC_TEXTBOX7  = 1007
    %IDC_TEXTBOX8  = 1008
    %IDC_TEXTBOX9  = 1009
    %IDC_TEXTBOX10 = 1010
    %IDC_TEXTBOX11 = 1011
    %IDC_TEXTBOX12 = 1012
    %IDC_TEXTBOX13 = 1013
    %IDC_TEXTBOX14 = 1014
    %IDC_TEXTBOX15 = 1015
    %IDC_TEXTBOX16 = 1016
    %IDC_TEXTBOX17 = 1017
    %IDC_TEXTBOX18 = 1018
    %IDC_TEXTBOX19 = 1019
    %IDC_TEXTBOX20 = 1020
    %IDC_TEXTBOX21 = 1021
    %IDC_TEXTBOX22 = 1022
    %IDC_LABEL1  = 2001
    %IDC_LABEL2  = 2002
    %IDC_LABEL3  = 2003
    %IDC_LABEL4  = 2004
    %IDC_LABEL5  = 2005
    %IDC_LABEL6  = 2006
    %IDC_LABEL7  = 2007
    %IDC_LABEL8  = 2008
    %IDC_LABEL9  = 2009
    %IDC_LABEL10 = 2010
    %IDC_LABEL11 = 2011
    %IDC_LABEL12 = 2012
    %IDC_LABEL13 = 2013
    %IDC_LABEL14 = 2014
    %IDC_LABEL15 = 2015
    %IDC_LABEL16 = 2016
    %IDC_LABEL17 = 2017
    %IDC_LABEL18 = 2018
    %IDC_LABEL19 = 2019
    %IDC_LABEL20 = 2020
    %IDC_LABEL21 = 2021
    %IDC_LABEL22 = 2022
    
    
    #PBFORMS END CONSTANTS
    '------------------------------------------------------------------------------
    GLOBAL hGTFONT AS LONG
    
    
    
    FUNCTION MakeFont(BYVAL FFont AS STRING, BYVAL PointSize AS LONG) AS LONG
      LOCAL hDC      AS LONG
      LOCAL CyPixels AS LONG
      hDC = GetDC(%HWND_DESKTOP)
      CyPixels  = GetDeviceCaps(hDC, %LOGPIXELSY)
      ReleaseDC %HWND_DESKTOP, hDC
      PointSize = (PointSize * CyPixels) \ 72
      FUNCTION = CreateFont(0 - PointSize, 0, 0, 0, %FW_NORMAL, 0, 0, 0, _
                %ANSI_CHARSET, %OUT_TT_PRECIS, %CLIP_DEFAULT_PRECIS, _
                %DEFAULT_QUALITY, %FF_DONTCARE, BYCOPY FFont)
    END FUNCTION
    
    '------------------------------------------------------------------------------
    '   ** Declarations **
    '------------------------------------------------------------------------------
    DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
    DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
    #PBFORMS DECLARATIONS
    '------------------------------------------------------------------------------
    
    '------------------------------------------------------------------------------
    '   ** Main Application Entry Point **
    '------------------------------------------------------------------------------
    FUNCTION PBMAIN()
        ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION
    '------------------------------------------------------------------------------
    
    '------------------------------------------------------------------------------
    '   ** CallBacks **
    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG1Proc()
    
        SELECT CASE AS LONG CBMSG
            CASE %WM_INITDIALOG
                ' Initialization handler
    
            CASE %WM_NCACTIVATE
                STATIC hWndSaveFocus AS DWORD
                IF ISFALSE CBWPARAM THEN
                    ' Save control focus
                    hWndSaveFocus = GetFocus()
                ELSEIF hWndSaveFocus THEN
                    ' Restore control focus
                    SetFocus(hWndSaveFocus)
                    hWndSaveFocus = 0
                END IF
    
            CASE %WM_COMMAND
                ' Process control notifications
                SELECT CASE AS LONG CBCTL
                    CASE %IDC_TEXTBOX1
                    CASE %IDC_TEXTBOX2
                    CASE %IDC_TEXTBOX3
                    CASE %IDC_TEXTBOX4
                    CASE %IDC_TEXTBOX5
                    CASE %IDC_TEXTBOX6
                    CASE %IDC_TEXTBOX7
                    CASE %IDC_TEXTBOX8
                    CASE %IDC_TEXTBOX9
                    CASE %IDC_TEXTBOX10
                    CASE %IDC_TEXTBOX11
                    CASE %IDC_TEXTBOX12
                    CASE %IDC_TEXTBOX13
                    CASE %IDC_TEXTBOX14
                    CASE %IDC_TEXTBOX15
                    CASE %IDC_TEXTBOX16
                    CASE %IDC_TEXTBOX17
                '   CASE %IDC_TEXTBOX18
                '   CASE %IDC_TEXTBOX19
                '   CASE %IDC_TEXTBOX20
                '   CASE %IDC_TEXTBOX21
                '   CASE %IDC_TEXTBOX22
    
                END SELECT
        END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------
    
    '------------------------------------------------------------------------------
    '   ** Dialogs **
    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        LOCAL lRslt AS LONG
        'changed font size
     ' DIALOG FONT "ARIAL",8
    #PBFORMS BEGIN DIALOG %IDD_DIALOG1->->
        LOCAL hDlg  AS DWORD
    
        DIALOG NEW hParent, "data inputr", 70, 70, 294, 240, _
            %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_THICKFRAME OR _
            %WS_SYSMENU OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR _
            %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CONTROLPARENT _
            OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO _
            hDlg
    
    
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "", 1, 13, 74, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX2, "", 92, 13, 106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX3, "", 1, 27, 74, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX4, "", 92, 27, 106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX5, "", 1, 41, 74, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX6, "", 92, 41, 106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX7, "", 92, 75, 106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX8, "", 92, 90,106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
         '-----------------------------------------------------------------------
    
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX9, "", 1, 105, 74, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX10, "", 92, 105, 106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX11, "", 1, 120, 74, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX12, "",92, 120,106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX13, "", 92, 135, 106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX14, "", 92, 162,106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
           CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX15, "", 92, 177,106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
           CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX16, "", 1, 192, 74, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
          CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX17, "", 92, 192,106, 13, _
            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR
    
            CONTROL ADD LABEL, hDlg, %IDC_LABEL1,  "", 205, 15, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL2,  "", 205, 30, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL3,  "", 205, 44, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL4,  "", 205, 78, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL5,  "", 205, 93, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL6,  "", 205, 108, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL7,  "", 205, 123, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL8,  "", 205, 138, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL9,  "", 205, 165, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL10, "", 205, 180, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL11, "", 205, 195, 195, 10
    
            CONTROL ADD LABEL, hDlg, %IDC_LABEL12, "", 1, 5, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL13, "", 92, 5, 195, 10
            CONTROL ADD LABEL, hDlg, %IDC_LABEL14, "", 205, 5, 195, 10
    
    
    
    #PBFORMS END DIALOG
    
       ' hGTFONT = GetStockObject(%SYSTEM_FIXED_FONT)
        hGTFONT = MakeFont("Courier New Bold",12)
       ' hGTFONT = MakeFont("System_Fixed_Font Bold",9)
    
         CONTROL SEND hdLG,%IDC_TEXTBOX1,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX2,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX3,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX4,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX5,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX6,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX7,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX8,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX9,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX10,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX11,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX12,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX13,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX14,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX15,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX16,%WM_SETFONT,hGTFONT,%TRUE
         CONTROL SEND hdLG,%IDC_TEXTBOX17,%WM_SETFONT,hGTFONT,%TRUE
        ' CONTROL SEND hdLG,%IDC_TEXTBOX18,%WM_SETFONT,hGTFONT,%TRUE
        ' CONTROL SEND hdLG,%IDC_TEXTBOX19,%WM_SETFONT,hGTFONT,%TRUE
        ' CONTROL SEND hdLG,%IDC_TEXTBOX20,%WM_SETFONT,hGTFONT,%TRUE
        ' CONTROL SEND hdLG,%IDC_TEXTBOX21,%WM_SETFONT,hGTFONT,%TRUE
        ' CONTROL SEND hdLG,%IDC_TEXTBOX22,%WM_SETFONT,hGTFONT,%TRUE
    
         'CONTROL DISABLE  hDlg, %IDC_TEXTBOX2
    
    
    
    
    
          DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
    
    #PBFORMS BEGIN CLEANUP %IDD_DIALOG1
    #PBFORMS END CLEANUP
    
        FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------
    Last edited by Paul Purvis; 26 Feb 2008, 04:23 PM.
    p purvis

  • #2
    They go in the order set up (created/control add).

    You might think about using a %WS_GROUP in the first control of any group of controls.
    Client Writeup for the CPA

    buffs.proboards2.com

    Links Page

    Comment


    • #3
      Paul, as you're using PB Forms you also have a TAB Order Editor on your toolbar, which can be used to juggle the position of the CONTROL ADD... statements around.

      Also you can turn off that annoying blurb "The first line in this file..." by going into Tools.Options.Code Generation and unchecking its box.

      Comment


      • #4
        Hi Fred
        Thanks for the response.
        I have not worked with the group properties and i know about the control add order, and that is important, but i was wanting to brute force the user from one textbox to the next.
        In this situation i want my gui program to do some proofing calculations for the user, so buy forcing the order and not allowing a user to jump to any textbox, i can display information on the screen like in msdos program.
        My program will calculate figures and place the results on the screen, but i do not want the results to be on the screen while they are placing figures into the textboxs.

        I will have to add another control or two to the screen, and when the focus is on that control, the program will display more information.

        like i said, i am new at this, and do not want to really create a really long code just to do this, maybe i have to.

        maybe i need to work on a better example
        paul
        p purvis

        Comment


        • #5
          >but i was wanting to brute force the user from one textbox to the next.

          That might be OK under MS-DOS, but Windows' GUI programs generally do not work like that and it might confuse your users.*

          Generally with "Windows GUI software" the user will enter something, then hit <TAB> to advance one field or Shift+<TAB> to back up one field. He signals he has completed entry by arriving on an "OK" button and hitting <SpaceBar> to 'push the button'. This is the point where the programmer would edit for missing/invalid fields, etc.

          If the entry passes all edits, you would then save your data whereever that might be, then clear all the fields and manually set the focus to the first control of the group for the "next" logical record to be entered.

          Sure, you "can" brute-force it like MS_DOS, but it would be very un-Windows-like to do so.

          As far as putting info on the screen... you can detect when the user goes to a new control by processing the WM_SETFOCUS and/or WM_KILLFOCUS messages... in general you'll have to subclass the controls to get that.

          Except.. if you are interested in edit ("TEXTBOX") controls, you will get WM_COMMAND/EN_KILLFOCUS or EN_SETFOCUS messages in the owner window procedure ('DlgProc') and you don't need to subclass to get those. When the user leaves some textbox (WM_COMMAND/EN_KILLFOCUS), you can use the value of the text in the control to do calculations or anything else.

          am new at this, do not want to really create a really long code ....maybe i need to work on a better example
          If I may suggest, frst thing is you want to think about how your entry screens should work in a Windows GUI Environment. It won't be the same as your MS-DOS screens.

          I'm not a PB/CC guy, but I think PB/CC is a bit more conducive to creating "MS-DOS-Like" entry screens than is PB/Windows.

          MCM
          *Yes, I know, they WILL whine that "it doesn't work like the old software." Well, they need to get with the times, too.
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Also noticed that you say that you want to enter numbers, but the controls in your program will accept any text. Try adding the %ES_NUMBER style to each one. And you need to use DeleteObject in (for example) the WM_DESTROY message handler on each font created, though if you use PBForms to set the font, then it puts the font deletion in the ShowDialog1 function.

            Comment


            • #7
              >I have not worked with the group properties

              WS_GROUP is really only signficant in two cases I can think of:
              1. You have a group of autoradio buttons, where only one of the group may be checked at one time. In this case, the FIRST button of the group should have the WS_GROUP style, the other buttons in the group SHOULD NOT, and the first control following the group SHOULD.

              demo:http://www.powerbasic.com/support/pb...ad.php?t=22173

              2. If you want to use the GetNextDlgGroupItem WINAPI function. (I've never used this).

              MCM
              Last edited by Michael Mattias; 26 Feb 2008, 06:52 PM.
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                Originally posted by Michael Mattias View Post
                Generally with "Windows GUI software" the user will enter something, then hit <TAB> to advance one field or Shift+<TAB> to back up one field. He signals he has completed entry by arriving on an "OK" button and hitting <SpaceBar> to 'push the button'.
                Observation leads me to believe that most users point and click rather than navigate using the keyboard.

                Comment


                • #9
                  >most users point and click rather than navigate using the keyboard

                  Not me. That's why I had a heck of a time with Egrid32... it did not advance/retreat one box on Tab/Shift+Tab and I had to code that part myself by picking off the keystrokes and doing it myself.

                  But... using TAB/shift+TAB is a good way to try software... it tells you if the writer actually cared about doing things the "familiar, Windows way" or just kind of threw the thing together on his lunch hour.

                  MCM
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    i am trying to do something like a calculator on one gui window, it is not a calculator but it does some computing.

                    but like a calculator, i do not want to show the total while a user is editing a textbox used as entry, that would also confuse the user.

                    on the simple data entry i agree fully with MCM but i want to just keep one gui screen up and i believe this can be done.

                    want i feel is need is a label where i can display the total but only display the label where a user is at a certain button, but when the user leaves that button to a textbox, i need to clearout the total(text) that was placed at the label.

                    the users are my users and their problems are my problems, that is why i have i have to persist on solving this problem

                    thanks for your answers and i will focus learning the information given me.

                    i am very aggravated even having to write such a program, because if the program we are using was providing correct data, where that data could be wrong, it should show some kind of message to indicate an error where users can response in some way.

                    paul
                    p purvis

                    Comment


                    • #11
                      Paul, in the callback routine, after getting the text from the control, do your calculations then try CONTROL SET FOCUS to the control you want to go
                      to because of the results.
                      Client Writeup for the CPA

                      buffs.proboards2.com

                      Links Page

                      Comment


                      • #12
                        All of this aside, your desire to
                        but i was wanting to brute force the user from one textbox to the next.
                        is very reasonable.
                        The fact that some Windows programming experts believe that this is the Window's way and so you should do it that way will make teaching them another way a little more difficult. It is your program and it should work the way you want it to. But mostly it should work the way the user expects it to.
                        Thus you not only have to teach the programming experts your better way, you have indoctrinate the users.
                        If they don't realize that they are being taught something new, they will accept it a lot easier.
                        So try the INPUTBOX until either everyone else figures it out or you decide to program it their way.
                        Using the INPUTBOX lets you control where things are going with each input, until the decision is made.
                        Rod
                        Rod
                        In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                        Comment


                        • #13
                          thank you all

                          i am just not getting this gui stuff fast enough.
                          the main goal was not to provide a sum on the display while the person was editing the input.
                          but i believe for now i have a solution as listed below without listing the whole program.
                          first make a global long variable gilastboxid
                          create a function to clear out the text with any sum totals
                          then using the en_update to watch for keyboard input and where it came from, and if it came from an input box, clear out the displayed total.
                          %IDC_LABEL7 is the label control where i keep the totals after the calculation.
                          the next part is not programed yet
                          i will have a button control that will be the last tabbed control to calculate the figures and place the results into the lablel control %IDC_LABEL7.
                          a simple return or click on the button control should be all that is needed.
                          now to do it, easier said huh.
                          also i believe one could use %EN_CHANGE if you where to be checking for certain characters input without doing subclassing which i no experience in but i know i will have to conquer in the future. Without poffs, i would have had a time digging up, and by the way, POFFS only had 50 hits on %EN_UPDATE.

                          this method should also reinforce and keep within windows practices to users. MCM's message was well received.

                          Code:
                          '1st
                          GLOBAL gilastboxid AS LONG
                          
                          '2nd
                          FUNCTION clearthecalcsumbox() AS LONG
                             CONTROL SET TEXT hDlg, %IDC_LABEL7,  ""
                          END FUNCTION
                          
                          
                          '3rd
                           CASE %WM_COMMAND
                                      ' Process control notifications
                                      SELECT CASE AS LONG CBCTL
                                          CASE %IDC_TEXTBOX1
                                             IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>1& THEN gilastboxid=1&:clearthecalcsumbox
                                          CASE %IDC_TEXTBOX2
                                             IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>2& THEN gilastboxid=2&:clearthecalcsumbox
                                          CASE %IDC_TEXTBOX3
                                             IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>3& THEN gilastboxid=3&:clearthecalcsumbox
                                          CASE %IDC_TEXTBOX4
                                             IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>4& THEN gilastboxid=4&:clearthecalcsumbox
                                      END SELECT
                          Last edited by Paul Purvis; 26 Feb 2008, 11:14 PM.
                          p purvis

                          Comment


                          • #14
                            > .... not getting this gui stuff fast enough

                            This is not your father's OldsmoBASIC
                            Michael Mattias
                            Tal Systems (retired)
                            Port Washington WI USA
                            [email protected]
                            http://www.talsystems.com

                            Comment


                            • #15
                              WS_GROUP also decides the behaviour of the arrow-keys
                              hellobasic

                              Comment


                              • #16
                                The differences between Windows input/output and command line i/o are total, absolute, and fundamental. For this reason don't get discouraged too easily Paul.

                                In Charles Petzold's famous Window's programming books he stated that it would take six months of hard work for a professional C programmer to begin to learn programming for Windows.

                                And nowhere are the differences more extreme than in what you are working on right now.
                                Fred
                                "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

                                Comment


                                • #17
                                  I think I get what you mean.

                                  Do you mean as you enter text, the values change?

                                  aka if adding numbers

                                  As you type in one box, a label adds the value of your current value of the box you are typing in, and all the other ones? and updates as you type?
                                  Engineer's Motto: If it aint broke take it apart and fix it

                                  "If at 1st you don't succeed... call it version 1.0"

                                  "Half of Programming is coding"....."The other 90% is DEBUGGING"

                                  "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                                  Comment


                                  • #18
                                    here is my almost complete program

                                    the program is to help in balancing and checking the data bases for errors
                                    it never hurts to manually check or balance things.
                                    this program was written to verify the balances in a program i did not write, and when the balances are not correct, it could mean data was not posted correctly, usually being a glitch happened somewhere in the computer system, maybe the power went down while transactions where taking place.

                                    the input routines need the ability to hit return to enter data, there is no tab key on the numeric side of the keyboard.

                                    i have the program where it will clear out totals if a key is press in an input field.
                                    the program is not done yet
                                    a hotkey to calculate needs to be put in

                                    this program can be altered without too much effort i think for other purposes of entering whole numbers and dollars

                                    i made the ability to retrieve the clipboard from some borrowed code
                                    if you can send your report or whatever to the clipboard on your altered code, you could scrub the data and place that data in the input fields to save a lot of time for the user, and it would be much more accurate than input from a user

                                    not every input field is needed to do the computation, but it makes it much easier on the user to make the display the same as the report from which the figures are read from and the user can just enter data without looking back to the screen, they would just type in each line from the report, which is what i was doing in a spreadsheet.

                                    make a file with 4 lines in it to contain last months ending balance.
                                    these lines
                                    CAJOUTCK.EXE
                                    My office name
                                    300
                                    143685.91


                                    Code:
                                    'compile with pb 8.04
                                    #COMPILE EXE
                                    #DIM ALL
                                    
                                    #IF NOT %DEF(%WINAPI)
                                        #INCLUDE "WIN32API.INC"
                                    #ENDIF
                                    
                                    'Common RGB Colors
                                    %BLACK   = &H00000000???
                                    %BLUE    = &H00FF0000???
                                    %GREEN   = &H0000FF00???
                                    %CYAN    = &H00FFFF00???
                                    %RED     = &H000000FF???
                                    %MAGENTA = &H00FF00FF???
                                    %YELLOW  = &H0000FFFF???
                                    %WHITE   = &H00FFFFFF???
                                    %GRAY    = &H00808080???
                                    %LTGRAY  = &H00C0C0C0???
                                    
                                    
                                    
                                    %IDD_DIALOG1   =  101
                                    %IDC_TEXTBOX1  = 1001
                                    %IDC_TEXTBOX2  = 1002
                                    %IDC_TEXTBOX3  = 1003
                                    %IDC_TEXTBOX4  = 1004
                                    %IDC_TEXTBOX5  = 1005
                                    %IDC_TEXTBOX6  = 1006
                                    %IDC_TEXTBOX7  = 1007
                                    %IDC_TEXTBOX8  = 1008
                                    %IDC_TEXTBOX9  = 1009
                                    %IDC_TEXTBOX10 = 1010
                                    %IDC_TEXTBOX11 = 1011
                                    %IDC_TEXTBOX12 = 1012
                                    %IDC_TEXTBOX13 = 1013
                                    %IDC_TEXTBOX14 = 1014
                                    %IDC_TEXTBOX15 = 1015
                                    %IDC_TEXTBOX16 = 1016
                                    %IDC_TEXTBOX17 = 1040
                                    %IDC_LABEL1  = 1051
                                    %IDC_LABEL2  = 1052
                                    %IDC_LABEL3  = 1053
                                    %IDC_LABEL4  = 1054
                                    %IDC_LABEL5  = 1055
                                    %IDC_LABEL6  = 1056
                                    %IDC_LABEL7  = 1057
                                    %IDC_LABEL8  = 1058
                                    %IDC_LABEL9  = 1059
                                    %IDC_LABEL10 = 1060
                                    %IDC_LABEL11 = 1061
                                    %IDC_LABEL12 = 1062
                                    %IDC_LABEL13 = 1063
                                    %IDC_LABEL14 = 1064
                                    %IDC_LABELSUM1 = 1065
                                    %IDC_LABELSUM2 = 1066
                                    %IDC_LABELSUM3 = 1067
                                    %IDC_LABELSUM4 = 1068
                                    %IDC_LABELSUM5 = 1069
                                    %IDC_LABELSUM6 = 1070
                                    %IDC_LABELSUM7 = 1071
                                    %IDC_LABELSUM8 = 1072
                                    %IDC_LABELSUM9= 1073
                                    %IDC_LABELSUM10 = 1074
                                    %IDC_BUTTON1 = 1091
                                    %IDC_BUTTON2 = 1092
                                    %IDC_BUTTON3 = 1093
                                    %IDC_BUTTON4 = 1094
                                    %IDC_BUTTON5 = 1095
                                    
                                    
                                    'GLOBALHERE
                                    GLOBAL hDLG AS DWORD
                                    GLOBAL glmaxnumberofinputs AS LONG
                                    GLOBAL gilastboxid AS LONG
                                    GLOBAL glhGTFONT AS LONG
                                    GLOBAL glhGTFONTSMALL AS LONG
                                    GLOBAL glfontsize AS LONG
                                    GLOBAL gcxdollarsinput() AS CURRENCYX
                                    GLOBAL gqitemcount() AS QUAD
                                    
                                    GLOBAL glusethedatafile AS LONG
                                    GLOBAL gsdatafile AS STRING
                                    GLOBAL gsdatafilename AS STRING
                                    GLOBAL gsdatafiledrive AS STRING
                                    GLOBAL gsdatafiledirectory AS STRING
                                    
                                    GLOBAL gsofficenamebeginning AS STRING
                                    GLOBAL gqitemcountbeginning AS QUAD
                                    GLOBAL gcxdollarsbeginning AS CURRENCYX
                                    GLOBAL gqitemcountbeginningdiff AS QUAD
                                    GLOBAL gcxdollarsbeginningdiff AS CURRENCYX
                                    GLOBAL gqitemcountdiff AS QUAD
                                    GLOBAL gcxdollarsinputdiff AS CURRENCYX
                                    GLOBAL gcxdollarsinputcheck AS CURRENCYX
                                    GLOBAL gqitemcountchecktotal AS CURRENCYX
                                    GLOBAL gsclipboard AS STRING
                                    
                                    'DECLAREHERE
                                    DECLARE FUNCTION makefont(BYVAL FFont AS STRING, BYVAL PointSize AS LONG) AS LONG
                                    DECLARE FUNCTION covertallnumberstostring() AS LONG
                                    DECLARE FUNCTION texttocurrencyxnumber(BYVAL TXT AS STRING )AS CURRENCYX
                                    DECLARE FUNCTION texttowholenumber(BYVAL TXT AS STRING )AS QUAD
                                    DECLARE FUNCTION clearthecalcsumbox() AS LONG
                                    DECLARE FUNCTION displaynumbers() AS LONG
                                    DECLARE FUNCTION isdatafilethere() AS LONG
                                    DECLARE FUNCTION calculatethendisplay() AS LONG
                                    DECLARE FUNCTION readstoredbeginningbata() AS LONG
                                    DECLARE FUNCTION savestoredbeginningdata() AS LONG
                                    DECLARE FUNCTION displaynumbers() AS LONG
                                    DECLARE FUNCTION getdatafromclipboard() AS LONG
                                    DECLARE FUNCTION getdatafromclipboard() AS LONG
                                    DECLARE FUNCTION seedthebeginning() AS LONG
                                    DECLARE FUNCTION calulatedifference() AS LONG
                                    DECLARE FUNCTION breakdowndatafilename() AS LONG
                                    DECLARE FUNCTION resettheform() AS LONG
                                    DECLARE FUNCTION displayhelpstartup() AS LONG
                                    DECLARE FUNCTION prechecktexttonumber(BYVAL STRINGNUMBER AS STRING, BYVAL numberofdecimals AS LONG)AS LONG
                                    DECLARE FUNCTION readnumbersfromdisplay() AS LONG
                                    
                                    DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
                                    DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
                                    
                                    MACRO TextFromClip(st)
                                    MACROTEMP hMem, pMem
                                    DIM hMem AS DWORD 'handle to clipboard object
                                    DIM pMem AS DWORD 'pointer to globally allocated memory
                                    st = ""
                                    IF IsClipboardFormatAvailable( %CF_TEXT ) THEN
                                    IF OpenClipboard(0) THEN
                                    hMem = GetClipboardData( %CF_TEXT )
                                    pMem = GlobalLock(hMem)
                                    IF pMem THEN st = PEEK$( pMem, lstrlen( BYVAL pMem ) )
                                    GlobalUnlock hMem
                                    CloseClipboard
                                    END IF
                                    END IF
                                    END MACRO  ' TextFromClip
                                    
                                    FUNCTION getclipboard () AS LONG
                                    LOCAL I AS LONG
                                    READCLIPBOARDSTART:
                                    INCR I
                                    IF I=90 THEN EXIT FUNCTION
                                    gsclipboard=""
                                    TextFromClip( gsclipboard )
                                    IF LEN( gsclipboard ) THEN
                                      IF LEN( gsclipboard ) > 3 THEN
                                      REPLACE $TAB WITH "     " IN gsclipboard
                                      ' place your restrictions here
                                      '   IF INSTR(UCASE$(gsclipboard),"MANAGERS REPORT")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard),"=QUIT,  PGDN,  PGUP,  LTARROW,  RTARROW")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard)," PAGE ")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard)," COL ")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard),"/")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard), ANY "1234567890")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard),"AMOUNT REFINANCED")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard),"LOANS FIRST OF MONTH")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard),"OUTSTANDING TO DATE")=0& THEN getanotherclipboard
                                      '   IF INSTR(UCASE$(gsclipboard),"TOTAL AMOUNT REFINANCED")=0& THEN getanotherclipboard
                                          EXIT FUNCTION
                                       END IF
                                    END IF
                                    getanotherclipboard:
                                    gsclipboard=""
                                    SLEEP 1000
                                    GOTO readclipboardstart
                                    END FUNCTION
                                    
                                    
                                    FUNCTION PBMAIN()
                                    DIM I AS LONG
                                    glmaxnumberofinputs=17&
                                    
                                    REDIM  gcxdollarsinput(0& TO glmaxnumberofinputs)
                                    REDIM  gqitemcount(0& TO glmaxnumberofinputs)
                                    FOR I=0& TO glmaxnumberofinputs
                                         gcxdollarsinput(I)[email protected]@
                                         gqitemcount(I)=0&&
                                    NEXT I
                                       IF INSTR(COMMAND$,"?")>0& THEN
                                           displayhelpstartup
                                       EXIT FUNCTION
                                       END IF
                                    
                                       breakdowndatafilename
                                       IF gsdatafilename<>"" THEN isdatafilethere
                                       IF glusethedatafile>0& THEN readstoredbeginningbata
                                    
                                       glfontsize=9&
                                       glhgtfont = makefont("Courier New Bold",glfontsize+3)
                                       glhgtfontsmall = makefont("Courier New",glfontsize)
                                    
                                        ShowDIALOG1 %HWND_DESKTOP
                                    END FUNCTION
                                    
                                    
                                    CALLBACK FUNCTION ShowDIALOG1Proc()
                                    
                                        SELECT CASE AS LONG CBMSG
                                            CASE %WM_INITDIALOG
                                                ' Initialization handler
                                    
                                            CASE %WM_NCACTIVATE
                                                STATIC hWndSaveFocus AS DWORD
                                                IF ISFALSE CBWPARAM THEN
                                                    ' Save control focus
                                                    hWndSaveFocus = GetFocus()
                                                ELSEIF hWndSaveFocus THEN
                                                    ' Restore control focus
                                                    SetFocus(hWndSaveFocus)
                                                    hWndSaveFocus = 0
                                                END IF
                                    
                                            CASE %WM_COMMAND
                                                ' Process control notifications
                                                SELECT CASE AS LONG CBCTL
                                                    CASE %IDC_TEXTBOX1
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>1& THEN gilastboxid=1&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX2
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>2& THEN gilastboxid=2&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX3
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>3& THEN gilastboxid=3&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX4
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>4& THEN gilastboxid=4&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX5
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>5& THEN gilastboxid=5&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX6
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>6& THEN gilastboxid=6&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX7
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>7& THEN gilastboxid=7&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX8
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>8& THEN gilastboxid=8&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX9
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>9& THEN gilastboxid=9&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX10
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>10& THEN gilastboxid=10&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX11
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>11& THEN gilastboxid=11&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX12
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>12& THEN gilastboxid=12&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX13
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>13& THEN gilastboxid=13&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX14
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>14& THEN gilastboxid=14&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX15
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>15& THEN gilastboxid=15&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX16
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>16& THEN gilastboxid=16&:clearthecalcsumbox
                                                    CASE %IDC_TEXTBOX17
                                                         IF CBCTLMSG=%EN_UPDATE THEN IF gilastboxid<>17& THEN gilastboxid=17&:clearthecalcsumbox
                                    
                                    
                                                     CASE %IDC_BUTTON1
                                                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                             savestoredbeginningdata
                                                           END IF
                                                     CASE %IDC_BUTTON2
                                                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                             seedthebeginning
                                                           END IF
                                    
                                                    CASE %IDC_BUTTON3
                                                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                              calculatethendisplay()
                                                           END IF
                                    
                                                     CASE %IDC_BUTTON4
                                                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                               getdatafromclipboard
                                                           END IF
                                                    CASE %IDC_BUTTON5
                                                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                               resettheform
                                                           END IF
                                    
                                                     END SELECT
                                    
                                        END SELECT
                                    END FUNCTION
                                    
                                    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
                                        LOCAL lRslt AS LONG
                                        'changed font size
                                     DIALOG FONT "Courier New",glfontsize
                                    
                                        DIALOG NEW hParent, "Temp", 70, 70, 298, 245, _
                                              %WS_THICKFRAME OR %WS_MINIMIZEBOX OR %WS_CAPTION OR _
                                              %WS_SYSMENU OR  %WS_VISIBLE OR %DS_MODALFRAME OR _
                                              %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO _
                                              hDlg
                                    
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "", 1, 13, 74, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX2, "", 92, 13, 106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX3, "", 1, 27, 74, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX4, "", 92, 27, 106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX5, "", 1, 41, 74, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX6, "", 92, 41, 106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                    
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX7, "", 92, 75, 106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX8, "", 92, 90,106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                    
                                        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX9, "", 1, 105, 74, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX10, "", 92, 105, 106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX11, "", 1, 120, 74, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX12, "",92, 120,106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX13, "", 92, 135, 106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX14, "", 92, 162,106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                           CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX15, "", 92, 177,106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                           CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX16, "", 1, 192, 74, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                          CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX17, "", 92, 192,106, 13, _
                                            %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_RIGHT, _
                                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                            %WS_EX_RIGHTSCROLLBAR
                                    
                                    
                                    
                                        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON1, "Save 1st of Mth", 0, 235, 62, 10,  %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON 'OR %WS_TABSTOP
                                        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON2, "Use", 62, 235, 18, 10,   %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON 'OR %WS_TABSTOP
                                        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON3, "&Calculate now", 81, 228, 140, 17,   %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %WS_TABSTOP
                                        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON4, "Clipboard Get", 222, 235, 55, 10,    %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON 'OR %WS_TABSTOP
                                        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON5, "Reset", 277, 235, 21, 10,   %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON 'OR %WS_TABSTOP
                                    
                                    
                                    
                                    
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL1,  "Loans First Of Month", 205, 15, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL2,  "Outstanding To Date ", 205, 30, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL3,  "Gain/Loss To Date ", 205, 44, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL4,  "Collections Due For Mth", 205, 78, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL5,  "Collect Month To Date ", 205, 93, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL6,  "Loans Made For Month", 205, 108, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL7,  "Loans P&L  For Month ", 205, 123, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL8,  "P&L Collected For Month ", 205, 138, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL9,  "Rebate/Refund Amount ", 205, 165, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL10, "Late Charges Renewed  ", 205, 180, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL11, "Amount Refinanced   ", 205, 195, 195, 10
                                    
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL12, "No saved prev mth #", 1, 3, 69, 10, %SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL13, "No saved prev mth outstd", 92, 3, 98,10, %SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABEL14, "Loans 1st of Mth saved", 205, 4, 195, 10
                                    
                                            '  SUM TOTALS
                                            '  THE LABEL HAVE THIS MANY CHARACTERS "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                                            'LABEL 15 AND 16 ARE UNDER OUTSTANDING TOTALS
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM1, "", 1, 55, 69, 10, %SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM2, "", 92, 55, 98,10, %SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM3, "", 205, 55, 170, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM4, "", 1, 65, 69,10, %SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM5, "", 92, 65, 98, 10, %SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM6, "", 205, 65, 170, 10
                                    
                                    
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM7, "",92, 208, 102, 10,%SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM8, "", 92,218, 85, 10,%SS_RIGHT
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM9, "", 205, 208, 195, 10
                                            CONTROL ADD LABEL, hDlg, %IDC_LABELSUM10, "", 205, 218, 195, 10
                                    
                                    
                                    
                                         CONTROL SEND hdLG,%IDC_TEXTBOX1,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX2,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX3,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX4,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX5,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX6,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX7,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX8,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX9,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX10,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX11,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX12,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX13,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX14,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX15,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX16,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_TEXTBOX17,%WM_SETFONT,glhgtfont,%TRUE
                                    
                                         CONTROL SEND hdLG,%IDC_LABELSUM1,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM2,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM3,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM4,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM5,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM6,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM7,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM8,%WM_SETFONT,glhgtfont,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM9,%WM_SETFONT,glhgtfontsmall,%TRUE
                                         CONTROL SEND hdLG,%IDC_LABELSUM10,%WM_SETFONT,glhgtfontsmall,%TRUE
                                    
                                          IF LEN(gsofficenamebeginning) THEN
                                          DIALOG SET TEXT hdlg, "Cajoutck     - "+gsofficenamebeginning
                                          END IF
                                          IF glusethedatafile>0& THEN
                                          CONTROL SET TEXT  hDlg, %IDC_LABEL12, USING$("#,",gqitemcountbeginning)
                                          CONTROL SET TEXT  hDlg, %IDC_LABEL13, USING$("#,.##",gcxdollarsbeginning)
                                          END IF
                                    
                                    
                                    
                                          DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
                                    
                                        FUNCTION = lRslt
                                    END FUNCTION
                                    
                                    
                                    
                                    'function to turn a text number to a double precsion number
                                    'mostly used for numbers
                                    FUNCTION texttocurrencyxnumber(BYVAL TXT AS STRING )AS CURRENCYX
                                    DIM VALUEOFCOMA AS DOUBLE
                                    DIM I AS LONG
                                    DIM VALUEOFCOMANUMBER$
                                    VALUEOFCOMANUMBER$=""
                                    TXT=" "+TRIM$(TXT)
                                    IF INSTR(TXT,"-")>0& THEN VALUEOFCOMANUMBER$="-"
                                    FOR I=1& TO LEN(TXT)
                                    IF INSTR("0123456789.",MID$(TXT,I,1&))>0& THEN VALUEOFCOMANUMBER$=VALUEOFCOMANUMBER$+MID$(TXT,I,1&)
                                    NEXT I
                                    VALUEOFCOMANUMBER$=TRIM$(VALUEOFCOMANUMBER$)
                                    VALUEOFCOMA=VAL(VALUEOFCOMANUMBER$)
                                    IF VALUEOFCOMANUMBER$="-" THEN VALUEOFCOMA=0
                                    FUNCTION=VALUEOFCOMA
                                    END FUNCTION
                                    
                                    FUNCTION texttowholenumber(BYVAL TXT AS STRING )AS QUAD
                                    DIM VALUEOFCOMA AS QUAD
                                    DIM I AS LONG
                                    DIM VALUEOFCOMANUMBER$
                                    VALUEOFCOMANUMBER$=""
                                    TXT=" "+TRIM$(TXT)
                                    IF INSTR(TXT,"-")>0& THEN VALUEOFCOMANUMBER$="-"
                                    FOR I=1& TO LEN(TXT)
                                    IF INSTR("0123456789.",MID$(TXT,I,1&))>0& THEN VALUEOFCOMANUMBER$=VALUEOFCOMANUMBER$+MID$(TXT,I,1&)
                                    NEXT I
                                    VALUEOFCOMANUMBER$=TRIM$(VALUEOFCOMANUMBER$)
                                    VALUEOFCOMA=VAL(VALUEOFCOMANUMBER$)
                                    IF VALUEOFCOMANUMBER$="-" THEN VALUEOFCOMA=0
                                    FUNCTION=VALUEOFCOMA
                                    END FUNCTION
                                    
                                    
                                    
                                    
                                    'function to clear the sum totals on the screen
                                    FUNCTION clearthecalcsumbox() AS LONG
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM1, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM2, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM3, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM4, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM5, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM6, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM7, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM8, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM9, ""
                                       CONTROL SET TEXT hDlg, %IDC_LABELSUM10, ""
                                    
                                    
                                    END FUNCTION
                                    
                                    
                                    'function to assign a font to a number use in control send %WM_SETFONT commands
                                    FUNCTION makefont(BYVAL FFont AS STRING, BYVAL PointSize AS LONG) AS LONG
                                      LOCAL hDC      AS LONG
                                      LOCAL CyPixels AS LONG
                                      hDC = GetDC(%HWND_DESKTOP)
                                      CyPixels  = GetDeviceCaps(hDC, %LOGPIXELSY)
                                      ReleaseDC %HWND_DESKTOP, hDC
                                      PointSize = (PointSize * CyPixels) \ 72
                                      FUNCTION = CreateFont(0 - PointSize, 0, 0, 0, %FW_NORMAL, 0, 0, 0, _
                                                %ANSI_CHARSET, %OUT_TT_PRECIS, %CLIP_DEFAULT_PRECIS, _
                                                %DEFAULT_QUALITY, %FF_DONTCARE, BYCOPY FFont)
                                    END FUNCTION
                                    
                                    
                                    FUNCTION displaynumbers() AS LONG
                                        DIM txt AS STRING
                                    
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX1  ,USING$("#,",gqitemcount(1))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX2  ,USING$("#,.##",gcxdollarsinput(2))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX3  ,USING$("#,",gqitemcount(3))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX4  ,USING$("#,.##",gcxdollarsinput(4))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX5  ,USING$("#,",gqitemcount(5))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX6  ,USING$("#,.##",gcxdollarsinput(6))
                                    
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX7  ,USING$("#,.##",gcxdollarsinput(7))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX8  ,USING$("#,.##",gcxdollarsinput(8))
                                    
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX9  ,USING$("#,",gqitemcount(9))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX10 ,USING$("#,.##",gcxdollarsinput(10))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX11 ,USING$("#,",gqitemcount(11))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX12 ,USING$("#,.##",gcxdollarsinput(12))
                                    
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX13 ,USING$("#,.##",gcxdollarsinput(13))
                                    
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX14 ,USING$("#,.##",gcxdollarsinput(14))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX15 ,USING$("#,.##",gcxdollarsinput(15))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX16 ,USING$("#,",gqitemcount(16))
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX17 ,USING$("#,.##",gcxdollarsinput(17))
                                    
                                    
                                    
                                        IF gqitemcountdiff<>0&& THEN
                                              CONTROL SET COLOR hDlg, %IDC_LABELSUM1, %RED,-1&
                                              CONTROL SET COLOR hDlg, %IDC_LABELSUM3, %RED,-1&
                                         END IF
                                    
                                        IF gcxdollarsinputdiff<>[email protected]@ THEN
                                             CONTROL SET COLOR hDlg, %IDC_LABELSUM2, %RED,-1&
                                             CONTROL SET COLOR hDlg, %IDC_LABELSUM3, %RED,-1&
                                             END IF
                                    
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM1 ,USING$("#,",gqitemcountdiff)
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM2 ,USING$("#,.##",gcxdollarsinputdiff)
                                        CONTROL SET TEXT hDlg, %IDC_LABELSUM3, "cross-ck 3 lines above"
                                    
                                         'check for retreived stored data
                                         IF glusethedatafile>0& THEN
                                               IF gqitemcountbeginningdiff<>0&& THEN
                                              CONTROL SET COLOR hDlg, %IDC_LABELSUM4, %RED,-1&
                                              CONTROL SET COLOR hDlg, %IDC_LABELSUM6, %RED,-1&
                                               END IF
                                    
                                               IF gcxdollarsbeginningdiff<>[email protected]@ THEN
                                               CONTROL SET COLOR hDlg, %IDC_LABELSUM5, %RED,-1&
                                               CONTROL SET COLOR hDlg, %IDC_LABELSUM6, %RED,-1&
                                               END IF
                                    
                                            CONTROL SET TEXT hdlg, %IDC_LABELSUM4 ,USING$("#,",gqitemcountbeginningdiff)
                                            CONTROL SET TEXT hdlg, %IDC_LABELSUM5 ,USING$("#,.##",gcxdollarsbeginningdiff)
                                            CONTROL SET TEXT hDlg, %IDC_LABELSUM6, "cross-ck last mth end"
                                          END IF
                                    
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM1, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM2, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM3, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM4, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM5, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM6, %BLACK,-1&
                                         IF gcxdollarsinputcheck<>[email protected]@ THEN
                                           CONTROL SET COLOR hDlg, %IDC_LABELSUM7, %RED,-1&
                                           CONTROL SET COLOR hDlg, %IDC_LABELSUM9, %RED,-1&
                                         END IF
                                         CONTROL SET TEXT hdlg, %IDC_LABELSUM7 ,USING$("#,.##",gcxdollarsinputcheck)
                                         CONTROL SET TEXT  hDlg, %IDC_LABELSUM9, "proof check outstanding"
                                    
                                          IF gqitemcountchecktotal<>0& THEN
                                           CONTROL SET COLOR hDlg, %IDC_LABELSUM8, %RED,-1&
                                           CONTROL SET COLOR hDlg, %IDC_LABELSUM10, %RED,-1&
                                          END IF
                                    
                                          CONTROL SET TEXT hdlg, %IDC_LABELSUM8 ,USING$("#,",gqitemcountchecktotal)
                                          CONTROL SET TEXT  hDlg, %IDC_LABELSUM10, "proof check # of accts"
                                    
                                    
                                    
                                          CONTROL SET COLOR hDlg, %IDC_LABELSUM1, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM2, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM3, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM4, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM5, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM6, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM7, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM8, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM9, %BLACK,-1&
                                         CONTROL SET COLOR hDlg, %IDC_LABELSUM10, %BLACK,-1&
                                    
                                    END FUNCTION
                                    
                                    FUNCTION readnumbersfromdisplay() AS LONG
                                    DIM TXT AS STRING
                                    DIM validateinput AS LONG
                                    
                                    ' the validation on input is make sure the input decmials are not incorrect
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX1 TO TXT
                                        validateinput=prechecktexttonumber(TXT,0)
                                        IF validateinput THEN FUNCTION=%IDC_TEXTBOX1:GOTO EXITTHEFUNCTION
                                        gqitemcount(1)=texttowholenumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX3 TO TXT
                                        validateinput=prechecktexttonumber(TXT,0)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX3:GOTO EXITTHEFUNCTION
                                        gqitemcount(3)=texttowholenumber(txt)
                                    
                                        CONTROL GET TEXT  hdlg, %IDC_TEXTBOX5 TO TXT
                                        validateinput=prechecktexttonumber(TXT,0)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX5:GOTO EXITTHEFUNCTION
                                        gqitemcount(5)=texttowholenumber(txt)
                                    
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX9 TO TXT
                                        validateinput=prechecktexttonumber(TXT,0)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX9:GOTO EXITTHEFUNCTION
                                        gqitemcount(9)=texttowholenumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX11 TO TXT
                                         validateinput=prechecktexttonumber(TXT,0)
                                         IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX11:GOTO EXITTHEFUNCTION
                                         gqitemcount(11)=texttowholenumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX16 TO TXT
                                        validateinput=prechecktexttonumber(TXT,0)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX16:GOTO EXITTHEFUNCTION
                                        gqitemcount(16)=texttowholenumber(txt)
                                    
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX2 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX2:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(2)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX4 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX4:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(4)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX6 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX6:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(6)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX7 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX7:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(7)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX8 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX8:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(8)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX10 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX10:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(10)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX12 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX12:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(12)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX13 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX13:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(13)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX14 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX14:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(14)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX15 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX15:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(15)=texttocurrencyxnumber(txt)
                                    
                                       CONTROL GET TEXT  hdlg, %IDC_TEXTBOX17 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN FUNCTION=%IDC_TEXTBOX17:GOTO EXITTHEFUNCTION
                                        gcxdollarsinput(17)=texttocurrencyxnumber(txt)
                                    
                                    FUNCTION=0&
                                    EXITTHEFUNCTION:
                                    END FUNCTION
                                    
                                    FUNCTION calculatethendisplay() AS LONG
                                    DIM I AS LONG
                                    I=readnumbersfromdisplay
                                    IF I THEN CONTROL SET FOCUS hDlg, I :MSGBOX "error, unvalid entry, check decimal places",,"Cajoutck message":GOTO EXITTHEFUNCTIONOK
                                    calulatedifference
                                    displaynumbers
                                    EXITTHEFUNCTIONOK:
                                    END FUNCTION
                                    
                                    
                                    FUNCTION readstoredbeginningbata() AS LONG
                                    IF glusethedatafile<>1& THEN GOTO EXITTHEFUNCTION
                                    DIM I&
                                    DIM validatefile AS STRING
                                    TRYAGAIN:
                                    gsofficenamebeginning=""
                                    gqitemcountbeginning=0&&
                                    [email protected]@
                                    TRY
                                    OPEN gsdatafile FOR INPUT LOCK SHARED AS 1
                                    LINE INPUT #1,validatefile
                                    IF TRIM$(UCASE$(validatefile))<>"CAJOUTCK.EXE" THEN
                                        CLOSE
                                        MSGBOX gsdatafile+" file is not a valid data file for this program",,"Cajoutck error"
                                        GOTO EXITTHEFUNCTION
                                        END IF
                                    LINE INPUT #1,gsofficenamebeginning
                                    gsofficenamebeginning=TRIM$(gsofficenamebeginning)
                                    INPUT  #1,gqitemcountbeginning
                                    INPUT  #1,gcxdollarsbeginning
                                    CLOSE
                                    glusethedatafile=1&
                                    GOTO EXITTHEFUNCTIONOK
                                    CATCH
                                    CLOSE
                                    glusethedatafile=0&
                                    INCR I&
                                    IF I&=10 THEN EXIT TRY
                                    SLEEP 100
                                    GOTO TRYAGAIN
                                    END TRY
                                    EXITTHEFUNCTION:
                                     MSGBOX "There was an error in reading the file "+gsdatafile+"."+$CRLF+_
                                             "The ending data from the previous month cannot be found.",,"Cajoutck error"
                                    glusethedatafile=0&
                                    gsofficenamebeginning=""
                                    gqitemcountbeginning=0&&
                                    [email protected]@
                                    
                                    EXITTHEFUNCTIONOK:
                                    END FUNCTION
                                    
                                    FUNCTION savestoredbeginningdata() AS LONG
                                    DIM TXT AS STRING
                                    DIM I AS LONG
                                    DIM validateinput AS LONG
                                    IF glusethedatafile=0& THEN GOTO EXITTHEFUNCTION
                                     CONTROL GET TEXT  hdlg, %IDC_TEXTBOX1 TO TXT
                                        validateinput=prechecktexttonumber(TXT,0)
                                        IF validateinput=1& THEN
                                          CONTROL SET FOCUS hdlg, %IDC_TEXTBOX1
                                          MSGBOX "check number of accts, has to be a no decmials",,"Cajoutck message"
                                          GOTO EXITTHEFUNCTIONOK
                                         END IF
                                      gqitemcount(1)=texttowholenumber(txt)
                                     CONTROL GET TEXT  hdlg, %IDC_TEXTBOX2 TO TXT
                                        validateinput=prechecktexttonumber(TXT,2)
                                        IF validateinput=1& THEN
                                          CONTROL SET FOCUS hdlg, %IDC_TEXTBOX2
                                          MSGBOX "check dollar amount, has to be two decmials or less",,"Cajoutck message"
                                          GOTO EXITTHEFUNCTIONOK
                                         END IF
                                        gcxdollarsinput(2)=texttocurrencyxnumber(txt)
                                    
                                    IF gqitemcount(1)=0&& THEN MSGBOX "program refused to save a beginning loan numbers amount of zero",,"Cajoutck message":GOTO EXITTHEFUNCTIONOK
                                    IF gcxdollarsinput(2)[email protected]@ THEN MSGBOX "program refused to save a beginning outstanding dollar amount of zero",,"Cajoutck message":GOTO EXITTHEFUNCTIONOK
                                    
                                     I=MSGBOX ("Are you sure you want to update the file containing first of months figures?"+$CRLF+_
                                               "Use the loan number count               "+USING$("#,",gqitemcount(1&))+$CRLF+_
                                               "Use the loan outstanding amount                 "+USING$("#,.##",gcxdollarsinput(2&))+$CRLF+$CRLF+ _
                                               "                   To abort this update, click on the NO",_
                                           %MB_YESNO OR %MB_ICONERROR OR %MB_DEFBUTTON2 OR %MB_TASKMODAL ,"Cajoutck message")
                                    
                                       IF I<>%IDYES THEN GOTO EXITTHEFUNCTIONOK
                                    
                                     IF I=%IDYES THEN
                                       I=MSGBOX ("Your last chance to abort updating the first of months figures?"+$CRLF+_
                                               "Use the loan number count               "+USING$("#,",gqitemcount(1&))+$CRLF+_
                                               "Use the loan outstanding amount                 "+USING$("#,.##",gcxdollarsinput(2&))+$CRLF+$CRLF+ _
                                                            "            To abort this update, click on the NO",_
                                                  %MB_YESNO OR %MB_ICONERROR OR %MB_DEFBUTTON2 OR %MB_TASKMODAL,"Cajoutck message")
                                            IF I<>%IDYES THEN GOTO EXITTHEFUNCTIONOK
                                       END IF
                                    
                                     MSGBOX "When the beginning infomation is saved, you will get a message."+$CRLF+ _
                                            "Otherwise the information is not saved.",,"Cajoutck  message"
                                    
                                    I=0&
                                    TRYAGAIN:
                                    TRY
                                    OPEN gsdatafile FOR OUTPUT LOCK SHARED AS 1
                                    PRINT  #1,USING$("&","CAJOUTCK.EXE")
                                    PRINT  #1,USING$("&",gsofficenamebeginning)
                                    PRINT  #1,USING$("&",TRIM$(STR$(gqitemcount(1&))))
                                    PRINT  #1,USING$("&",TRIM$(STR$(gcxdollarsinput(2&))))
                                    CLOSE #1
                                    
                                    gqitemcountbeginning=gqitemcount(1&)
                                    gcxdollarsbeginning=gcxdollarsinput(2&)
                                    
                                    glusethedatafile=1&
                                          CONTROL SET TEXT  hDlg, %IDC_LABEL12, USING$("#,",gqitemcountbeginning)
                                          CONTROL SET TEXT  hDlg, %IDC_LABEL13, USING$("#,.##",gcxdollarsbeginning)
                                          CONTROL SET TEXT hdlg, %IDC_TEXTBOX1  ,USING$("#,",gqitemcount(1))
                                          CONTROL SET TEXT hdlg, %IDC_TEXTBOX2  ,USING$("#,.##",gcxdollarsinput(2))
                                    clearthecalcsumbox
                                    
                                    MSGBOX "The beginning figures have been changed and saved.",,"Cajoutck message"
                                    CONTROL SET FOCUS hdlg,%IDC_TEXTBOX1
                                    GOTO EXITTHEFUNCTIONOK
                                    CATCH
                                    CLOSE
                                    INCR I
                                    IF I=10 THEN glusethedatafile=0&:GOTO EXITTHEFUNCTION
                                    SLEEP 400
                                    GOTO TRYAGAIN
                                    END TRY
                                    EXITTHEFUNCTION:
                                    MSGBOX "The ending data from the previous month cannot be saved"+$CRLF+ _
                                           "because of either no file is on command line or file problems.",,"Cajoutck error"
                                    EXITTHEFUNCTIONOK:
                                    END FUNCTION
                                    
                                    
                                    FUNCTION breakdowndatafilename() AS LONG
                                       glusethedatafile=0&
                                       gsdatafile=UCASE$(TRIM$(COMMAND$))
                                       IF gsdatafile="" THEN GOTO EXITTHEFUNCTION
                                      DIM TXT AS STRING
                                      DIM I AS LONG
                                    
                                      FOR I=1& TO LEN(gsdatafile)
                                        TXT=UCASE$(MID$(gsdatafile,I,1))
                                        IF INSTR("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.\:",TXT)=0& THEN
                                            MSGBOX "The data file given on the command line has a character not valid for this program"+$CRLF+_
                                            "       the invalid character is ="+TXT+ " inside "+gsdatafile+$CRLF+ _
                                            "              the program will contine in manual mode",,"Cajoutck error"
                                           GOTO EXITTHEFUNCTION
                                         END IF
                                      NEXT I
                                      TXT=STRREVERSE$(gsdatafile)
                                      IF INSTR(TXT,".")<2& THEN
                                           MSGBOX "The data file from the command line must have a period inside the filename."+_
                                           $CRLF+"command line = "+COMMAND$,,"Cajoutck error"
                                           GOTO EXITTHEFUNCTION
                                           END IF
                                    I=INSTR(gsdatafile,":")
                                        IF I THEN
                                            IF I=2& THEN
                                                 gsdatafiledrive=MID$(gsdatafile,1,2)
                                                 gsdatafilename=MID$(gsdatafile,I+1&)
                                             ELSE
                                             gsdatafile="":GOTO EXITTHEFUNCTION
                                             END IF
                                        END IF
                                       IF LEN(gsdatafilename)=0& THEN gsdatafilename=gsdatafile
                                       TXT=STRREVERSE$(gsdatafilename)+" "
                                       I=INSTR(TXT,"\")
                                        IF I THEN
                                                 gsdatafiledirectory=MID$(txt,I)
                                                 txt=STRREVERSE$(gsdatafiledirectory)
                                                 gsdatafiledirectory=TRIM$(txt)
                                        END IF
                                    IF LEN(gsdatafiledirectory)>0& THEN
                                         gsdatafilename=MID$(gsdatafilename,LEN(gsdatafiledirectory)+1&)
                                         ELSE
                                             gsdatafilename=gsdatafilename
                                     END IF
                                    
                                     IF gsdatafilename="." THEN gsdatafilename=""
                                     IF gsdatafilename=".." THEN gsdatafiledirectory=gsdatafiledirectory+"..":gsdatafilename=""
                                    
                                    
                                    EXITTHEFUNCTION:
                                    END FUNCTION
                                    
                                    
                                    FUNCTION isdatafilethere() AS LONG
                                    DIM TXT AS STRING
                                    IF gsdatafilename="" THEN glusethedatafile=0&:GOTO EXITTHEFUNCTION
                                    TXT=DIR$(gsdatafile)
                                    IF UCASE$(TXT)<>UCASE$(gsdatafilename) THEN
                                           DIR$ CLOSE
                                           MSGBOX "The data file from the command line does not exist."+$CRLF+_
                                             "The ending of the month for previous month will not be displayed"+$CRLF+_
                                             "command line = "+COMMAND$,,"Cajoutck error"
                                           GOTO EXITTHEFUNCTION
                                           END IF
                                    glusethedatafile=1&
                                    EXITTHEFUNCTION:
                                    END FUNCTION
                                    
                                    
                                    
                                    FUNCTION getdatafromclipboard() AS LONG
                                        gsclipboard=""
                                        MSGBOX "Use the clipboard method to acquire input for the form"+$CRLF+_
                                               "The report once retreived, will be displayed as an acknowledgement.",,"Cajoutck message"
                                        getclipboard
                                        IF LEN(gsclipboard) THEN MSGBOX gsclipboard
                                    
                                    END FUNCTION
                                    
                                    FUNCTION seedthebeginning() AS LONG
                                     IF glusethedatafile=0& THEN GOTO EXITTHEFUNCTION
                                       gqitemcount(1)=gqitemcountbeginning
                                       gcxdollarsinput(2)=gcxdollarsbeginning
                                       CONTROL SET TEXT hdlg, %IDC_TEXTBOX1  ,USING$("#,",gqitemcount(1))
                                       CONTROL SET TEXT hdlg, %IDC_TEXTBOX2  ,USING$("#,.##",gcxdollarsinput(2))
                                      CONTROL SET FOCUS hdlg,%IDC_TEXTBOX1
                                    GOTO EXITTHEFUNCTIONOK
                                    EXITTHEFUNCTION:
                                     MSGBOX "The ending data from the previous month is not available."+$CRLF+_
                                            "Use manual input or store the beginning first.",,"Cajoutck error"
                                    
                                    EXITTHEFUNCTIONOK:
                                    END FUNCTION
                                    
                                    
                                    FUNCTION calulatedifference() AS LONG
                                     IF glusethedatafile=1& THEN
                                       gqitemcountbeginningdiff=gqitemcountbeginning-gqitemcount(1&)
                                       gcxdollarsbeginningdiff=gcxdollarsbeginning-gcxdollarsinput(2&)
                                       END IF
                                    gqitemcountdiff=gqitemcount(3&)-gqitemcount(1&)-gqitemcount(5&)
                                    gcxdollarsinputdiff=gcxdollarsinput(4&)-gcxdollarsinput(2&)-gcxdollarsinput(6&)
                                    
                                    gcxdollarsinputcheck=-gcxdollarsinput(2&)+gcxdollarsinput(4&)+gcxdollarsinput(8&)-gcxdollarsinput(10&)+gcxdollarsinput(14&)-gcxdollarsinput(15&)+gcxdollarsinput(17&)
                                    IF gqitemcountbeginning<>0&& THEN gqitemcountchecktotal=gqitemcountbeginning-gqitemcount(1&)+gqitemcount(3&)-gqitemcount(1&)-gqitemcount(5&)
                                    
                                    
                                    END FUNCTION
                                    
                                    FUNCTION resettheform() AS LONG
                                    DIM I AS LONG
                                    DIM TXT AS STRING
                                    TXT=""
                                    FOR I=0& TO glmaxnumberofinputs
                                         gcxdollarsinput(I)[email protected]@
                                         gqitemcount(I)=0&&
                                    NEXT I
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX1  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX2  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX3  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX4  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX5  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX6  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX7  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX8  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX9  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX10  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX11  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX12  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX13  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX14  ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX15 ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX16 ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_TEXTBOX17 ,TXT
                                    
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM1, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM2, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM3, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM4, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM5, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM6, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM7, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM8, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM9, %BLACK,-1&
                                        CONTROL SET COLOR hDlg, %IDC_LABELSUM10, %BLACK,-1&
                                    
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM1 ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM2 ,TXT
                                        CONTROL SET TEXT hDlg, %IDC_LABELSUM3, TXT
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM4 ,TXT
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM5 ,TXT
                                        CONTROL SET TEXT hDlg, %IDC_LABELSUM6, TXT
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM7 ,TXT
                                        CONTROL SET TEXT hDlg, %IDC_LABELSUM8, TXT
                                        CONTROL SET TEXT hdlg, %IDC_LABELSUM9 ,TXT
                                        CONTROL SET TEXT hDlg, %IDC_LABELSUM10, TXT
                                    
                                        CONTROL SET FOCUS hdlg, %IDC_TEXTBOX1
                                    END FUNCTION
                                    
                                    FUNCTION prechecktexttonumber(BYVAL STRINGNUMBER AS STRING, BYVAL numberofdecimals AS LONG)AS LONG
                                    DIM I AS LONG
                                    DIM TXT AS STRING
                                       TXT=REMOVE$(STRINGNUMBER, ANY "- ,")
                                       TXT=TRIM$(TXT)
                                       TXT=STRREVERSE$(TXT)
                                    I=INSTR(TXT,".")
                                    IF I>numberofdecimals+1& THEN FUNCTION=1&:GOTO EXITTHEFUNCTIONOK
                                    IF LEN(TXT) THEN
                                        FOR I=1& TO LEN(TXT)
                                        IF INSTR("0123456789.",MID$(TXT,I,1))=0& THEN FUNCTION=1&:GOTO EXITTHEFUNCTIONOK
                                        NEXT I
                                    END IF
                                    FUNCTION=0&
                                    EXITTHEFUNCTIONOK:
                                    END FUNCTION
                                    
                                    
                                    
                                    FUNCTION displayhelpstartup() AS LONG
                                        MSGBOX  "Cajoutck.exe is for checking balances on the Manager's Report"+$CRLF+_
                                               "A file placed on the command tail can be used to store"+$CRLF+_
                                                "   last month's ending balance,which is equal to this month's beginning balace."+$CRLF+_
                                                "The file must have  four lines in it and data on each line."+$CRLF+_
                                                "   1st line has to be exactly the text description CAJOUTCK.EXE."+$CRLF+_
                                                "   2nd line is the description for identity purposes only, but to this program it means nothing."+$CRLF+_
                                                "   3rd line is the number of accounts."+$CRLF+_
                                                "   4th line is the number of dollars in outstanding"+$CRLF+_
                                                "No commas are allowed in the file except in the second line only."+$CRLF+_
                                                "It is much better just to leave out all commas."+$CRLF+_
                                                "Once this file is created, this program can save data to it.",,"Cajoutck startup help screen"
                                    END FUNCTION
                                    Last edited by Paul Purvis; 29 Feb 2008, 12:07 PM.
                                    p purvis

                                    Comment


                                    • #19
                                      i have found and implemented my use of the return key/enter key
                                      now, i do not feel so computer savy.
                                      i had done all my searching for "return key" and should of done a search for "enter key" first. now i found some good hits in POFFS.

                                      i have done some edits to my program and enough to redisplay the full program, now i have what i wanted.

                                      i had to create an array and load the array with all the input fields id
                                      example
                                      all variables are global
                                      Code:
                                      FUNCTION assigncontrolsidtoarray () AS LONG
                                          glmaxdialogcontrolidcount=3&
                                          REDIM gldialogcontrolidarray(0& TO glmaxdialogcontrolidcount)
                                          CONTROL SET FOCUS hdlg, %IDC_TEXTBOX1
                                          gldialogcontrolidarray(1&)=getfocus()
                                          CONTROL SET FOCUS hdlg, %IDC_TEXTBOX2
                                          gldialogcontrolidarray(2&)=getfocus()
                                          CONTROL SET FOCUS hdlg, %IDC_TEXTBOX1
                                          gldialogcontrolidarray(3&)=getfocus()
                                      END FUNCTION
                                      notice the last array has the control id of the first input box
                                      actually in my use, i included the calculate button control id as the second to the last item in the array
                                      and placed the control id of my first input textbox in the last item of the array to provide for a looping effect on input



                                      then inside the callback function did this
                                      Code:
                                      CASE %WM_COMMAND
                                                  ' Process control notifications
                                        SELECT CASE AS LONG CBCTL       
                                      
                                      'this is placed below all other CASE statements
                                        IF CBCTLMSG=0 THEN
                                                         glcallbackresultgetfocus=getfocus()
                                                         ARRAY SCAN  gldialogcontrolidarray() FOR glmaxdialogcontrolidcount, =glcallbackresultgetfocus, TO glresult
                                                         IF glresult THEN
                                                             
                                                            IF glresult=18 THEN   'this is where i have my calculate button in my program, here the program recalculates
                                                                  calculatethendisplay()
                                                                ELSE
                                                                setfocus(gldialogcontrolidarray(glresult))
                                                            END IF
                                                         END IF     
                                      
                                      END SELECT
                                      Last edited by Paul Purvis; 29 Feb 2008, 04:03 PM.
                                      p purvis

                                      Comment


                                      • #20
                                        Paul, here is a snippet of code I used in program to caculate quantiy time price. As each char is typed in, the result is recacluted. This might show one way to caclulate on the fly, so to speak.

                                        John Tate
                                        Code:
                                        #PBFORMS CREATED V1.51
                                        '------------------------------------------------------------------------------
                                        ' The first line in this file is a PB/Forms metastatement.
                                        ' It should ALWAYS be the first line of the file. Other
                                        ' PB/Forms metastatements are placed at the beginning and
                                        ' end of "Named Blocks" of code that should be edited
                                        ' with PBForms only. Do not manually edit or delete these
                                        ' metastatements or PB/Forms will not be able to reread
                                        ' the file correctly.  See the PB/Forms documentation for
                                        ' more information.
                                        ' Named blocks begin like this:    #PBFORMS BEGIN ...
                                        ' Named blocks end like this:      #PBFORMS END ...
                                        ' Other PB/Forms metastatements such as:
                                        '     #PBFORMS DECLARATIONS
                                        ' are used by PB/Forms to insert additional code.
                                        ' Feel free to make changes anywhere else in the file.
                                        '------------------------------------------------------------------------------
                                        
                                        #COMPILE EXE
                                        #DIM ALL
                                        
                                        '------------------------------------------------------------------------------
                                        '   ** Includes **
                                        '------------------------------------------------------------------------------
                                        #PBFORMS BEGIN INCLUDES
                                        #IF NOT %DEF(%WINAPI)
                                            #INCLUDE "WIN32API.INC"
                                        #ENDIF
                                        #PBFORMS END INCLUDES
                                        '------------------------------------------------------------------------------
                                        
                                        '------------------------------------------------------------------------------
                                        '   ** Constants **
                                        '------------------------------------------------------------------------------
                                        #PBFORMS BEGIN CONSTANTS
                                        %IDD_DIALOG1  =  101
                                        %IDC_TEXTBOX1 = 1001
                                        %IDC_TEXTBOX2 = 1002
                                        %IDC_TEXTBOX3 = 1003
                                        %IDC_BUTTON1  = 1004
                                        %IDCANCEL     =    2
                                        #PBFORMS END CONSTANTS
                                        '------------------------------------------------------------------------------
                                        
                                        '------------------------------------------------------------------------------
                                        '   ** Declarations **
                                        '------------------------------------------------------------------------------
                                        DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
                                        DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
                                        #PBFORMS DECLARATIONS
                                        '------------------------------------------------------------------------------
                                        
                                        '------------------------------------------------------------------------------
                                        '   ** Main Application Entry Point **
                                        '------------------------------------------------------------------------------
                                        FUNCTION PBMAIN()
                                            ShowDIALOG1 %HWND_DESKTOP
                                        END FUNCTION
                                        '------------------------------------------------------------------------------
                                        
                                        '------------------------------------------------------------------------------
                                        '   ** CallBacks **
                                        '------------------------------------------------------------------------------
                                        CALLBACK FUNCTION ShowDIALOG1Proc()
                                        LOCAL TEMPVAR1,TEMPVAR2 AS STRING
                                        LOCAL CALCVALUE AS CUX
                                            SELECT CASE AS LONG CBMSG
                                                CASE %WM_INITDIALOG
                                                    ' Initialization handler
                                        
                                                CASE %WM_NCACTIVATE
                                                    STATIC hWndSaveFocus AS DWORD
                                                    IF ISFALSE CBWPARAM THEN
                                                        ' Save control focus
                                                        hWndSaveFocus = GetFocus()
                                                    ELSEIF hWndSaveFocus THEN
                                                        ' Restore control focus
                                                        SetFocus(hWndSaveFocus)
                                                        hWndSaveFocus = 0
                                                    END IF
                                        
                                                CASE %WM_COMMAND
                                                    ' Process control notifications
                                                    SELECT CASE AS LONG CBCTL
                                                        CASE %IDC_TEXTBOX1
                                        
                                                        CASE %IDC_TEXTBOX2
                                                            CONTROL GET TEXT CBHNDL,%IDC_TEXTBOX1 TO TEMPVAR1  'GET INPUT FROM BOX1
                                                            CONTROL GET TEXT CBHNDL, %IDC_TEXTBOX2 TO TEMPVAR2 'GET INPUT CHAR BY CHAR FROM BOX2
                                                            CALCVALUE = VAL(TEMPVAR1)*VAL(TEMPVAR2)   'MAKE CALCULATION CHAR BY CHAR
                                                            CONTROL SET TEXT CBHNDL,%IDC_TEXTBOX3, USING$("####.##",CALCVALUE)   'SET RESULT TO BOX 3 CAR BY CHAR
                                                        CASE %IDC_TEXTBOX3
                                        
                                                        CASE %IDC_BUTTON1
                                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                                MSGBOX "DATA ACCEPTED- DO WHATEVER WITH IT"
                                                                CONTROL SET TEXT CBHNDL, %IDC_TEXTBOX1,""  'CLEAR THE BOXES FOR NEW ENTRY
                                                                 CONTROL SET TEXT CBHNDL, %IDC_TEXTBOX2,""
                                                                 CONTROL SET FOCUS CBHNDL, %IDC_TEXTBOX1  'NOW SET FOCUS TO BEGINNING AGAIN
                                                            END IF
                                        
                                                        CASE %IDCANCEL
                                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                                DIALOG END CBHNDL, 0
                                                            END IF
                                        
                                                    END SELECT
                                            END SELECT
                                        END FUNCTION
                                        '------------------------------------------------------------------------------
                                        
                                        '------------------------------------------------------------------------------
                                        '   ** Dialogs **
                                        '------------------------------------------------------------------------------
                                        FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
                                            LOCAL lRslt AS LONG
                                        
                                        #PBFORMS BEGIN DIALOG %IDD_DIALOG1->->
                                            LOCAL hDlg  AS DWORD
                                        
                                            DIALOG NEW hParent, "Dialog1", 70, 70, 357, 216, TO hDlg
                                            CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "TextBox1", 5, 10, 100, 13
                                            CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX2, "TextBox2", 115, 10, 100, 13
                                            CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX3, "TextBox3", 225, 10, 100, 13
                                            CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON1, "ACCEPT DATA", 95, 120, 65, 15
                                            CONTROL ADD BUTTON,  hDlg, %IDCANCEL, "EXIT", 220, 120, 50, 15
                                        #PBFORMS END DIALOG
                                        
                                            DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
                                        
                                        #PBFORMS BEGIN CLEANUP %IDD_DIALOG1
                                        #PBFORMS END CLEANUP
                                        
                                            FUNCTION = lRslt
                                        END FUNCTION
                                        '------------------------------------------------------------------------------

                                        Comment

                                        Working...
                                        X