T
tikki
Guest
Greetings,
I am working on a small program to track the debt my brother is in to me (he borrows a lot of money
). The data file is a basic txt file of with a format like this.
Gasoline $-20.00
Food $-5.00
Washed my car $+10.00
I am reading in the txt file using StreamReader on form load and wrote a sub procedure called GetDollarAmounts() which uses a for loop to go through each character and look for the $ sign using SubString. When it finds that dollar sign, it then reads in the appropriate sign and Substrings to the first number and does a do...while to get all numbers (via an IsNumeric function I wrote). It finally puts the dollar amount in a totalAmount var which it displays on a label at the bottom of my form.
That is a mess that doesnt work. Is there an easier way to accomplish this? Any help is appreciated.
I am working on a small program to track the debt my brother is in to me (he borrows a lot of money

Gasoline $-20.00
Food $-5.00
Washed my car $+10.00
I am reading in the txt file using StreamReader on form load and wrote a sub procedure called GetDollarAmounts() which uses a for loop to go through each character and look for the $ sign using SubString. When it finds that dollar sign, it then reads in the appropriate sign and Substrings to the first number and does a do...while to get all numbers (via an IsNumeric function I wrote). It finally puts the dollar amount in a totalAmount var which it displays on a label at the bottom of my form.
That is a mess that doesnt work. Is there an easier way to accomplish this? Any help is appreciated.