Vb6 label help
Page 1 of 1
Sublime




Posts: 8615

PostPosted: Thu, 2nd Mar 2006 02:07    Post subject: Vb6 label help
I want a label to display a number saved in a txt / dat file upon form load.

this number will change once the proggie has been exited so i need a save command too. I dont want anything fancy, just a single form with 1 label displaying for instance "100" saved in a file named text1.txt or whatever.


Stealth88 and Lod|_Dod| wrote:
"And the winner is.... Sublime!" That fucking kid is always right. Sublime FTW!

http://artpad.art.com/?irqy7s4162w <3 you too
Back to top
Dunge




Posts: 1201
Location: Québec
PostPosted: Sun, 12th Mar 2006 21:03    Post subject:
Guess you already found how to do it since then but here it is anyway. Btw it's more of a file input/output question than a label question.

Private Sub Read()
Dim strNumber As String
Open App.Path & "\file.dat" For Input As #1
Line Input #1, strNumber
label.Text = strNumber
End Sub

Private Sub Out()
Open App.Path & "\file.dat" For Output As #1
Print #1, label.Text
End Sub
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group