I want to read log file, find in it this "K:\import_export\" and show full line this this value from log to dialog memo or list and loop this log checking.
I tried different codes, but i'm new to macro and don't know what to do now
Please help.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 247
Top = 97
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Read_file'
ClientHeight = 804
ClientWidth = 431
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object MSButton1: tMSButton
Left = 245
Top = 8
Width = 75
Height = 25
Caption = 'Browse'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
object Edit1: TEdit
Left = 64
Top = 12
Width = 161
Height = 21
TabOrder = 1
Text = 'Failas'
end
object MSMemo1: tMSMemo
Left = 32
Top = 88
Width = 369
Height = 681
TabOrder = 2
end
object MSButton2: tMSButton
Left = 171
Top = 53
Width = 75
Height = 25
Caption = 'Start'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 11
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,PerformBrowse
AddDialogHandler>Dialog1,MSButton2,OnClick,read
Show>Dialog1,r
SRT>PerformBrowse
SetDialogProperty>Dialog1,MSButton1,DoBrowse,TRUE
GetDialogProperty>Dialog1,MSButton1,Filename,theFile
SetDialogProperty>Dialog1,Edit1,Text,theFile
END>PerformBrowse
SRT>read
Let>k=1
While>line<>##EOF##
ReadLn>theFile,k,line
If>line=K:\import_export\,rodo
SRT>rodo
SetDialogProperty>Dialog1,MSMemo1,text,line
END>rodo
endif
Let>k=k+1
EndWhile
END>read
Exit>0