|
Code transformation rule
|
Code before transformation
|
Code after transformation
|
|---|
|
|
MESSAGE('Hello');
x := y;
MESSAGE('World');
Note
Omitting the REPLACE instruction in the code transformation rule implies deletion.
|
MESSAGE('Hello');
MESSAGE('World');
|
<find>
x := y;
<replace>
y := z;
|
MESSAGE('Hello');
x := y;
MESSAGE('World');
|
MESSAGE('Hello');
y := z;
MESSAGE('World');
|
<find>
x := TRUE;
<replace>
;
<find>
y := x;
<replace>
x := TRUE;
<find>
y := x;
<replace>
x := FALSE;
|
MESSAGE('Hello');
y := x;
MESSAGE('World');
Note
Rules are evaluated from top to bottom. Rules are run again if a match is found.
|
MESSAGE('Hello');
;
MESSAGE('World');
|
<find>
x := y;
<atTrigger>
OnOpenForm
|
OnInit=BEGIN
MESSAGE('Hello');
x := y;
MESSAGE('World');
END;
OnOpenForm=BEGIN
MESSAGE('Hello');
x := y;
MESSAGE('World');
END;
|
OnInitPage=BEGIN
MESSAGE('Hello');
x := y;
MESSAGE('World');
END;
OnOpenPage=BEGIN
MESSAGE('Hello');
MESSAGE('World');
END;
|
<find>
x := z;
<comment>
Hello world
|
MESSAGE('Hello');
x := z;
//comment
MESSAGE('World');
|
MESSAGE('Hello');
//comment
MESSAGE('World');
|
<find>
CurrForm.!var1!.HEIGHT := TRUE;
<declareVariable>
!var1!Height
<declareVariableType>
Integer
<replace>
!declaredVariable! := TRUE;
|
OnRun=BEGIN
MESSAGE('Hello');
CurrForm.x.HEIGHT := TRUE;
MESSAGE('World');
END;
|
VAR
xHeight : Integer;
OnRun=BEGIN
MESSAGE('Hello');
xHeight := TRUE;
MESSAGE('World');
END;
|
<find>
Text := '';
<declareVariable>
!control!HideValue
<declareVariableType>
Boolean INDATASET
<replace>
!declaredVariable := TRUE;
<atTrigger>
OnFormat
<moveToProperty>
HideValue
<moveValueToProperty>
!declaredVariable!
<movePropertyToControlName>
!control!
|
SourceExpr := x;
OnFormat=BEGIN
MESSAGE('Hello');
Text := '';
MESSAGE('World');
END;
Note
Assume that the preceding code is in a control with SourceExpr = x. The rule functions in the same way if the code is in a control with the Name property = x, or ID = x.
|
VAR
xHideValue : Boolean INDATASET;
SourceExpr = x;
HideValue = xHideValue;
OnFormat=BEGIN
MESSAGE('Hello');
xHideValue := TRUE;
MESSAGE('World');
END;
|
<find>
y := x;
<atTrigger>
OnActivateForm
<replace>
;
<moveToTrigger>
OnOpenForm
<moveCodeToTrigger>
y := x;
|
OnActivateForm=BEGIN
MESSAGE('Hello');
y := x;
MESSAGE('World');
END;
|
OnActivateForm=BEGIN
MESSAGE('Hello');
;
MESSAGE('World');
END'
OnOpenForm=BEGIN
y := x;
END;
|
<find>
y := !var!
<replace>
y := TRUE;
|
MESSAGE('Hello');
y := x;
x := z;
MESSAGE('World');
|
MESSAGE('Hello');
y := TRUE;
x := z;
|
<find>
!var1! := !var2!
<replace>
!var2! := !var1!
|
MESSAGE('Hello');
y := x;
x := z;
MESSAGE('World;);
|
MESSAGE('Hello');
x := y;
z := x;
MESSAGE('World');
|
<find>
!currForm!.EDITABLE := TRUE
<replace>
;
|
MESSAGE('Hello')
CurrForm.EDITABLE := TRUE;
MESSAGE('World');
|
MESSAAGE('Hello');
;
MESSAGE('World');
|
<find>
!currForm!.EDITABLE := TRUE
<replace>
;
|
MESSAGE('Hello')
CurrReport.EDITABLE := TRUE;
MESSAGE('World');
|
MESSAAGE('Hello');
;
MESSAGE('World');
|