View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003170 | JEDI VCL | 00 JVCL Components | public | 2005-08-29 09:31 | 2006-04-05 01:18 |
Reporter | ivan_ra | Assigned To | obones | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | 3.30 | |||
Summary | 0003170: JvInterpreter assigns 0 to all integer var parameters | ||||
Description | This is simple procedure with var integer parameter: procedure GetVarParameter(var MyPar:integer); begin MyPar:=4; end; When I run this procedure in JvInterpreter it always set MyPar to 0. Please fix it | ||||
Additional Information | When I look to code I see strange things: function JvInterpreterVarAsType(const V: Variant; const VarType: Integer): Variant; begin if (TVarData(V).VType = varEmpty) or (TVarData(V).VType = varNull) then begin ... end else begin if TVarData(V).VType = varInteger then begin if (TVarData(V).VType = VarType) then ///////////////////////////////////////////////////////////////// Result := Ord(V = True) // when V is integer and desired result is integer it's always 0! //////////////////////////////////////////////////////////////// else Result := Integer(V) end else ... This procedure is calling from TJvInterpreterVarList.SetValue, so all integer var parameters will be 0 | ||||
Tags | No tags attached. | ||||
2005-08-29 09:33
|
RunFormDemo.zip (3,658 bytes) |
|
May be, not if (TVarData(V).VType = VarType) then but: if (varBoolean = VarType) then ??? |
|
This seems to be already fixed in rev. 1.66 of JvInterpreter.pas: http://cvs.sourceforge.net/viewcvs.py/jvcl/dev/JVCL3/run/JvInterpreter.pas?r1=1.65&r2=1.66 |
|
Ok. But I think this part of code is unnecessary: ... else begin //--------------------- cut here ---------------------------------- if (TVarData(V).VType = varBoolean) and (VarType = varInteger) then Result := Ord(V = True) else if TVarData(V).VType = varInteger then Result := Integer(V) else //--------------------- cut here ---------------------------------- if TVarData(V).VType = varArray then begin TVarData(Result) := TVarData(V); TVarData(Result).VType := VarType; end else Result := VarAsType(V, VarType); end; This typecasting converts boolean "true" to 1, not to -1 as VarAsType function, and nothing else. This feature is not uses anywhere. So, code can be shorter and clear: ... else begin if TVarData(V).VType = varArray then begin TVarData(Result) := TVarData(V); TVarData(Result).VType := VarType; end else Result := VarAsType(V, VarType); end; |
|
This is now ready to be committed in CVS as soon as it is backonline http://sourceforge.net/docs/A04/ |
|
This is now in CVS |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-08-29 09:31 | ivan_ra | New Issue | |
2005-08-29 09:33 | ivan_ra | File Added: RunFormDemo.zip | |
2005-08-29 09:39 | ivan_ra | Note Added: 0007889 | |
2005-08-30 15:05 | remkobonte | Note Added: 0007895 | |
2005-08-31 00:58 | ivan_ra | Note Added: 0007897 | |
2006-04-03 04:03 | obones | Relationship added | has duplicate 0003152 |
2006-04-03 04:14 | obones | Note Added: 0008824 | |
2006-04-03 04:14 | obones | Status | new => confirmed |
2006-04-05 01:18 | obones | Status | confirmed => resolved |
2006-04-05 01:18 | obones | Resolution | open => fixed |
2006-04-05 01:18 | obones | Assigned To | => obones |
2006-04-05 01:18 | obones | Note Added: 0008925 |