Results 1 to 7 of 7

Thread: [RESOLVED] Type Casting in VB

Hybrid View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    46

    Re: Type Casting in VB

    Quote Originally Posted by Shuja Ali
    It is always a good idea to be explicit.. which means you would use CLng to convert the string to Long and use it in the For loop.
    does that mean if i wan to have it as interger i use

    Dim charSize As Integer

    charSize = CInt(Text4)

    How comes it gives me a type mismatch error when i do the above? thks

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Type Casting in VB

    Did you try it like this
    VB Code:
    1. Dim charSize As Integer
    2.  
    3. charSize = CInt(Text4.Text)
    Use [code] source code here[/code] tags when you post source code.

    My Articles

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