Subject |
Too Many Symbols error - turning the problem |
From |
Carlos Pereira [APKomp] <carlos.pereira@apkomp.pt> |
Date |
Mon, 27 Mar 2023 20:47:50 +0100 |
Newsgroups |
dbase.getting-started |
We can solve (we have solved many times) this problem with:
A) Transferring procedures from the .wfm to a .prg:
A.1- in the procedures, add the parameter: Form
A.2- in calls to procedures, change the code of calls to procedures
B) Merge code from several procedures associated with events into a
single procedure:
B.1- in the objects in the code of the event(s) change the code to call
the same (a unique) procedure
B.2- in the procedure called (to be executed), include the code of all
procedures to be eliminated
A.1- Example:
In .wfm it was / was
Procedure DropFileOperation(wwfiledrop,wwaddiname,wwdiredest)
************
* Parameters
******
//...
************
//...
************
*
RETURN
In the .prg becomes / is
Procedure DropFileOperation(wwform,wwfiledrop,wwaddiname,wwdiredest)
************
* Parameters
******
* Form
LOCAL Form && disable when macrosubstitution and IF TYPE("Form.<...>")...
Form=wwform && Form=This.Parent
******
//...
************
//...
************
*
RETURN
A.2- Example:
In the .wfm the before call was
//...
CLASS::DropFileOperation(wfiledrop,waddiname,wdiredest)
//...
In the .wfm the call is now / became:
//...
DropFileOperation(Form,wfiledrop,waddiname,wdiredest)
//...
B.1- Example:
In the .wfm the before calls was
this.PUSHBUTTON55 = new PUSHBUTTON(this)
with (this.PUSHBUTTON55)
onClick = class::PUSHBUTTON55_ONCLICK
//...
this.PUSHBUTTON56 = new PUSHBUTTON(this)
with (this.PUSHBUTTON56)
onClick = class::PUSHBUTTON56_ONCLICK
//...
In the .wfm the calls are now / became:
this.PUSHBUTTON55 = new PUSHBUTTON(this)
with (this.PUSHBUTTON55)
onClick = class::PUSHBUTTONXXX_ONCLICK
//...
this.PUSHBUTTON56 = new PUSHBUTTON(this)
with (this.PUSHBUTTON56)
onClick = class::PUSHBUTTONXXX_ONCLICK
//...
B.2- Example:
In .wfm the before procedures was
Procedure PUSHBUTTON55_OnClick
*
//code PUSHBUTTON55_OnClick
*
RETURN
Procedure PUSHBUTTON56_OnClick
*
//code PUSHBUTTON56_OnClick
*
RETURN
In .wfm a unique procedure is now / became
Procedure PUSHBUTTONXXX_ONCLICK
*
DO CASE
CASE Form.ActiveControl.Name="PUSHBUTTON55"
//code PUSHBUTTON55_OnClick
CASE Form.ActiveControl.Name="PUSHBUTTON56"
//code PUSHBUTTON56_OnClick
//...
ENDCASE
*
RETURN
|
|