View Single Post
  #4  
Old 10-27-2010, 02:30 PM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
Reply to Questions

The first line looks a little suspicious because register is not declared as a variable anywhere, and is not passed as a string. Did you mean to declare it as a variable, or are you wanting to read data until you see the string "register", as shown below?

showver = crt.Screen.ReadString("register")

To answer this, this reads data until it sees the string "register". This part does work, I tested it with a msgbox.

You also said want to count the number of times "System serial number" appears. The InStr method returns the position of the first occurrence of one string within another. InStr does not count the number of occurrences.

You are correct, I did not know how to accomplish this and chose the wrong method (InStr)

It looks like your code is putting the output from ReadString into the variable showver. If you use a regular expression to search showver, the code may resemble the following pseudo code.

The regular expression search sounds like a good way. I will add your pseudo code and try it out. Thanks!
Reply With Quote