View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003600 | JEDI VCL | 00 JVCL Components | public | 2006-03-21 01:16 | 2006-04-21 03:05 |
Reporter | ivan_ra | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.10 | ||||
Target Version | Fixed in Version | 3.30 | |||
Summary | 0003600: JvInterpreter does not recognizes unassigned values (workaround) | ||||
Description | JvInterpreter raises on any of this scripts: procedure testEmpty1; var temp:string; begin ShowMessage(temp); end; procedure testEmpty1; var temp1,temp2:variant; begin temp1:=temp2; end; procedure TestExcel; var Sheet,aValue:variant; begin Sheet:=CreateOleObject('Excel.Sheet'); aValue:=Sheet.Application.range('a1').Value; // here showmessage(aValue); end; | ||||
Additional Information | this repeats every time when expression returns unassigned value. in this case JvInterpreter assumes what there is no code in this place. The cause of problem is incomplete TJvInterpreterExpression.Expression1 function. This is patch fixing this problem | ||||
Tags | No tags attached. | ||||
2006-03-21 01:18
|
JvInterpreter.pas.patch (1,185 bytes)
Index: run/JvInterpreter.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvInterpreter.pas,v retrieving revision 1.72 diff -u -r1.72 JvInterpreter.pas --- run/JvInterpreter.pas 20 Mar 2006 11:59:57 -0000 1.72 +++ run/JvInterpreter.pas 21 Mar 2006 07:28:47 -0000 @@ -5381,7 +5381,7 @@ NextToken; end; ttRB: - if TVarData(Result).VType = varEmpty then + if (TVarData(Result).VType = varEmpty) and (FprevTTyp<>ttIdentifier) then ErrorExpected(LoadStr2(irExpression)) else Exit; @@ -5394,12 +5394,12 @@ NextToken; end; ttRS: - if TVarData(Result).VType = varEmpty then + if (TVarData(Result).VType = varEmpty) and (FprevTTyp<>ttIdentifier) then ErrorExpected(LoadStr2(irExpression)) else Exit; else - if TVarData(Result).VType = varEmpty then + if (TVarData(Result).VType = varEmpty) and (FprevTTyp<>ttIdentifier) then ErrorExpected(LoadStr2(irExpression)) else Exit; |
2006-03-22 09:22
|
JvInterpreter.pas.patch1 (1,488 bytes) |
|
Sorry, the patch was incomplete. Use JvInterpreter.pas.patch1 It can handle functions returning unassigned value too |
|
What about this patch? its very simple JvInterpreter.pas.patch handles unassigned variables, properties and functions without arguments. JvInterpreter.pas.patch1 also handles same expressions: aValue:=SomeFunctionReturningUnassignedValue(x1,x2,x3); |
2006-04-20 01:38
|
JvInterpreter.pas.svn.patch (1,296 bytes)
Index: JvInterpreter.pas =================================================================== --- JvInterpreter.pas (revision 10535) +++ JvInterpreter.pas (working copy) @@ -5211,10 +5211,12 @@ function Expression(const OpTyp: TTokenKind): Variant; var Tmp: Variant; + aPrevTTyp:integer; begin Result := Unassigned; if OpTyp <> ttUnknown then NextToken; + aPrevTTyp:=TTyp; while True do begin case TTyp of @@ -5390,7 +5392,7 @@ NextToken; end; ttRB: - if TVarData(Result).VType = varEmpty then + if (TVarData(Result).VType = varEmpty) and (aPrevTTyp<>ttIdentifier) then ErrorExpected(LoadStr2(irExpression)) else Exit; @@ -5403,12 +5405,12 @@ NextToken; end; ttRS: - if TVarData(Result).VType = varEmpty then + if (TVarData(Result).VType = varEmpty) and (aPrevTTyp<>ttIdentifier) then ErrorExpected(LoadStr2(irExpression)) else Exit; else - if TVarData(Result).VType = varEmpty then + if (TVarData(Result).VType = varEmpty) and (aPrevTTyp<>ttIdentifier) then ErrorExpected(LoadStr2(irExpression)) else Exit; |
|
This is now in SVN. Next time, please respect the style guide for the JVCL, it is VERY annoying to have to change code before inclusion. And a bit of background info: When an issue is set to "Acknowledged", it means that we have seen it, that we understand it, but we don't have the time to look at it right now. There is no point adding a new note to the issue unless you provide new files or new information. |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-03-21 01:16 | ivan_ra | New Issue | |
2006-03-21 01:18 | ivan_ra | File Added: JvInterpreter.pas.patch | |
2006-03-22 09:22 | ivan_ra | File Added: JvInterpreter.pas.patch1 | |
2006-03-22 09:23 | ivan_ra | Note Added: 0008716 | |
2006-03-22 11:37 | ivan_ra | Note Edited: 0008716 | |
2006-04-05 01:43 | ivan_ra | Note Added: 0008951 | |
2006-04-07 04:05 | obones | Status | new => acknowledged |
2006-04-20 01:38 | ivan_ra | File Added: JvInterpreter.pas.svn.patch | |
2006-04-21 03:05 | obones | Status | acknowledged => resolved |
2006-04-21 03:05 | obones | Fixed in Version | => Daily / SVN |
2006-04-21 03:05 | obones | Resolution | open => fixed |
2006-04-21 03:05 | obones | Assigned To | => obones |
2006-04-21 03:05 | obones | Note Added: 0009163 |