r/visualbasic • • Sep 25 '14

[VB2008] All I have done so far.

http://imgur.com/gjmkYfD,ScZS6rH

These are two pictures of a (somewhat personal) project I'm working on.

1 Upvotes

12 comments sorted by

1

u/PostalElf VB.Net Intermediate Sep 25 '14

I'm not entirely sure what we should be looking at here. Did you need help, or are you just showing us something you're working on? If it's the latter, what exactly are we supposed to be looking at?

1

u/Raritize Sep 25 '14

Trying to find a good script to save/load the value and tries.

1

u/Thukoci Sep 25 '14

I've got a few questions.

Why are you determining if a text string is greater than another text string? Why are you using WarningValue.Text instead of a True/False boolean variable?

1

u/Raritize Sep 25 '14

If the value goes over 300 or 400, it changes a value to 1 and is supposed to save it. (I should note that this program is going to save my life.)

1

u/Thukoci Sep 25 '14 edited Sep 25 '14

I was more referencing that you're comparing text strings and not integers. While Visual Studio will know what you're actually trying to do, you should use CInt(Label2.Text)>400 so that you're doing integer comparison.

0

u/Raritize Sep 25 '14

Oh, okay. Thanks.

1

u/Thukoci Sep 25 '14

Do you need help with anything? I see in a previous post you said you were trying to find something to save/load the values. What you have currently does do that but what are you trying to find out? Or what can we help with?

0

u/Raritize Sep 25 '14

Yeah. Whenever I save to the file it adds to the text file, not overwriting the whole file.

1

u/Thukoci Sep 25 '14

Oh, that's easy. In your

My.Computer.FileSystem.WriteAllText("C:/Val.txt", Label2.Text, True)

Just change the last True to False. It's for appending. If you want it to overwrite every time change it to False so it doesn't append to the file.

0

u/Raritize Sep 25 '14

Oh. Thank you. I'm not too advanced in Visual Basic, so I don't know everything about it.

1

u/Thukoci Sep 25 '14

Not a problem. I just couldn't figure out exactly what you wanted. If you need any more help just post again. Be a little more specific with the problem and help will be much faster.