Message de Cor Nouws  date 2007-05-18 23:24 :
Hi Bernard,

Personnally I prefer the getByName method:

DialogLibraries.LoadLibrary("x")
myLib = DialogLibraries.getByName("x")
myDialog = myLib.getByName("dlgx")
oDlg = CreateUnoDialog(myDialog)

Does that have a reason, that I might be able to understand :-) ?


Of course I could have written a long instruction instead of three:
oDlg = CreateUnoDialog(DialogLibraries.getByName("x").getByName("dlgx"))

As you know, OOoBasic allows a shortcut for getByName method:

myLib = DialogLibraries.getByName("x") ' strict API usage
myLib = DialogLibraries.x    ' OOBasic shortcut

But this shortcut may conflict with an existing method name for the object. As an example, have a spreadsheet with a sheet named : tata
Here is the shortcut at work :

dim thisSheet as object
thisSheet = thisComponent.Sheets.tata
xray thisSheet

Now have another sheet named : Count
This time the shortcut will not work :

dim thisSheet as object
thisSheet = thisComponent.Sheets.Count
xray thisSheet

Because of potential name conflicts I think this OOoBasic shortcut should not be used.

______
Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to