SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jul 2002
    Location
    Paris (France)
    Posts
    182
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Verifing Text Field Length: turning off defualt beep?

    I am trying to determine textfield lenght. To do this, I have a method that is added to the TextField Class:
    Now, when this goes, when it hits a hard stop, the computer starts to beep for every character it types. Doing this for a form gives everyone around a headache!

    What I wanted to do was turn off the beep at the begining of the method, then restore it to what it was at the end. I was hoping the beep was in the Control Panel | Sounds, since I think that is stored in the registry. I could then easily do this.

    However, after turning off all sounds, it still beeps. The beep is from the computer, rather than the OS. How can I turn this off?



    ------------------
    David Genrich
    Icarian
    555 North Mathilda Ave
    Sunnyvale, CA 94086
    davidg@icarian.com

  2. #2
    Junior Member
    Join Date
    Sep 1999
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifing Text Field Length: turning off defualt beep?

    why don't you get the length of the current text field after entering EVERY character, then when the length stays the same, you've got the maximum that the field can accept - and you only get one beep.

    solved.

    - .dave.

  3. #3
    Senior Member
    Join Date
    Jul 2002
    Location
    Paris (France)
    Posts
    182
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifing Text Field Length: turning off defualt beep?

    That worked! There is a small performance hit, but I can deal with that, since, if the field was only 10 charcters, if I put in 250, it would beep and take longer.

    Here is the new code:

    ------------------
    David Genrich
    Icarian
    555 North Mathilda Ave
    Sunnyvale, CA 94086
    davidg@icarian.com

    [This message has been edited by davidg (edited 08-23-2000).]

  4. #4
    Junior Member
    Join Date
    Jul 2000
    Location
    Rosemont, IL USA
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifing Text Field Length: turning off defualt beep?

    David,
    ...just do this
    int func(window wTxtFd)
    const string s="thisstringis257charslong..."
    wTxtFd.ClearText()
    wTxtFd.SetText(s)
    string ss = wTxtFd.GetText()
    int i = Len(ss)
    return i
    ...this has to be the simpliest to do it
    john yu


  5. #5
    Senior Member
    Join Date
    Jul 2002
    Location
    Paris (France)
    Posts
    182
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifing Text Field Length: turning off defualt beep?

    Actually, that will cause that dang beep! Plus, sometimes I will want a larger field value - 2000, 5000 charchters or more.

    Plus, with that way, you have to pass it the window and everything.

    With this, rather than doing a myTextObject.GetText(), then doing the work to verify it, you can just do a myTextObject.GetCharLength() and it will return the length for the field, while handling the saving and replacement of any data that was there.

    One of the reasons I wanted to go with a new method for the existing TextField is so that other people in my group, who may not know 4Test that well, can do simple things like verifying all of the field lengths on a page.


    ------------------
    David Genrich
    Icarian
    555 North Mathilda Ave
    Sunnyvale, CA 94086
    davidg@icarian.com

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:16 PM.

Copyright BetaSoft Inc.