Re: What Programs are running?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Greg Haberek wrote:
> 
> Why not do this instead? It completely eliminates the internal find() loop.
> 
> }}}
<eucode>
> global function is_file_open(sequence file)
> 
>   sequence windows, class
>   object caption
> 
>   windows = window_ListAll()
> 
>   for i = 1 to length(windows) do
>     caption = window_GetCaption( windows[i] )
>     if equal( file, caption ) then
>       -- file is open
>       return 1
>     end if
>   end for
> 
>   -- not found
>   return 0
> end function
> </eucode>
{{{

> 
> ~Greg
> > 
> 


I thought of tyhat but I thought using the if question on every count
would slow things down.
I the 'found' program was the first one on the list then it would be
much faster your way.
But if it was the last prougram on the list I don't know.
I see you eliminated tyhe class

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu