Ray,

Excellent point, as always, about field- vs value-level "-1" difference.

One question: 
 
Since each "X<-1> = ..."  adds to the size of memory allocated for the
variable "X", every so often X runs out of room and there has to be some
sort of linking or remapping.  (Recall we're talking about very large
strings building up to 50,000 fields (was values).)
So would it make sense to preallocate the space, then do substring
assignments, and finally trim it:

   X = SPACE( 1000000 )  ;* reserve a million bytes of memory
   PTR = 1
   FOR I = 1 TO 50000
      GOSUB get.string.to.append
      X[ PTR, LEN( STRING.TO.APPEND ) ] = STRING.TO.APPEND
      PTR+= LEN( STRING.TO.APPEND )
   NEXT I
   X = TRIMB( X )

(of course ones should check to see if PTR is approaching the end and
append another million bytes, etc.)

Thanks,
CDS

> From: Ray Wurlod
> UniVerse answer, but I think it's OK in UniData too.
> The -1 notation with angle brackets is good, but is improved 
> by using it at the field level. Then it's a simple string 
> append, and rather faster.
> So, build the multi-valued fields by this method, then apply 
> a LOWER function as part of building the TABLE variables or 
> the dynamic array that you will WRITE.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to