Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | optional string parameter default value is "0" and ismissing not working | ||||||
---|---|---|---|---|---|---|---|
Product: | Calc | Reporter: | bijugc <bijumaillist> | ||||
Component: | programming | Assignee: | AOO issues mailing list <issues> | ||||
Status: | UNCONFIRMED --- | QA Contact: | |||||
Severity: | Trivial | ||||||
Priority: | P3 | CC: | bobbuxton, elish, issues | ||||
Version: | OOo 2.4.0 | Keywords: | needhelp | ||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
Description
bijugc
2008-04-20 16:34:28 UTC
Can reproduce it in OOo-Dev_OOO300_m3_en-US on WinXP. How to perform step 7? I was about to open a very similar bug report and can provide a simple test case to demonstrate the problem still occurs of OO 4.1.0 VBA allows an optional parameter to be defined as - optional str as string = "abc" - the variable is not initialized to "abc" in OO Alternatively if no default is provided - optional mstr as string mstr - should not be initialized and isMissing(mstr) should return True it actually returns false and mstr is a null string OO works correctly for data type Double and Variant, I have not tested other data types This error is particularly insidious when porting from Excel since no error is raised and differences in function execution may not be readily apparent. I used the following function to show the problem: function TestOpt(optional num as double =123, optional str as string = "abc", optional numv =456, optional strv = "def", optional miss as double, optional mstr as string) as string Dim printstr as string printstr = "num: >>" &num &"<< isMissing " & isMissing(num) printstr = printstr & "; str: >>" &str &"<< isMissing " & isMissing(str) printstr = printstr & "; numv: >>" &numv &"<< isMissing " & isMissing(numv) printstr = printstr & "; strv: >>" &strv &"<< isMissing " & isMissing(strv) rem print printstr printstr = printstr & "; miss: >>" &miss &"<< isMissing " & isMissing(miss) printstr = printstr & "; mstr: >>" &mstr &"<< isMissing " & isMissing(mstr) print printstr TestOpt = printstr end function Output is num: >>123<< isMissing False; str: >><< isMissing False; numv: >>456<< isMissing False; strv: >>def<< isMissing False; miss: >>Error ǀ<< isMissing True; mstr: >><< isMissing False str and mstr are handled incorrectly, other formats are correct Created attachment 83736 [details]
Function to demonstrate problem
|