api way
Ruslan Zasukhin
sunshine at public.kherson.ua
Sat Jul 23 09:48:08 CDT 2005
On 7/23/05 8:28 AM, "Jules Jacquot" <jules.jacquot at wanadoo.fr> wrote:
> hi, ruslan
>
> how can i rewrite this querry in api way ?
>
> dg=app.mdatabase.SQLSelect("select RecID,* from Article where BArt
> like '"+ch+"%' and (JDepArt='C' and Ordart='"+Myord+"') order by BArt")
bitset1 = tblAticle.field("BArt").FindLike( ch + "%" )
bitset2 = tblAticle.field("JDepArt").FindValue( "C" )
bitset3 = tblAticle.field("Ordart").FindValue( "Myord" )
bitset23 = bitset2.intersect(bitset3)
// release memory ASAP
bitset2 = nil
bitset3 = nil
bitset123 = bitset1.intersect( bitset23 )
// release memory ASAP
bitset1 = nil
bitset23 = nil
arrasetRes = tblArticle.Sort( bitset123, "BArt" )
bitset132 = nil
Now you have ArraySet of selected fields.
In the API way you do not use separate fields from SELECT.
You always use just a Table.
// for each selected recID
foundRecs = arraysetRes.Count
loop I = 1 to foundRecs
RecId = arraysetRes.GetItemAt( I )
tblArticle.RecID = RecID // these 2 lines can be as single
... Do something you need
end loop
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list