Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Vote on your favorite hash algorithm here!

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-17-2007, 07:17 AM
ikkeugh ikkeugh is offline
Learning Programmer
 
Join Date: Sep 2007
Posts: 58
Credits: 0
Rep Power: 4
ikkeugh is on a distinguished road
Default if text1.text = number

How to do this ?

If the text in text1 is a number , than a variable is that number.
If it isn't a number , it should be 1 .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-17-2007, 07:36 AM
Jordan's Avatar   
Jordan Jordan is online now
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,397
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

vb Code:
  1. Dim myNumber As Integer
  2. myNumber = Val (text1.text)

If it is not a number myNumber will equal 0.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-21-2007, 10:04 AM
ikkeugh ikkeugh is offline
Learning Programmer
 
Join Date: Sep 2007
Posts: 58
Credits: 0
Rep Power: 4
ikkeugh is on a distinguished road
Default

But what if it is 0 ?
Why doesn't this work ?

Code:
    If Text1.Text <> Val(Text1.Text) Then
      scl = 1  'if it's not a number , it's 1
    ElseIf Text1.Text = Val(Text1.Text) Then
      scl = Val(Text1.Text) 'if it's a number , even 0
    End If
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating Point random number generator Paradine PHP Tutorials 0 08-26-2007 02:09 PM
Number Cloning Ronin Java Help 3 12-21-2006 07:23 AM
I need to generate a random number in PHP dirkfirst PHP Forum 7 07-05-2006 09:58 PM
Number of Lines on a RichText Box Lop Managed C++ 3 06-16-2006 05:19 PM
Number of files and directories in folder dirkfirst PHP Forum 4 05-30-2006 10:06 AM


All times are GMT -5. The time now is 06:18 AM.

Contest Stats

Xav ........ 1357.94
MeTh0Dz|Reb0rn ........ 1081.85
WingedPanther ........ 919.18
marwex89 ........ 906.86
morefood2001 ........ 903.18
John ........ 902.37
Brandon W ........ 789.89
chili5 ........ 312.39
Steve.L ........ 264.99
dcs ........ 240.34

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 83%

Ads