×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Parsing a rectangle screen shot from excel vba

Parsing a rectangle screen shot from excel vba

Parsing a rectangle screen shot from excel vba

(OP)
Hey all,
Am using Reflection for Unix and OpenVMS 14.1.83

My screen looks something like this....

Screen 1 of 35

*> 1. Field1 Value1
2. Field2LongName Value2
3. Field3 Value3
4. Field4LongName Value4
etc..

I'm using GetText to grab a rectangle on each page containing all of the field data. There may be 4 spaces between fields 1&3 and their values and 20 spaces between fields 2&4 and their values. Having some troubles gracefully parsing this rectangle. Code looks something like this.

For Page = 1 To pageCount
myScreen = .GetText(.FoundTextRow + 3, 4, .FoundTextRow + 19, 80, rcRectRegion)
rowData = Split(myScreen, vbCr) 'This is working fine - splitting rectangle into rows
For Row = 0 To UBound(rowData)
Dim temp() As String, j As Integer

temp = Split(rowData(Row)) 'This is where I'm having problems
j = 1
For i = 1 To UBound(temp) 'Want to get rid of this
If Not temp(i) = "" Then
fieldData(fieldCount, j) = temp(i)
j = j + 1
End If
Next i
fieldCount = fieldCount + 1
Next Row
.Transmit Page + 1, rcIgnoreBlockMode
.TransmitTerminalKey rcVtEnterKey
Next Page

The only character or char constant I can find to successfully split each row into its #, name, value set is the space key. Since there are a varying number of spaces between the name value sets, I have to loop through the spaces in the temp array to find my value. I have tried vbTAB, and a bunch of reflection constants (both alone and with Chr$(rcHT)) but I'm getting no where. Anybody up on a graceful way to split up my line data? By spaces works but it just annoys me!
Also...how the heck to you get this app to consider the spacing you put in your orig post...left justifies and takes away add whitespace everywhere?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close