dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: I have a Confuse with error message.

  1. #1
    Join Date
    Sep 2004
    Posts
    96

    I have a Confuse with error message.

    Hi,I have a doubt with message on error. The following is :
    Private Sub Form_Click()
    Dim S as String
    S = Text1.Text
    Print S+1<-----------Sometimes error highlight line loacates here
    End Sub
    Sometimes running error message is "Type not match" But sometimes it's Ok.
    Why? Thank you very much.
    xuliangchu

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    You can't perform math on a string. If you are going to add 1 to what is in the textbox, you need to convert it to a number.

  3. #3
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    It is possible that when you get the error S cannot be converted into a number. Try

    If Not IsNumeric(S) then .... display an error message
    else ... perform the operation
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Similar Threads

  1. javascript: validate radio button
    By mrenefrancisco in forum Java
    Replies: 1
    Last Post: 04-25-2008, 03:46 AM
  2. Newly Confuse to Java Programs
    By SimplyTooOld in forum Java
    Replies: 1
    Last Post: 11-14-2007, 06:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center