progress 4gl - Opening a STREAM in a Persistent Procedure Function -


i have persistent procedure, in trying open, write , close stream.

i have in main area of procedure

define stream soutfile. open stream soutfile value( outfilename ). message seek( soutfile ). 

and subsequently function within persistent procedure

function example return logical:   message seek( soutfile ).   put stream soutfile unformatted somedata. end. 

when persistent procedure instantiated, message displays "0" stream has been opened. however, when example called, message displays "?" , message attempting write closed stream.

i've tried declaring stream new shared didn't make difference.

am doing wrong, or impossible define streams within persistent procedures?

it , coffee hasn't kicked in yet think have open stream outside body of pp.

this works:

/* ppstream.p  *  */  define stream logstream.  session:add-super-procedure( this-procedure ).  /* end of pp init */  function initlog returns logical ( input lgfile character ):   output stream logstream value( lgfile ) unbuffered.   return true. end.  function logstuff returns logical ( input msg character ):   put stream logstream unformatted msg skip.   return true. end. 

and call so:

function initlog  returns logical ( input lgfile character ) in super. function logstuff returns logical ( input msg character ) in super.  run ./ppstream.p persistent.  initlog( "log.txt" ). logstuff( "test" ). 

(i used session super-procedure avoid having define handles -- not need that.)


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -