Re: ReDim driving me crazy again…

Johnny Rosenberg <[email protected]> Wed, 17 Aug 2011 12:41:53 +0200
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <CADo7T4f9ubO9RGtBQ9pvryVj+BFbsh2tEQAJo7YvdLzoPCmp1w@mail.gmail.com>
2011/8/17 Johnny Rosenberg <[email protected]>:
> I edited a lot of code yesterday, one of the rows I did NOT edit was
> this one, which occurs at the top of a subroutine:
>
> ReDim NDice(1 To 6) As Integer
>
> It is defined in another module as:
> Public NDice(1 To 6) As Integer
>
>
> The error message I get is (translated from Swedish):
> =E2=80=9DBASIC syntax error:
> The NDice variable is already defined.=E2=80=9D
>
> Yes, I know it is, that's one of the points by using ReDim, isn't it?
>
> Before doing some heavy editing there was no complaints on this line
> at all, and as I said, this is NOT one of the many lines I changed.
>
> So obviously some of my other edits caused this, but where to start
> looking? What can I possible have done to cause this?
>
> I just hate when these things happen, when there is an error message
> telling me that I can't do something that I should be able to do. Like
> if I got an error message for the line =E2=80=9DIf a=3Db Then=E2=80=9D, a=
nd the error
> message says: =E2=80=9DBASIC syntax error: a and b are already compared=
=E2=80=9D=E2=80=A6
>

I have now tried a couple of more things. I have changed the global
definition from Public to Private to Global to Dim and back again to
Public. Same result no matter what.
I have even removed the global definition, and I have searched through
ALL the modules after the variable to make sure it's not declared
elsewhere. STILL the error message says that it's already defined! I
would like to know where, because the Find thing (Ctrl+f) can't find
another definition of NDice than the ReDim on which the error occurs!
I have searched for Dim NDice, Public NDice, Private NDice and Global
NDice, nothing found except ReDim NDice (once =E2=80=93 the one on which the
error occurs).

Well, I'll continue searching. I have now made a copy of the whole
document for wild debugging, so I will try the most brutal things I
can think of now, like removing entire modules to see if I can at
least find in what module I need to have a closer look at=E2=80=A6

Any ideas are very welcome! I'm kind of losing my hair here=E2=80=A6 :P


Kind regards

Johnny Rosenberg
=E3=82=B8=E3=83=A7=E3=83=8B=E3=83=BC=E3=83=BB=E3=83=AD=E3=83=BC=E3=82=BC=E3=
=83=B3=E3=83=90=E3=83=BC=E3=82=B0
--=20
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help