Autore Topic: Come funziona Desktop.open  (Letto 231 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.723
  • Ne mors quidem nos iunget
    • Mostra profilo
Come funziona Desktop.open
« il: 26 Aprile 2015, 01:14:38 »
Riporto la parte più interessante, quella della risposta di Minisini, di una discussione apparsa nella M.L.I.:

" I have a project thas uses gbDesktop in order to open .odt documents and
 let users to modify them.
 In order to control if a document has changed after been closed the second
 parameter of desktop.open is setted to True.

 gbDesktop.Open(myfile,True)

 It seems work fine..but (allways there's a but) yesterday I find that in my
 Office development mahcine, executing the project from the IDE, that second
 parameter was ignored and the project does'nt wait for the end of launched
 Desktop application (LibreOffice).

 It drive me nut all the morning and I wrote a workaround... but (again)
 this morning the second parameter works fine.

   The same machine, the same project, the same gambas. Yesterday doesn't
 work, today works.

There is some explanation?

Jorge
"


" Desktop.Open() relies on an xdg-util shell script to open the file.

When the Wait argument is True, Desktop.Open() just waits for the end of
the xdg-util script. It does not know how to wait for the end of the
program that will open the file for you.

The Wait argument is mainly useful to catch a possible error when
running a script. It is not reliable for doing what you want.

Regards,

--
Benoît Minisini
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »