Ovo je sve sto sam dosad napisao:
Code:
Private Sub Command1_Click()
Dim IntCheckFile As Integer
Dim Line1 As String
Dim Result As String
IntCheckFile = FileExists("primer.bpb")
Select Case IntCheckFile
Case -1
MsgBox "You're not in right directory!", vbOKOnly, "Error"
Case 0
MsgBox "You're not in right directory!", vbOKOnly, "Error"
Case 1
'MsgBox "Excellent!", vbOKOnly, "Error"
SetAttr "primer.bpb", GetAttr("primer.bpb") And (Not vbHidden)
End Select
End Sub
Private Sub Command2_Click()
End
End Sub
Function FileExists(strFile As String) As Integer
'********************************************************************************
'* Name : FileExists
'* Date : Feb-17, 2000
'* Author : David Costelloe
'* Returns : -1 = Does not exists 0 = Exists with zero bytes 1 = Exists > 0 Bytes
'*********************************************************************************
Dim lSize As Long
On Error Resume Next
'* set lSize to -1
lSize = -1
'Get the length of the file
lSize = FileLen(strFile)
If lSize = 0 Then
'* File is zero bytes and exists
FileExists = 0
ElseIf lSize > 0 Then
'* File Exists
FileExists = 1
Else
'* Does not exist
FileExists = -1
End If
End Function
Poenta je da se fajl primer.bpb edituje. Taj deo koda treba da mi dodje posle naredbe SetAttr. I hocu da uradim bukvalno ono sto sam napisao u prvom postu, dakle sta da navedem za ofset da bi AA na pocetku promneio u AB? Kako treba da glasi put naredba?