Results 1 to 2 of 2

Thread: Can you help me?

  1. #1

    Thread Starter
    Addicted Member killer_cobra's Avatar
    Join Date
    Jun 2001
    Location
    Lost in space
    Posts
    131

    Can you help me?

    I am having a problem with using the Left, Right and Mid functions. I have a string input called strData and it consists of anything from "0,0" - "1024,768" and constantly changes in that range.

    I need to split it up for use in the SetCursorPos function, anything before the comma is the X axis, and anything after the comma is th Y axis.

    Does anyone know how to do that? I know how to extract things from strings, but doing it my way just gave me "Type Mismatch" errors. They somehow need to be extracted as Long datatypes to function correctly in SetCursorPos.

    Can anyone tell me how to this seemingly impossible task?

    Thanx a million in advance!!!

    Scott

  2. #2
    Matthew Gates
    Guest
    Use the Split function.


    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim Coords As String
    3.     Dim vArray As Variant
    4.    
    5.     Coords = "1024,768"
    6.    
    7.     vArray = Split(Coords, ",")
    8.    
    9.     MsgBox vArray(0) & vbCrLf & vArray(1)
    10. End Sub

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