View Issue Details

IDProjectCategoryView StatusLast Update
0003667JEDI VCL00 JVCL Componentspublic2006-05-03 05:30
Reporterivan_raAssigned Toivan_ra 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.30 
Summary0003667: JvInterpreter: non-standard var params does not works
DescriptionVar params with non-standard param name always returns unassigned.
"Standard" param names are names listed in TypeName2VarTyp function.

So, form close event not works, because TCloseAction is not listed in TypeName2VarTyp:

procedure TMDIChild.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

This procedure always returns Action = unassigned.
So, MDIChild window cant close. Look at example.
Additional InformationJvInterpreter looses such values in TJvInterpreterVarList.SetValue function, in this espression:
        JvInterpreterVarAssignment(V.Value, JvInterpreterVarAsType(Value, V.VTyp and not varByRef));

in case when ParamTypeName not listed in TypeName2VarTyp function, after compiling (Compile procedure), paramtype for "Action" is this:
V.VTyp = varEmpty or varByRef
and JvInterpreterVarAsType(Value, V.VTyp and not varByRef) returns unassigned when Value = caFree (2).
I dont know, is this solutoin absolutely right, but this is fix: add in the end of
function JvInterpreterVarAsType
this strings:
    else //
    if (VarType = varEmpty) and not VarIsEmpty(V) then //
      Result := V //
    else
      Result := VarAsType(V, VarType);
TagsNo tags attached.

Relationships

related to 0003650 resolvedivan_ra Strange code in IvInterpreter 

Activities

2006-04-28 08:32

 

FormsExample.zip (2,766 bytes)

2006-04-28 08:34

 

ivan_ra

2006-04-28 08:37

developer   ~0009197

1) FormsExample works correctly with patch from 0003666
2) JvInterpreter patch also includes patch for non-closed 0003650 - sorry, I dont know how to separate them

ivan_ra

2006-04-28 20:56

developer   ~0009198

I think more correct solution is to do what we always do with var parameters: not pass they value, but pass they address.
In this case the code to change is:

TJvInterpreterFunction.InFunction.EnterFunction
and
TJvInterpreterFunction.InFunction.LeaveFunction.UpdateVarParams (may be we do not need this procedure when pass addresses)

ivan_ra

2006-05-02 02:23

developer   ~0009229

I see formclose method even cant start under D6_UP:
In procedure CheckNotSupportedFunctionParameters not works expression
if TVarData(FCurrArgs.Values[I]).VType in [varArray, varRecord] then...

this is working code:
      if (TVarData(FCurrArgs.Values[I]).VType = varArray)
      or (TVarData(FCurrArgs.Values[I]).VType = varRecord) then

2006-05-02 02:25

 

JvInterpreter.pas.patch (2,551 bytes)

ivan_ra

2006-05-03 05:30

developer   ~0009247

this now in SVN

Issue History

Date Modified Username Field Change
2006-04-28 08:31 ivan_ra New Issue
2006-04-28 08:32 ivan_ra File Added: FormsExample.zip
2006-04-28 08:34 ivan_ra File Added: JvInterpreter.pas.svn.patch
2006-04-28 08:37 ivan_ra Note Added: 0009197
2006-04-28 20:56 ivan_ra Note Added: 0009198
2006-05-02 02:23 ivan_ra Note Added: 0009229
2006-05-02 02:25 ivan_ra File Added: JvInterpreter.pas.patch
2006-05-03 05:30 ivan_ra Relationship added related to 0003650
2006-05-03 05:30 ivan_ra Status new => resolved
2006-05-03 05:30 ivan_ra Resolution open => fixed
2006-05-03 05:30 ivan_ra Assigned To => ivan_ra
2006-05-03 05:30 ivan_ra Note Added: 0009247