Shop OBEX P1 Docs P2 Docs Learn Events
Visual basic code and stamp — Parallax Forums

Visual basic code and stamp

ArchiverArchiver Posts: 46,084
edited 2003-06-24 03:27 in General Discussion
I have a question when using a stamp with visual basic and you have the code
asc(mid$( what is the asc and (mid$( I dont want to just code from example I
want to know I think I do but want some reassurance. thanks jim




Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-06-24 03:27
    Jim,
    The ASC command gets the ASCII code for a char. For example:
    debug.print asc("A")
    The above line with print 65 in the immediate debug window.

    The Mid$ is like the Left$ and Right$ commands. Where left$ and
    Right$ get the left and right most chars, depending on how many chars
    you ask for.
    Example of right$ and Left$:
    a = "Test Right"
    b = "test left"
    Debug.Print Right$(a, 5) ' Prints "Right" (5 right most chars of the
    string)
    Debug.Print Left$(b, 4) `Prints "test" (4 left most chars of the
    string)

    The Mid$ is used to get the middle of the string. For example:
    a = "1234567890"
    `Mid$ syntax on next line
    'mid$([noparse][[/noparse]String],[noparse][[/noparse]Start of string],[noparse][[/noparse]number of chars to get from the
    string])
    Debug.Print Mid$(a, 1, 1) 'prints 1
    Debug.Print Mid$(a, 2, 2) 'prints 23
    Debug.Print Mid$(a, 3, 1) 'prints 3
    Debug.Print Mid$(a, 4, 3) 'prints 456
    Debug.Print Mid$(a, 5, 1) 'prints 5

    You could even do something like this:
    For z = 1 To Len(a)
    Debug.Print Mid$(a, z, 1)
    Next z
    This loop with go though the entire string displaying one char at a
    time.

    Hope this helps,
    Walter

    --- In basicstamps@yahoogroups.com, frog28043 <frog28043@y...> wrote:
    > I have a question when using a stamp with visual basic and you have
    the code asc(mid$( what is the asc and (mid$( I dont want to just
    code from example I want to know I think I do but want some
    reassurance. thanks jim
    >
    >
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! DSL - Now only $29.95 per month!
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.