On Thu, 26 Mar 2009, toni...@fwi wrote:

Hi,

> But with a more extensive test here I found that this code doesn´t
> work:
> procedure testolenew()
>    local oWord, oText
>    begin sequence
>       oWord = GetActiveObject( "Word.Application" )
>    recover
>       begin sequence
>          oWord = CreateObject( "Word.Application" )
>       recover
>          alert( "ERROR! Word not avialable." )
>          return
>       end sequence
>    end sequence
[...]

New implementation does not generate RT error but simply returns NIL.
It's not longer necessary to use BEGIN SEQUENCE / END (BTW WITH {|e|break}
is missing) or TRY/CATCH.

Use this code instead:

procedure testolenew()
   local oWord, oText

   oWord = GetActiveObject( "Word.Application" )
   if oWord == NIL
      oWord = CreateObject( "Word.Application" )
      if oWord == NIL
         alert( "ERROR! Word not avialable." )
         return
      endif
   endif
   [...]

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to