Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001860 [JEDI VCL] 00 JVCL Components major always 2004-06-14 09:49 2006-01-26 00:53
Reporter AlexeiR View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0001860: JvInterpreter: cannot access form fields
Description I've attached application that creates scripted form.
A form tries to assign some public fields in OnCreate handler, but interpreter exception occurs.
The same with methods works well.
Fix that please!
Additional Information
Tags No tags attached.
Attached Files zip file icon InterpreterBug_FormFields.zip [^] (2,392 bytes) 2004-06-14 09:49
zip file icon Interpreter.zip [^] (45,572 bytes) 2004-09-14 05:13
zip file icon Interpreter.zip [^] (45,581 bytes) 2004-09-14 22:19
zip file icon FormFieldsSupport.zip [^] (47,250 bytes) 2004-09-20 03:38
zip file icon FormFieldsSupport1.zip [^] (47,892 bytes) 2005-08-18 08:01

- Relationships

-  Notes
(0005225)
maxp (reporter)
2004-09-13 03:34

It seems that only 'published' fields is accessible. May be by design?
(0005226)
ivan_ra (developer)
2004-09-14 05:13
edited on: 2004-09-14 05:15

It's by design. I have solution for this (works on beta1), but I can't check this solution on latest CVS because can't compile JvCore. May be developers will do it?
I will upload solution for beta1: JvInterpreter.zip (JvInterpreter.pas & JvInterpreterFm.pas). New code is marked by ($IFDEF CLASS_FIELDS_SUPPORT}.
This is list of changed routines:

destructor TJvInterpreterAdapter.Destroy;
procedure TJvInterpreterAdapter.ClearSource;
procedure TJvInterpreterUnit.InterpretClass(const Identifier: string);

TJvInterpreterForm: add new field FFieldList: TJvInterpreterVarList;
constructor TJvInterpreterForm.CreateNew
destructor TJvInterpreterForm.Destroy;
procedure TJvInterpreterFm.LoadForm(AForm: TJvInterpreterForm);
function TJvInterpreterFm.GetValue
function TJvInterpreterFm.SetValue

edited on: 09-14-04 05:15
(0005227)
ivan_ra (developer)
2004-09-14 22:17

I missed "raise" statement in TJvInterpreterUnit.InterpretClass:

  FieldsPattern:=TJvInterpreterVarList.Create;
  try
...
  except
    FieldsPattern.Free;
    raise; // <- here
  end;

more correct version of Interpreter.zip uploaded
(0005240)
ivan_ra (developer)
2004-09-20 03:59

FormFieldsSupport.zip (JvInterpreter.pas & JvInterpreterFm.pas) - is support for fields in interpreted forms, for latest JVCL(beta2), and without change of interface.
- new code is marked by {$IFDEF CLASS_FIELDS_SUPPORT}
- all fields are public
- property declaration not supported
- there is no control of correspondence between form resources (dfm) and form fields and methods
(0007767)
obones (administrator)
2005-08-10 03:27

Is this still applicable on the latest JVCL code ?
(0007810)
ivan_ra (developer)
2005-08-18 07:57
edited on: 2005-08-18 08:04

This is still applicable.
I tested form fields support with JVCL3 release.
I will post new files based on JVCL3 release code (not latest CVS files, because interfase changed - there are new RsArrayToArrayAssignment const, SubStrBySeparator function and so on).
Code still marked with CLASS_FIELDS_SUPPORT comment

And this is new small issue:
TJvInterpreterAdapter can work with same identifiers from different units, for example:
unit1.myProcedure
unit2.myProcedure
But in current realization after "compilation" adapter looses information about units for some identifiers. I added code to store information about unit names. This is functions:
TJvInterpreterAdapter.AddConstEx
TJvInterpreterAdapter.AddExtFunEx
...
TJvInterpreterAdapter.Add...Ex
Look on strings marked with comment: // Ivan_ra (unit control & form designer)
For example:

procedure TJvInterpreterAdapter.AddClassEx(const UnitName: string; AClassType: TClass;
  const Identifier: string; Data: Pointer);
var
  JvInterpreterClass: TJvInterpreterClass;
begin
  JvInterpreterClass := TJvInterpreterClass.Create;
  JvInterpreterClass.FClassType := AClassType;
  JvInterpreterClass.Identifier := Identifier;
  JvInterpreterClass.Data := Data;
  JvInterpreterClass.UnitName := UnitName; // Ivan_ra (unit control & form designer)
  FClassList.Add(JvInterpreterClass);
  FSorted := False; // Ivan_ra
end;

Now compiled code has information about UnitName. This code added to sended file too.

(0007884)
ivan_ra (developer)
2005-08-29 00:12

Nevertheless, for me it would be better to change interface:
1. Create new class TJvInterpreterSrcClass with special field/property VarList:TJvInterpreterVarList (public); We also must to add Create/Destroy methods to class to handle this list; May be, Assign method too.
Objects of this class will be members of TJvInterpreterAdapter.FSrcClassList. So, fields information will store in special list, not in data as in my solution
2. Add private field FVarList: TJvInterpreterVarList to TJvInterpreterForm. This field must substitute FMethodList[0] pointer in my solution.
3. See also issue 0003166
(0008456)
ivan_ra (developer)
2006-01-25 13:07

This closed in 0003420
(0008459)
obones (administrator)
2006-01-26 00:53

As indicated by ivan_ra, this is fixed in 0003420

- Issue History
Date Modified Username Field Change
2004-06-14 09:49 AlexeiR New Issue
2004-06-14 09:49 AlexeiR File Added: InterpreterBug_FormFields.zip
2004-09-13 03:34 maxp Note Added: 0005225
2004-09-14 05:13 ivan_ra Note Added: 0005226
2004-09-14 05:13 ivan_ra File Added: Interpreter.zip
2004-09-14 05:15 ivan_ra Note Edited: 0005226
2004-09-14 06:49 ivan_ra Issue Monitored: ivan_ra
2004-09-14 06:49 ivan_ra Issue End Monitor: ivan_ra
2004-09-14 22:17 ivan_ra Note Added: 0005227
2004-09-14 22:19 ivan_ra File Added: Interpreter.zip
2004-09-20 03:38 ivan_ra File Added: FormFieldsSupport.zip
2004-09-20 03:59 ivan_ra Note Added: 0005240
2005-08-10 03:27 obones Note Added: 0007767
2005-08-10 03:27 obones Status new => feedback
2005-08-18 07:57 ivan_ra Note Added: 0007810
2005-08-18 08:01 ivan_ra File Added: FormFieldsSupport1.zip
2005-08-18 08:04 ivan_ra Note Edited: 0007810
2005-08-29 00:12 ivan_ra Note Added: 0007884
2006-01-25 13:07 ivan_ra Note Added: 0008456
2006-01-26 00:53 obones Status feedback => resolved
2006-01-26 00:53 obones Resolution open => fixed
2006-01-26 00:53 obones Assigned To => obones
2006-01-26 00:53 obones Note Added: 0008459


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker