All kinds of help...

sftballuvr
09-06-2003, 02:37 PM
I have a project due for my class in a couple of days. I have finished 95% of it. I am having trouble loading and saving to a Random Access File and making a percentage calculation work properly. I know I have just made an error in my coding somewhere for the percentage, but I am just not seeing it. And as far as the RAF goes, I am completely confused.

lblCorrect is the number of answers the user has correct, which calculates correctly and lblNumber is the total number of answered entered which also calculates correctly. If all answers are correct, it displays 100% but once a wrong answer is entered, it displays 0%

lblAverage.Caption = (lblCorrect.Caption) \ (lblNumber.Caption)
lblAverage.Caption = Format(lblAverage.Caption, "percent")

And like I said, I am not understanding the RAF's at all. I am very confused and how they are laid out, how to read the information and how to write to them. :confused:

Please help

SnakeChomp
09-06-2003, 02:40 PM
lblAverage.Caption = val(lblCorrect.Caption) / val(lblNumber.Caption) That will divide the value of the captions, instead of trying to divide two strings, which doesn't happen. Also note that dividing using the "\" character will result in an integer, meaning the result has no decimal. 1 \ 2 = 0. 1 / 2 = .5 however.

sftballuvr
09-06-2003, 02:45 PM
Thank you. I had tried that before, but was using the integer divider.

Any help on the Random Access Files?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum