Need VB help
Results 1 to 4 of 4

Thread: Need VB help

  1. #1
    Join Date
    Jan 2000
    Posts
    348

    Need VB help

    Any Visual Basic guru's out there?

    I'm learning it and I have a need to convert a one byte string to an integer so that I can use the integer as an index into an array.
    Is this possible? I've tried all the conversion functions like Cint, CByte etc and I keep the message "Type Mismatch".

    I could code up a huge If then ElseIf construct but that seems like a pain I shouldn't have to do.

    The only doc I have is the Programer's Guide. It refers me to a language Reference Guide for more info on those convert functions but I don't have one of those. Is it part of the MSDN library?

  2. #2
    Join Date
    Oct 2002
    Location
    Here, there and everywhere
    Posts
    7,355
    Hi winch

    you may find more help here

    http://www.codeguru.com/forum/

    HTH
    Who are you? Introduce yourself here

    P3-450 powered by

    Intel Core 2 Duo E6600
    Gigabyte 965P DQ6
    4 Gig Crucial Ballistix PC6400
    Gainward Nvidia Geforce 7950GT
    2X Western Digital Caviar 320GB SATA2
    Soundblaster X-Fi XtremeMusic
    Samsung SH-D162C DVD Rom
    Lite-On SHM-165P6S DVDRW
    Samsung 20" LCD Syncmaster 206BW
    Thermaltake Kandalf VA9000SWA Tower
    Tagan Dual Engine 700W PSU
    XP PRO SP3/Windows 7 64-bit
    --------------
    Samsung NC10 2GB Ram
    Windows 7 32-bit

  3. #3
    Join Date
    Feb 2001
    Location
    3rd rock from the Sun
    Posts
    1,320
    The ASC function will probably work for you.

    Returns an Integer representing the character code corresponding to the first letter in a string.

    Syntax

    Asc(string)

    The required string argument is any valid string expression. If the string contains no characters, a run-time error occurs.

    Hi winch,
    This is probably not the best place to be asking programming questions, so if you click on the VB link from the VirtualDr list of forums page, it will direct you to VBForums.

    Many of the questions asked there have been answered many times. They get tired of repeat questions, and the forum has very many professionals who frequently ask for clarifications amongst themselves. If you introduce yourself as a Newbie, you may not get a response. Usually you will get a suggestion to do a search for the topic, if not a direct answer to your question.

    That is also what I would suggest, just as one does a search here at VirtualDr. You will be surprised at the many threads that are returned doing a search.

    Hope you enjoy using VB, as I do.
    The MSDN library is supplied with VB, and the best version for non-professionals is VB 6.0. The industry is now transferring quickly to .NET, so if you intend to advance to professional abilities, then you might consider VB NET...
    Last edited by oldhermit; December 17th, 2003 at 02:14 PM.

  4. #4
    Join Date
    Apr 2000
    Location
    Friern Barnet, London, England
    Posts
    46,565
    If you're using VB .NET then try Convert.ToInt32. And you should definitely install the MSDN Library, unless you're a very experienced programmer you'll never get anywhere without it.

    VB Forums is an excellent site for VB questions, it's helped me out with a few VB .NET questions.
    Nick.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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