Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Posts
    1

    Verifying masked input for phone number

    I am trying to verify that the individual has entered ten digits in a masked DlgEditField. The mask is for a phone number and is configured as (###) ###-####. I don't care what digits they entered, just that they entered 10 of them.

    - I tried testing the length of the string but it is 14 no matter what.
    - I tried string trimming all the numerics, parentheses and the dash and searching for remaing spaces, that didn't work.

    Any other suggestions? I really want to keep the mask to ensure standard inputs.

    Any help would be greatly appreciated!

  2. #2
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    Here is some code that should format the number

    Code:
    PhoneNum = SessionVar.Expand("%EditVar01%");
    Length = String.Length(PhoneNum);
    
    -- get rid of first bracket
    PhoneNum = String.Right(PhoneNum, Length - 1);
    
    -- get the area code
    AreaCode  = String.Left(PhoneNum, 3);
    -- get the last 8 digits (###-####)
    ActualNumber = String.Right(PhoneNum, 8);
    -- get rid of the - so that the result is ########
    ActualNumber = String.Left(ActualNumber, 3)..String.Right(ActualNumber, 4);
    -- put the entire number in a single string
    FullNumber = AreaCode..ActualNumber;

Similar Threads

  1. How do I restrict certain characters in an input with AMS6?
    By toujoursnaz in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 09-24-2006, 01:11 PM
  2. Password Issue
    By katanapilot in forum Setup Factory 7.0
    Replies: 25
    Last Post: 02-10-2006, 09:16 AM
  3. I want to compare user input number By number
    By kinui in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 10-26-2005, 07:37 PM
  4. HOWTO: Limit the Number of Times an Install can be Run
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-17-2002, 02:58 PM

Posting Permissions

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