Results 1 to 4 of 4

Thread: How would I

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344
    Tell the program to only use the int command if the caption has a decimal in it.

    If label1.caption = ??Contains a . in caption?? then
    label2.caption = int(label1.caption)
    else
    label2.caption = label2.caption
    end if
    -RaY
    VB .Net 2010 (Ultimate)

  2. #2
    Member
    Join Date
    Oct 2000
    Posts
    39
    What is an int command?

  3. #3
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Try this
    Code:
    If InStr(1, label1.caption, ".") then 
    label2.caption = int(label1.caption) 
    else 
    label2.caption = label2.caption 
    end if
    []P

    [Edited by PRIVATE1 on 10-20-2000 at 03:07 PM]
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  4. #4
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Int is integer

    Here is how you would do it:
    Code:
    If InStr(1, label1.caption, ".") Then
        label2.caption = Int(label1.caption)
    End If
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

Posting Permissions

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



Click Here to Expand Forum to Full Width