PDA

Click to See Complete Forum and Search --> : Can you help me?


killer_cobra
Jul 18th, 2001, 01:31 AM
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 :confused: :confused: :confused:

Matthew Gates
Jul 18th, 2001, 01:49 AM
Use the Split function.


Private Sub Command1_Click()
Dim Coords As String
Dim vArray As Variant

Coords = "1024,768"

vArray = Split(Coords, ",")

MsgBox vArray(0) & vbCrLf & vArray(1)
End Sub