Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
3600 00 JVCL Components minor always 2006-03-21 01:16 2006-04-21 03:05
ivan_ra  
obones  
normal  
resolved 3.10  
fixed  
none    
none 3.30  
0003600: JvInterpreter does not recognizes unassigned values (workaround)
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;
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
? file icon JvInterpreter.pas.patch [^] (1,185 bytes) 2006-03-21 01:18
? file icon JvInterpreter.pas.patch1 [^] (1,488 bytes) 2006-03-22 09:22
? file icon JvInterpreter.pas.svn.patch [^] (1,296 bytes) 2006-04-20 01:38
Issue History
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

Notes
(0008716)
ivan_ra   
2006-03-22 09:23   
(edited on: 2006-03-22 11:37)
Sorry, the patch was incomplete. Use JvInterpreter.pas.patch1
It can handle functions returning unassigned value too

(0008951)
ivan_ra   
2006-04-05 01:43   
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);
(0009163)
obones   
2006-04-21 03:05   
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.