Results 1 to 5 of 5

Thread: Autoreturn?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Autoreturn?

    Is there a way to "autoreturn" when a required number of characters is entered in a form? I am asking the user to enter a customer's telephone number, and I do not want to force the user to hit the TAB key or click on the next form to continue...

    So, the first form requires 3 numbers (area code).

    The second form requires 3 numbers (prefix).

    The third form requires 4 numbers (sufix).

  2. #2
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    2,418

    Default Re: Autoreturn?

    these type of things tend to be messy.

    There is no such feature natively in DF (nor in any regular standard windows desktop app). Things got relly complicated when you try to change some of these "filled" forms.

    It becomes a nightmare to the end user, when things does not works properly and the user is unable to change/fix the value of the form, because the logic is not properly implemented or is not able to detect all cases and the cursor is moved out to the next form.

    I have never done it.. for these reasons.. but If I would, I believe I would start by trying to implement onChange event, the Key method . good luck
    Samuel Pizarro

  3. #3
    Join Date
    Feb 2009
    Posts
    780

    Default Re: Autoreturn?

    You are not clear if you are using a form or a dbForm.

    In the dos days they were field entry options, AutoBack and AutoReturn. AutoReturn does do what you are asking for. As Samuel wrote it is very un-windows like.
    But there are still dd_options defined which maybe, very maybe work DD_AUTORETURN and DD_AUTOBACK, just tested it in 20.0 pre alpha and does not work.

    So if you want it, you will have to do a bit of work.

    But again it is not windows.


    Peter
    Peter H. van Wijk
    X-Organize Consultancy N.V.

  4. #4

    Default Re: Autoreturn?

    Quote Originally Posted by phvwijk View Post
    In the dos days they were field entry options, AutoBack and AutoReturn.
    You hit the nail right on the head -- I'm a DOS developer as far back as 1992... I'm coming around to the OOP ways, but I still tend to think like a DOS programmer...

  5. #5

    Default Re: Autoreturn?

    It must be late, I don't see the problem.
    Just don't mess with mouse navigation.
    Sounds to me like Windows license code entry... that's windows?

    Anyways.. it's not hard.

    Code:
    Use Windows.pkg
    Use DFClient.pkg
    
    Deferred_View Activate_oAutoreturn for ;
    Object oAutoreturn is a dbView
    
        Set Border_Style to Border_Thick
        Set Size to 200 300
        Set Location to 2 2
        Set Label to "autoreturn"
    
        Object oForm1 is a Form
            Set Size to 12 100
            Set Location to 28 23
        
            // OnChange is called on every changed character
            Procedure OnChange
                String sValue
            
                Get Value to sValue
                If (Length(Trim(sValue))=3) Begin
                    Send Next
                End
            End_Procedure
        End_Object
    
        Object oForm2 is a Form
            Set Size to 12 100
            Set Location to 28 133
        End_Object
    Cd_End_Object
    Paste that in a new view.
    --
    Wil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •