Actually, maybe I have a clue (by me it always comes after sleep)
I would best describe it as a scenario :
- when the code of the basic is modified, as per point 3 below, OO
probably sets a flag
- when executing the program, as in point 4, OO checks this flag and if
the code of the basic has been modified, it parses the section of the
definitions (Consts, Dims and Types).
Thus the first execution runs flawless.
- when executing the program a second time, as in point 5, OO checks the
flag and does not parse the section of the definitions again as nothing
has been changed, this reduces execution time.
- however, when finishing the execution of the basic code in point 4, OO
more than probably has done some sort of cleanup in its storage allocation.
And in doing that it could maybe have wiped out the storage of the
definition "Type ZONEDIALOG"
Therefore when executing point 5, this storage would be missing,
hence the error message.
With the knowledge you have, does this scenario seem valid ?
Thanks,
Lucien.
Le 15/06/22 à 16:52, Lucien Mathay a écrit :
Hi all,
the version 4.1.13 I tested does not make any difference with regard
to the bug 'strange behaviour usertypes' reported earlier.
(unfortunately ; why would it have made a difference anyway ? :-)
I still worked on this problem and managed to further simplify the
code showing the problem. It is shown here, along with the steps
necessary to show the strange behaviour :
option explicit
Type ZONEDIALOG
hauteur As Long
largeur As Long
End Type
Dim ZDstack(0 To 2) As ZONEDIALOG
Sub Main()
dim quoi as Long
quoi = ID_UNDEFINED
msgbox "OK"
End Sub
If you want to show the problem : use the attached file, (as it does
not show up when this code is copied into a fresh sheet), then follow
the steps :
1. Execute the code : -> error "undefinded variable" on ID_UNDEFINED
: which is perfectly normal ; program stops.
2. Execute the code again : -> the same error "undefinded variable" ;
program stops. (as expected, but this point is just there to
check this :-).
3. Replace "ID_UNDEFINED" by a constant : "quoi = 2"
4. Execute the code : message box "OK" : and you think the problem is
solved, ... BUT ...
5. Execute the code again : -> error 9 "index out of defined range"
at "Dim ZDstack(0 To 2) As ZONEDIALOG" ; and the program
continues, as it displays "OK"
6. Execute the code again : -> same error 9 as point 5.
7. Now ! Modify the code :
Replace "OK" by "Really OK ?"
8. Execute the code : message box "Really OK ?" : no more error 9 !
, and this is due to the fact that
the code has been modified
9. Execute the code again : -> error 9 appears again ; and program
continues, as it displays "Really OK ?"
The stack dump here attached shows that the exception "error 9" is
thrown from within "basic::NameContainer::getByName",
and the exception specifies
"com::sun::star::container::NoSuchElementException", which is 'thrown
by child access methods of collections, if the addressed child does
not exist'.
Just as if the "Type ZONEDIALOG" definition would have been removed
from memory ?
Does anyone have any clue of what is going on ?
Thanks alot if you have !
Lucien.
Le 10/06/22 à 17:03, Lucien Mathay a écrit :
Ah, sorry, I am not yet used to this exercise with 'Reply to List' !
Lucien
Le 10/06/22 à 16:44, Carl Marcum a écrit :
Hi All,
I got reply this off-list so I'll add it here:
OO on 4.1.6 and 4.1.12, installed on Windows XP
and
LibreOffice Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.11
Best regards,
Carl
---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscr...@openoffice.apache.org
For additional commands, e-mail: qa-h...@openoffice.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail:qa-unsubscr...@openoffice.apache.org
For additional commands, e-mail:qa-h...@openoffice.apache.org