Issue 69252 - Inconsistent handling of Basic With Statements
Summary: Inconsistent handling of Basic With Statements
Status: ACCEPTED
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: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-05 02:13 UTC by terrye
Modified: 2017-05-20 11:27 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description terrye 2006-09-05 02:13:22 UTC
Another incompatibity between VBA and OOoBasic FYI:
 
i=1
With ThisComponent.Sheets(i)  ' or ActiveWorkbook.Sheet(i) in VBA
  MsgBox .Name
  i = 2
  MsgBox .Name
End With	

prints "Sheet2" and "Sheet3" in Calc/OOoB but "Sheet1" and "Sheet1" in
Excel/VBA.  (Ignoring the difference in offset which is a feature of the base
count for Sheet collections varying), the main point to note that OOo treats
With <x> as a symbolic macro substituting <x> before the appropriate bare dots.  
VBA treats With <x> as Dim tmp000x=<x> then substitutes tmp00x before the
appropriate bare dots.  

In otherwords, VBA evaluates With by value and OOoB evaluates it by reference. 
This difference can cause nasty migration surprises, and the value form also
generates a lot more efficient runtime Pcode.  The basic compiler should be
changed to be consistent with VBA at least for the Option Compatible mode.
Comment 1 ab 2006-09-05 08:21:38 UTC
STARTED, OOo 2.x
Comment 2 Martin Hollmichel 2007-11-09 17:28:37 UTC
set target from 2.x to 3.x according to
http://wiki.services.openoffice.org/wiki/Target_3x
Comment 3 Marcus 2017-05-20 11:27:35 UTC
Reset assigne to the default "issues@openoffice.apache.org".