setting buffers stored in array

shafee212

Member
i have buffers stored in an array
a . now i want to set the buffers for a query q :

how do i do it as these buffers are stored in an array .

for eg how do i write the statement ;

q:set-buffers (xxxxxxxxxxxxx)
 
i have buffers stored in an array
a . now i want to set the buffers for a query q :

as what? As character strings or as handle values?

I pressume that will be strings.
If so then don't use set-buffers but use add-buffer to fill up the query:
(untested, without editor so excuse for any mistake )
Code:
define variable hBuffer as handle no-undo.
define variable iTmp as integer no-undo.
do iTmp = 1 to extent(a):
  if a[iTmp] <> '' then do:
      create buffer hBuffer for table a[iTmp].
      q:add-buffer(hBuffer).
end.
[i]q:query-prepare([I]preparestring[/I]).
q:query-open().
 
do while not q:query-off-end:
 
end.
 
/* cleanup */
do iTmp = q:num-buffers to 1 by -1:
    delete object q:get-buffer-handle(iTmp).
end.
 
delete object q.

HTH,

Casper.
 
Back
Top