Results 1 to 4 of 4

Thread: Use of GETCHAR function

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    21

    Use of GETCHAR function

    I do not find the getchar function in my VB for applications?.

    How do I install it?, or what do I need to activate it?

    Thank in advance!!!!

    Yorch.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Use of GETCHAR function

    i think that is a c function, try Chr function in vb, i may have misinterpereted want you want to return, but that looks right

    ? chr(97)
    a
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    21

    Re: Use of GETCHAR function

    Thanks, actually I want to get a character from a string. I found this in the msdn:
    Code:
    Visual Basic
    Dim TestString As String = "ABCDE"
    Dim TestChar As Char
    TestChar = GetChar(TestString, 4)
    ' Returns "D"
    The GetChar function does not work in my version. Do I need to activate something else?.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Use of GETCHAR function

    vb Code:
    1. Dim teststr As String, testchr As String
    2. teststr = "ABCDE"
    3. testchar = Mid(teststr, 4, 1)
    4. 'returns D
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

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