Issue 115663 - ISMISSING Function changes parameters status
Summary: ISMISSING Function changes parameters status
Status: CLOSED WONT_FIX
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: ab
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2010-11-19 00:34 UTC by gregmcc
Modified: 2017-05-20 09:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Testing IsMissing functionality ... (12.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2010-11-20 00:02 UTC, gregmcc
no flags Details
Optional Parameter Calling IMPROVED ODS (14.25 KB, text/plain)
2010-11-21 23:40 UTC, gregmcc
no flags Details
Spreadsheet that exhibits IsMissing function error (642.21 KB, application/vnd.oasis.opendocument.spreadsheet)
2010-11-25 22:28 UTC, gregmcc
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description gregmcc 2010-11-19 00:34:00 UTC
Hi Folks ...

I have been using the IsMissing function for ages on previous revisions of OO - 
and now I have come to run the same software on OO3.3m14 and come upon a 
problem.   

The function ISMISSING changes the parameters status from 'Missing'  
to   'Error" 

It is like Schrodinger's cat...  It changes once it is looked at 

If it has always done this and there is no change to be made then the 
documentation ought to change to acknowledge this quirk... And should state 
that you can only test a variable with the ISMISSING function ONCE. Once it has 
been tested - the variable does then exist - and has it's associated ERROR tag 
set.



GregMcC
Liverpool, UK
Comment 1 Joost Andrae 2010-11-19 10:13:17 UTC
seems to be BASIC related; changing component to API
Comment 2 michael.ruess 2010-11-19 10:53:01 UTC
Hi Greg, 
could you please attach a sample document containing the macro which seems to be
working incorrectly? Thanks for supporting us!
Comment 3 Joost Andrae 2010-11-19 11:51:55 UTC
ja->ab: please have a look at this issue
Comment 4 gregmcc 2010-11-20 00:02:33 UTC
Created attachment 75071 [details]
Testing IsMissing functionality ...
Comment 5 gregmcc 2010-11-21 23:40:15 UTC
Created attachment 75082 [details]
Optional Parameter Calling IMPROVED ODS
Comment 6 gregmcc 2010-11-22 00:25:36 UTC
Oh goodness - I am trying to simplify some coding so I can just give you the 
core element that is giving the problem - and I can't replicate it when I 
convert it to a simple format - Can you just hold on this Issue - It is an 
issue: I just can't prove that it is an issue - I'll get back to you...
Comment 7 michael.ruess 2010-11-23 09:29:09 UTC
This is in Calc. Reassigning.
Comment 8 oc 2010-11-24 11:38:10 UTC
reassigning to owner of correct component
Comment 9 gregmcc 2010-11-25 22:28:42 UTC
Created attachment 75144 [details]
Spreadsheet that exhibits IsMissing function error
Comment 10 gregmcc 2010-11-25 23:44:32 UTC
Right - I have cut down the spreadsheet in which the fault is exhibiting itself 
( Attached ) - As I have said in my previous messages : I can't seem to 
replicate it in a clean spreadsheet. I can't believe that this is a corruption -
 because surely that would move focus and come up with different errors. But I 
am at a loss otherwise.

The spreadsheet YYYYmmNN_EQIC_CutDown_Rev823e50   consists of three sheets. It 
is the ScheduleOfTestResults sheet that is of interest. When information is 
typed into a cell the first thing it does is to call the FindRow function. This 
function finds the row where a specific text exists - in this case 'Test 
Instruments'. It is doing this to find the lower boundary of the table. The 
table rows can be deleted or merged to suit the needs of the electrical 
installation.   The FindRow Function is also used to find rows in remote 
spreadsheets ( when the parameters 'File' and 'Path' are set ), but this isn't 
the case in this instance.  If you put a hold ( a Breakpoint ) on first few 
lines of the FindRow function - you be amazed to see that sSheet isn't passed 
into the routine and is therefore defined as a IsMissing parameter. 

	If IsMissing(sSheet) Then
		sSheet = Divulge("Sheet")
		oSheet = ThisComponent.Sheets.getByName( sSheet )
	else
		If IsMissing(sFile) then
			oSheet = ThisComponent.Sheets.getByName( sSheet )
		else
			If IsMissing(sPath) then
				oSheet = oOpenRemoteSheet(sSheet,sFile)
			else
				oSheet = oOpenRemoteSheet(sSheet,sFile,sPath)
			end if
		end if
	End if

And yet the 'else' aspect of the 'if' statement is the one that gets processed -
 with obvious errors being generated in the 'OpenRemoteSheet' function which is 
called in error ( with bad parameters ).

So this seems to be the only way that I can get the fault over to you. Please 
advise ...   If you don't want to swamp this 'issue' with comments and queries 
you can contact me at GregMcCormack@uwclub.net - and then we can leave the core 
comments on this web page.

Thanks for your help in advance - I will be really embarrassed if it is 
something silly that I have overlooked - but it has been over week now since I 
got stuck on this issue.

Regards

Greg McC
Liverpool, UK
Comment 11 jsc 2010-11-26 05:37:20 UTC
jsc -> ab: one for you
Comment 12 gregmcc 2010-11-27 23:09:46 UTC
Just put the spreadsheet on an old machine running OO 3.0.1 version - and the 
IsMissing function is correctly operating on that version.

GregMcC
Liverpool UK
Comment 13 ab 2010-12-10 12:59:44 UTC
Hi Greg,
I'm currently looking at this problem. What do I have to do
in the spreadsheet to force FindRow to be called? Although
typing information in a cell, FindRow is not called.
Comment 14 gregmcc 2010-12-10 21:00:09 UTC
Using the last attachment - '...EQIC_CutDown...'

Macros have to be enabled. Once the spreadsheet is loaded - it comes up with a 
message telling you that the Workbook macros are working.  If after an error or 
something - you need to restart them ( then there is a special button on the 
Reference Sheet for doing just that ).

On the ScheduleOfTestResults sheet - change the value of a watched cell - such 
as H16.

And the FindRow macro is called ...

On the version of OO ( 3.2.1 ) that I am using it works fine ... ( I had to go 
back to using the older version ) ...   But on the newer one OOO330m15 the 
IsMissing test was screwing up...

Any more info - just ask ... ( I would have to reload 330m15 on another machine 
to replicate the error - I will do that soon - to enable me to help you 
further )

Regards

Greg

Comment 15 ab 2010-12-13 11:09:17 UTC
Hi Greg,

I've found the reason for the problem. You are right, the
behavior concerning missing parameters really has changed,
but it has only changed for VBA mode (Option VBASupport 1).
In VBA missing parameters of type object and string are
handled differently. Objects simply become NULL, strings
become empty, but IsMissing returns false. This has been
fixed for VBA mode.

That's exactly what the VBA mode is for: It allows to chan-
ge the OOo Basic behavior in order to improve VBA compatibi-
lity without breaking old OOo Basic programs *not* using
this mode, but there's no way to avoid breaking non VBA
programs that explicitely activate it. Otherwise it would
be impossible to fix issues concerning VBA compatibility.

I don't know why you use "Option VBASupport 1" in an ods do-
cument without using (?) VBA API, but it's kind of "on own
risk". Activating the VBASupport option actually should al-
low to run original VBA macros from Excel documents. Chan-
ging the runtime behavior in this context is no problem as
long as the compatibility improves. Before it wouldn't have
worked correctly anyway.

So to have a stable API you should not use "Option VBASup-
port 1". If you need it for some reason, you sometimes may
have to change your code. In this case you will have to test
for an empty string instead of using IsMissing.

I hope this is acceptable. :-)

Regards

Andreas


-> WONTFIX for the described reasons