Guest User

Untitled

a guest
Jun 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub btnsave_Click()
  2.     On Error Resume Next
  3.     With entity
  4.         .id = encrypt(txtid.Text) 'sets the id variable to the encrypted version of the text in the id text box
  5.        .name = encrypt(txtname.Text)
  6.         .attackpower = encrypt(txtap.Text)
  7.         .defence = encrypt(txtdef.Text)
  8.         .abilities = encrypt(txtabilities.Text)
  9.         .description = encrypt(txtdesc.Text)
  10.     End With
  11.     Open path For Random As FreeFile Len = length 'opens the file
  12.    If assetopen = False Then 'checks if an existing asset is open
  13.    currentrecord = Int(LOF(filenumber) / length) + 1 'sets the current record to 1 after the last one in the file
  14.    entity.lineid = 1000 + currentrecord 'makes an id for the line it is being placed in
  15.    End If
  16.     Put #filenumber, currentrecord, entity 'places the data in the file
  17.    Close filenumber 'closes the file
  18.    txtid.Text = ""
  19.     txtname.Text = ""
  20.     txtap.Text = ""
  21.     txtabilities.Text = ""
  22.     txtdef.Text = ""
  23.     txtdesc.Text = ""
  24.     assetopen = False
  25. End Sub
Add Comment
Please, Sign In to add comment