V4MD search in API way and cXtraStringGrid example request

Igor Gomon giv at tlc.kherson.ua
Wed Mar 30 22:05:37 CST 2005


> I want explain better my problem, I don't understand if your suggest is
> right for me, sorry.
> 
> Table STUDENTS
> --------------------------
> ID | Name  |  Phone | ...
> --------------------------
> 1    Paolo       111
> 2    Anna        222
> 3    Igor          333
> ...
> 
> I search for "Paolo" in field Name and I want display only two column (ID
> and Name): NOT the Phone and other column,
> how can I do this in API WAY?
> --------------
> ID | Name  |
> --------------
> 1   Paolo
> ...

on X
    --....
    fName = table.field("Name")

    -- Find all the records in the table's field "Name" equal to "Paolo"
    resultSet = fName.findValue("Paolo")
    if CheckValError() then exit

    -- Create set iterator on selection
    rsIter = resultSet.makeNewIterator()
    if CheckValError() then exit

    -- Now iterate over resulting selection using set iterator.
    if rsIter.firstItem() then
        repeat while true
            -- Go to the next record in the result set.
            recID = rsIter.value
            table.recId = recID
            -- Get string value from the "Name" only field.
            s = fName.getString()
            -- Do with it whatever you want.
            put s 
            -- Check for result set end.
            if not setIter.nextItem() then
                exit repeat
            end if
        end repeat
    end if

    --Clean up.
    rsIter = 0
    resultSet = 0

end X


-- 
Best regards,
Igor Gomon
-------------------------------------------------------------
e-mail: giv at tlc.kherson.ua
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina


More information about the Valentina-beta mailing list