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
0003667 [JEDI VCL] 00 JVCL Components major always 2006-04-28 08:31 2006-05-03 05:30
Reporter ivan_ra View Status public  
Assigned To ivan_ra
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0003667: JvInterpreter: non-standard var params does not works
Description Var 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 Information JvInterpreter 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);
Tags No tags attached.
Attached Files zip file icon FormsExample.zip [^] (2,766 bytes) 2006-04-28 08:32
? file icon JvInterpreter.pas.svn.patch [^] (2,206 bytes) 2006-04-28 08:34
? file icon JvInterpreter.pas.patch [^] (2,551 bytes) 2006-05-02 02:25

- Relationships
related to 0003650resolvedivan_ra Strange code in IvInterpreter 

-  Notes
(0009197)
ivan_ra (developer)
2006-04-28 08:37

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
(0009198)
ivan_ra (developer)
2006-04-28 20:56

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)
(0009229)
ivan_ra (developer)
2006-05-02 02:23

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
(0009247)
ivan_ra (developer)
2006-05-03 05:30

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


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