quarta-feira, 31 de agosto de 2011

Listar usuários conectados

_global usuarios_conectados <<

_proc(_optional write?)
      ## This proc lists out the users (username@machine_name)
      ## connected to smallworld at that instance.
      ##
      ## The argument write? is defaulted to _true. If given false, it doesn't
      ## write at the magik prompt.
      ##

      ## Anycase it returns a simple_vector of user names.

      write? << write?.default(_true)
      mv << message_handler.view
      fl << mv.files.an_element()
      _local log_fl << fl.current_logical_file
      us << log_fl.users
      us << us.map(_proc (id)
                     _import log_fl
                     >> log_fl.user_details(id)
                 _endproc)
      _if write?
      _then
            _for u _over us.fast_elements()
            _loop
                  write(u)
            _endloop
      _endif
     
>> us
_endproc
$

Nenhum comentário :

Postar um comentário

Related Posts Plugin for WordPress, Blogger...