VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A simple demonstration of saving/loading files with get and put commands. This program let you

by Bruno Silva (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Wed 21st June 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A simple demonstration of saving/loading files with "get" and "put" commands. This program let you generate a number, then let you save/load

Rate A simple demonstration of saving/loading files with get and put commands. This program let you




sub cmdAdd_Click ()
   ' add 1 to the counter and display it on a label
   counter1 = counter1 + 1
   label1.Caption = counter1
end sub

sub cmdSave_Click ()
   Dim strFn as string
   ' gets filename from user
   strFn = UCase$(Trim$(Inputbox$("Save as...", "Filename")))
   ' writes on file
   Open strFn for Binary Access Write as #1
   put #1, , counter1
   Close #1
end sub

sub cmdLoad_Click ()
   Dim strFn as string
   ' gets filename from user
   strFn = UCase$(Trim$(Inputbox$("Load as...", "Filename")))
   ' reads from file
   Open strFn for Binary Access Read as #1
   get #1, , counter1
   Close #1
end sub

Download this snippet    Add to My Saved Code

A simple demonstration of saving/loading files with get and put commands. This program let you Comments

No comments have been posted about A simple demonstration of saving/loading files with get and put commands. This program let you . Why not be the first to post a comment about A simple demonstration of saving/loading files with get and put commands. This program let you .

Post your comment

Subject:
Message:
0/1000 characters