Newbie alert - Creating databases in Lingo

David Wood david.wood at pixelpump.co.nz
Sun Apr 13 17:33:32 CDT 2003


Hi Zav

>ok.  Let's mention stability.  The following code instantly crashes 
>Director if you type InitValentina and CreateDatabase.  I know I 
>shouldn't attempt to add the same field more than once buuut this 
>shouldn't crash.

Sorry I can't check on OSX right now but...

You've got an incomplete CreateDatabase handler in there - might just 
be your copying and pasting into the email of course. You've also got 
2 CreateUserDatabase lines in your CreateUserDatabase handler - don't 
know if this would matter or not.

David



>
>OS X 10.2.5, 512 meg ram, DMX, last week's build of Valentina.
>
>
>on InitValentina
>   ValentinaInit(4 * 1024 * 1024, "", "") -- cache, mac serial, win serial
>end
>
>on StopValentina
>   ValentinaShutdown
>end
>
>on CreateDatabase
>   -- ValentinaSetExtensions([ ])
>
>on CreateUserDatabase
>   myDBPath = the moviepath & "username.vdb"
>   myDBTable = "Users"
>   myDB = new( xtra "VDatabase")-- NEW INSTANCE OF THE XTRA
>
>   CreateDataBase(myDB, myDBPath,1) -- CREATE DATABASE FROM SCRATCH
>
>   CreateDataBase(myDB,"someFilePath",1) -- CREATE DATABASE FROM SCRATCH
>   myBaseTableRef = MakeNewBaseObject(myDB, myDBTable) -- MAKE A TABLE
>
>   -- ...then your addField stuff.
>   userField = AddField(myDB, myBaseTableRef,"Username",#kTypeString,10)
>   passwordField = AddField(myDB, myBaseTableRef,"Username",#kTypeString,10)
>   hintField = AddField(myDB, myBaseTableRef,"Username",#kTypeString,30)
>
>end
>
>_______________________________________________
>Valentina mailing list
>Valentina at lists.macserve.net
>http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list