Results 1 to 3 of 3

Thread: Characters

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Characters

    I have this in C++

    unsigned char i_ch;

    i_ch = szRecord[z_ct++]; - szRecord is a parameter I receive (string)

    How can I do this in VB?

    I get different values in C++ and VB when using the VB's Mid function?

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Mid$ has an optional third parameter, the length of the string to return. If not specified the "rest of" the string is returned (from the specified starting position).

    The other problem is the C++ array is 0 based while the Mid$ function is 1 based. So

    Code:
       i_ch = szRecord[0]
    
       'is the same as 
    
       i_ch = Mid$(szRecord, 1, 1)

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Doesn't C convert the string to Unicode?

    Because it looks different if viewed in C as oppose to VB
    Don't anthropomorphize computers -- they hate it

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