Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub btnsave_Click()
- On Error Resume Next
- With entity
- .id = encrypt(txtid.Text) 'sets the id variable to the encrypted version of the text in the id text box
- .name = encrypt(txtname.Text)
- .attackpower = encrypt(txtap.Text)
- .defence = encrypt(txtdef.Text)
- .abilities = encrypt(txtabilities.Text)
- .description = encrypt(txtdesc.Text)
- End With
- Open path For Random As FreeFile Len = length 'opens the file
- If assetopen = False Then 'checks if an existing asset is open
- currentrecord = Int(LOF(filenumber) / length) + 1 'sets the current record to 1 after the last one in the file
- entity.lineid = 1000 + currentrecord 'makes an id for the line it is being placed in
- End If
- Put #filenumber, currentrecord, entity 'places the data in the file
- Close filenumber 'closes the file
- txtid.Text = ""
- txtname.Text = ""
- txtap.Text = ""
- txtabilities.Text = ""
- txtdef.Text = ""
- txtdesc.Text = ""
- assetopen = False
- End Sub
Add Comment
Please, Sign In to add comment