V4MD - Crash Problem

Sean Wilson snw at paradise.net.nz
Thu Jul 20 13:27:42 CDT 2006


>Table created with:
>
>mMyWords=mDatabase.CreateTable("my_words")
>mMyWords.CreateVarCharField( "folder", 1022)
>mMyWords.CreateVarCharField( "realword", 1022)
>mMyWords.CreateVarCharField( "type", 1022)
>mMyWords.CreateVarCharField( "posp", 1022)
>mMyWords.CreateVarCharField( "definition", 2044)
>mMyWords.CreateVarCharField( "example", 2044)
>
>on addMyFolder me, folderStr
>   put "addMyFolder" && folderStr
>   tFolderSearch = mDatabase.sqlSelect("SELECT ** FROM my_words WHERE
>folder='"& folderStr &"'")
>
>   if tFolderSearch.recordCount = 0 then
>     mMyWords.setBlank()
>     mMyWords.Field("folder").value=folderStr
>     mMyWords.Field("type").value="myfolder"
>     mMyWords.Field("realword").value=" "
>     mMyWords.Field("definition").value=" "
>     mMyWords.Field("example").value=" "
>     mMyWords.Field("posp").value=" "
>     mMyWords.addRecord()
>   end if
>   tFolderSearch=void
>
>end

<snip>
I don't remember details for 2.2, but shouldn't cursors created with 
DB.sqlSelect() also take cursorLocation, lockType and cursorDirection 
parameters?

I don't know how safe it is to mix your approaches like you seem to 
be doing above. It looks like you're using the "sql-way" to determine 
whether your table has a record for the entry you're about to add, 
and then the "api-way" to populate fields. Obviously Ruslan is the 
authority - and will hopefully provide better assistance that I can - 
but I'm sure I've seen him recommending not to mix "syntaxes" like that.

HTH,
-Sean. 




More information about the Valentina mailing list