V4 problem

Ruslan Zasukhin ruslan at paradigmasoft.com
Sat Jan 10 09:37:45 CST 2009


On 1/10/09 12:54 PM, "Sean Mancuso" <seanmancuso at yahoo.com> wrote:

> Hello Ruslan,
> 
> I´ve been using V3 for the last couple of weeks over a project, this morning I
> decided to install V4 because I would like the report feature, since moving to
> V4 now I get an
> "Handler not defined" on line 175 of the pic that I attach.
> I belive is something you changed from 3 to V4 ?
> I do drop the cursor, but the second cursor I create from select is void then
> the error.
> Could you please advice ?

Btw,

Lines 156 157

    newRecID = theCursor.addRecord()
    UpdateRecord(thecursor)

This is wrong code !
You could not see such in our examples :-)

IF you want to ADD record then template is next

    cursor = db.SqlSelect( query, #kServerSide, kREadWrite )

    curs.SetBlank()
    
        af = curs.Field("phrase")
        af.SetString( "something" )

    curs.AddRecord()    <<<<< this save new record on disk.
                                    NO NEED for Update here


------------------------------------------------------------
Next Tip, I see that for your first cursor you use ONLY TWO fields.
    Phrase and set.

Right?

Then it is GOOD IDEA to do

    SELECT Phrase, Set FROM keywords

Instead of SELECT *

Your cursor will work FASTER.


-----------------------------------------------------------
Another Hmm,

SET - this can be keyword of Valentina SQL.
    so you can get glitches if use this for field name.
    


-----------------------------------------------------------
I'd write your code as

    theCursor = void

    theCursor = db.SqlSelect( "SELECT Phrase, Set  FROM Keywords",
#kServerSide, kREadWrite )
    If CheckValError() then exit

    theCursor.SetBlank()
        af = theCursor.Field(³phrase²)
        af.SetString( "something" )
    theCursor .AddRecord()

    ap = googleword.count
    repeat with I = 1 to ap

        -- at first we colect info
        af3 = googleword[i]
    
        -- then store it into record:
        theCursor.SetBlank()
            af = theCursor.Field(³set²)
            af.SetString( af3 )
        theCursor .AddRecord()

        If CheckValError() then exit

    end repeat


    theCursor.FirstRecord()
    theCurfsor.DeleteRecord()


  -- NOW WE WANT ANOTHER SQL SELECT query
    
    -- AT first we kill old cursor
    theCursor = VOID

    theCursor = db.SqlSelect( "SELECT Phrase, Set  FROM Pages",
#kServerSide, kREadWrite )
    If CheckValError() then exit

    recordsp = theCursor.GetRecords()




-- 
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