--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "Sheri" <sherip99@> wrote:
> >
> > Had you intended to post a test ver? That too could improve the ADODB
> > script.
>
> comPlugin0.73_100401.zip in
> http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/
>
> Includes script that gets and dumps a vec. vec doesn;t seem to be
> working quite right...wait a minute, I may have created it
> reversing rows x cols. Can still access using 1d syntax, but 2d
> syntax compains...
I don't know if I'm supposed to have an updated Vec plugin.
I haven't tried to see what the GetRows returned array looks like in VBA but
the documentation says: "Use the GetRows method to copy records from a
Recordset into a two-dimensional array. The first subscript identifies the
field and the second identifies the record number. The array variable is
automatically dimensioned to the correct size when the GetRows method returns
the data."
That sounds backwards to what I'm used to with regex 2d vectors (where the
first index is the row number and the second is a column number).
In fact the Powerpro help states that 2d vectors are organized by rows.
Anyway, accessing the vector as a 1d vector it was easy enough to substitute
records from your hVec into my process (which still creates and returns a
vector that uses class-style records). Haven't timed it, but feels zippier.
Function RecordsToVector(myview, myviewstruct)
local com_type, com_status
local hVec = myview.getrows()
local ncol=word(myviewstruct.variables,0)
local rcount=hVec.length/ncol
local vdata=vec.create(rcount)
if (rcount>0) do
for(local i=0; i<rcount; i++)
vdata[i]=myviewstruct.new()
for each word myword index j in myviewstruct.variables
do("vdata[i]."++myword++" = hVec[(i*ncol)+j]")
endfor
endfor
endif
quit(vdata)
Regards,
Sheri