Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please find attached some code I'd 1

Status
Not open for further replies.

richardii

Programmer
Jan 8, 2001
104
GB
Please find attached some code I'd like to process. What I need to do is to add the value of Width to Left, so in this case the first instance of Left becomes 216+1024. Then I need to output the file (this part I can do!) I'm finding this a bit tricky as I think I need getline to do it, and I don't understand how it works.

object CustMainForm: TCustMainForm
Left = 216
Top = 110
Width = 1024
Height = 768
Caption = 'Customer Maintenance'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Default'
Font.Style = []
Menu = MainMenu1
OldCreateOrder = True
Position = poScreenCenter
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object CoolBar2: TCoolBar
Left = 0
Top = 0
Width = 1016
Height = 40
AutoSize = True
Bands = <
item
Control = ToolBar1
ImageIndex = -1
MinHeight = 36
Width = 1012
end>
 
Try this. You may want to add some error checking if there is a possibility of the file not being in the format expected.

{
if ($1 == &quot;Left&quot;) {
getline a
getline b
split(b,c,&quot; &quot;)
$3 += c[3]
print &quot; &quot; $0
print a
print b
}
else {
print
}
}
CaKiwi
 
Thanks, great tip, does exactly what's required.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top