|
-
Sep 10th, 2007, 07:30 PM
#1
Thread Starter
New Member
VB6 and simple coding?
Not sure this is the right forum to ask this question.
Im just wondering if VB6 is suitable to do the following task:
* Read a log file, the first line and the last line.
* Find certain texts in the log and extract a number from each found.
While this might look simple, in some coding environments its not sadly. For an example in autoit its extremely complicated.
For example a text could look like this:
[01:04:12] You get 1,402,421 experience points!
The number (1,402,421) would then be added with the next one found until the file has reached the last line.
But yeah, thats the question. I know of course that is is possible, but how hard would this be to code in VB6?
-
Sep 10th, 2007, 10:25 PM
#2
Re: VB6 and simple coding?
That would be quite simple in either VB6 or .NET. If you have not used either one, then I would suggest going with .NET, because VB6 is no longer supported by MS, and is probably going to fade over time. The steps would be these:
1) Read the lines into an array of strings or similar structure in memory (faster and easier than dealing with the file)
2) Find the lines that have the text you are looking for.
3) Use InStr, Substring, Left, Right, Mid, etc (depending on the language) to extract the portion of the string you want.
4) Convert it into a number.
5) Add.
6) Repeat until you've gone through all the lines.
The exact coding for each step depends largely on the language chosen, but the steps will be the same.
My usual boring signature: Nothing
 
-
Sep 13th, 2007, 06:58 AM
#3
Re: VB6 and simple coding?
VB is overkill, even. You could probably do that quite simply using head, tail and grep.
UNIX utilities for Windows
But if you don't know how to use those then don't bother learning just for this task. VB6 is fine.
-
Sep 21st, 2007, 02:55 PM
#4
Re: VB6 and simple coding?
Pen, you're cheating - you're a Unoid.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|