Apache OpenOffice (AOO) Bugzilla – Issue 92642
"dim name as String" prompts runtime error "BASIC syntax error"
Last modified: 2013-02-24 21:00:39 UTC
In MSO VBA, "name" can be defined as a variable or a Name object. e.g. Dim name as String ' name as a variable Dim n as Name ' Name is a object But the above macro will throw runtime error "BASIC syntax error" in OOo basic.
Created attachment 55682 [details] test document that demonstrates the problem.
Created attachment 55683 [details] patch for fixing the problem
Current patch can support three keywords to be used as variable including Name, Line, Text. But it has a limit. When a keyword "Name" is dim as a variable, the "Name" function can not used in the same Subroutine. Sub Test() dim name as String name = "Hello" Msgbox name Name "c:/tmp/1.txt" As "c:/tmp/2.txt" ' fail End Sub
Andreas, please take this over ... Thanks Kay
I see some problems here. I did some tests in vb6 and 1. vb6 could execute the name command although "name" has been used as symbol before 2. In vb6 the sample also works without the dim command. while the patch requires the variable to be dimmed. I think this solution is only half way.
pflin -> ab, It is limit to current patch. But it is not easy for me to full support this feature. ( same behavior as vb6 ). Hope you give me some idea about the solution. Thanks. :-)
ab->pflin: I doubt that this is easy. Obviously vb somehow uses the signature to distinguish between the different use cases. I will think over it. ->STARTED, OOo 3.x
Created attachment 67702 [details] patch to fix the issue (based on dev300 m70)
Created attachment 67703 [details] Test macro
FIXED
ab->sba: Please verify
Verified in CWS mib16.
set new target milestone 3.3
OK in OOO330_m15. Closed.