[comp.sys.next] Putting Text in a Text Object

u-sgreen%peruvian.utah.edu@cs.utah.edu (Scott Greenman) (11/08/90)

I am trying to take data from a Sybase retrieval and put in into a text
object (Contained in a ScrollView).  This is the code I'm using:

 NXStream *stream;
 char name[46];
  .
  .
  .

 stream = NXOpenMemory(NULL, 0, NX_WRITEONLY);

 dbbind(dbproc,1,STRINGBIND,(DBINT)46,name);

 while (dbnextrow(dbproc) != NO_MORE_ROWS)
   NXPrintf(stream,"%s\n",name);

 [[outputView docView] readText:stream];
 NXCloseMemory(stream, NX_FREEBUFFER);


dbbind, dbnextrow, etc are functions that send commands to Sybase.
I don't think there's anything wrong with them.  The variable name
is given a new value everytime dbnextrow is called, and I want to put
all of the values it gets into the text object.  outputView is a
ScrollView containing a text object (as dragged from IB Pallette)
This is the first time I've tried using a stream like this and I don't
know what I'm doing wrong.  Any help would be greatly appreciated.

Scott Greenman
Univ of Utah