home *** CD-ROM | disk | FTP | other *** search
- -- Copyright 1992-1996 David Gewirtz under license to Component Software Corp.
- -- All rights reserved worldwide.
- -- This file corresponds to FileFlex v2.0.2
-
- ------------------------------------------------------------------------------------------------------------------------
- -- Following are the only wrapper scripts you should consider modifying. In Director 5 and
- -- above, FileFlex has been implemented as a Director-native Xtra. By placing the FileFlex
- -- engine inside your Xtras folder (this is in the same directory/folder as your Director
- -- application or your projector application, FileFlex will be automatically loaded. If, for
- -- some reason, you choose to place the FileFlex engine somewhere else, then you'll need
- -- to modify the following wrapper scripts to locate and open FileFlex. Note that we will
- -- not provide technical support to users choosing to use this method.
- ------------------------------------------------------------------------------------------------------------------------
-
- on DBInitPlatform
- global gDBGlobalPtr1030
- put empty into gDBGlobalPtr1030
- --openXlib "FileFlex Engine" --<---------------------------- Be sure your pathspec is correct
- end DBInitPlatform
-
- on DBClosePlatform
- --closeXlib "FileFlex Engine" --<---------------------------- Be sure your pathspec is correct
- end DBClosePlatform
-
-
- ------------------------------------------------------------------------------------------------------------------------
- -- Following here are the individual wrapper functions that control access to
- -- the FileFlex engine. We strongly recommend you change these only with
- -- great care.
- ------------------------------------------------------------------------------------------------------------------------
-
- on DBVersion
- return FileFlex("0")
- end DBVersion
-
- on DBCopyright
- return FileFlex("999")
- end DBCopyright
-
- on DBOpenSession
- global gDBActive1030
- if gDBActive1030 <> "true" then
- put "true" into gDBActive1030
- return FileFlex("1")
- else
- return "0"
- end if
- end DBOpenSession
-
- on DBCloseSession
- global gDBActive1030
- if gDBActive1030 = "true" then
- put "" into gDBActive1030
- return FileFlex("2")
- else
- return "0"
- end if
- end DBCloseSession
-
- on DBUse dbName, pathspec
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("3",dbName)
- else
- return FileFlex("3",dbName,pathspec)
- end if
- end DBUse
-
- on DBDatabaseExists dbName, pathspec
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("43",dbName)
- else
- return FileFlex("43",dbName,pathspec)
- end if
- end DBDatabaseExists
-
- on DBClose dbID
- DBCheckActive
- return FileFlex("4",string(dbID))
- end DBClose
-
- on DBSelect dbID
- DBCheckActive
- return FileFlex("5",string(dbID))
- end DBSelect
-
- on DBCloseAll
- DBCheckActive
- return FileFlex("6")
- end DBCloseAll
-
- on DBUseIndex indexName, pathspec
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("7",indexName)
- else
- return FileFlex("7",indexName, pathspec)
- end if
- end DBUseIndex
-
- on DBCloseIndex indexID
- DBCheckActive
- return FileFlex("8",string(indexID))
- end DBCloseIndex
-
- on DBSelectIndex indexID
- DBCheckActive
- return FileFlex("9",string(indexID))
- end DBSelectIndex
-
- on DBGo recnum
- DBCheckActive
- return FileFlex("10",string(recnum))
- end DBGo
-
- on DBTop
- DBCheckActive
- return FileFlex("11")
- end DBTop
-
- on DBBottom
- DBCheckActive
- return FileFlex("12")
- end DBBottom
-
- on DBSeek seekExpr
- DBCheckActive
- return FileFlex("13",seekExpr)
- end DBSeek
-
- on DBSkip num
- DBCheckActive
- return FileFlex("14",string(num))
- end DBSkip
-
- on DBDeleteRecs startRec, endRec
- DBCheckActive
- return FileFlex("15",string(startRec), string(endRec))
- end DBDeleteRecs
-
- on DBRecallRecs startRec, endRec
- DBCheckActive
- return FileFlex("16",string(startRec), string(endRec))
- end DBDeleteRecs
-
- on DBZapRecs startRec, endRec
- DBCheckActive
- return FileFlex("17",string(startRec), string(endRec))
- end DBZapRecs
-
- on DBPack
- DBCheckActive
- return FileFlex("18")
- end DBPack
-
- on DBCount
- DBCheckActive
- return FileFlex("19")
- end DBCount
-
- on DBRecordDeleted recNum
- DBCheckActive
- return FileFlex("20", string(recNum))
- end DBRecordDeleted
-
- on DBCurrRecNum
- DBCheckActive
- return FileFlex("21")
- end DBCurrRecNum
-
- on DBSum numFieldName
- DBCheckActive
- return FileFlex("22",numFieldName)
- end DBSum
-
- on DBAverage numFieldName
- DBCheckActive
- return FileFlex("22", numFieldName) / FileFlex("19")
- end DBAverage
-
- on DBGetMemo memoField, encryptFlag, key
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("24", memoField)
- else
- return FileFlex("24", memoField, encryptFlag, key)
- end if
- end DBGetMemo
-
- on DBWriteMemo memoField, memoVal, encryptFlag, key
- DBCheckActive
- if the paramCount <= 2 then
- return FileFlex("25",memoField, memoVal)
- else
- return FileFlex("25",memoField, memoVal, encryptFlag, key)
- end if
- end DBWriteMemo
-
- on DBGetFieldByName fieldName, decryptFlag, key
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("26",fieldName)
- else
- return FileFlex("26",fieldname, decryptFlag, key)
- end if
- end DBGetFieldByName
-
- on DBGetFieldByNum fieldName, decryptFlag, key
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("27",string(fieldName))
- else
- return FileFlex("27",string(fieldname), decryptFlag, key)
- end if
- end DBGetFieldByNum
-
- on DBGetCurrRecVal containerType, decryptList, key
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("28",containerType)
- else
- return FileFlex("28", containerType, decryptList, key)
- end if
- end DBGetCurrRecVal
-
- on DBListFields
- DBCheckActive
- return FileFlex("29")
- end DBListFields
-
- on DBMaxRecs
- DBCheckActive
- return FileFlex("47")
- end DBMaxRecs
-
- on DBWriteRec containerType, recNum, p0, p1, p2
- if the paramCount = 2 then
- return FileFlex("30",containerType,string(recNum))
- else if the paramCount = 3 then
- return FileFlex("30",containerType, string(recNum), string(p0))
- else if the paramCount = 4 then
- return FileFlex("30",containerType,string(recNum), string(p0), string(p1))
- else
- return FileFlex("30",containerType, string(recNum), string(p0), string(p1),string(p2))
- end if
- end DBWriteRec
-
- on DBCreateIndex indexName, indexExpr, unique, safety
- DBCheckActive
- return FileFlex("31",indexName, indexExpr, string(unique), string(safety))
- end DBCreateIndex
-
- on DBReindex indexID
- DBCheckActive
- return FileFlex("32", string(indexID))
- end DBReindex
-
- on DBIndexExpr indexID
- DBCheckActive
- return FileFlex("44", string(indexID))
- end DBIndexExpr
-
- on DBBuildSeekExpr
- DBCheckActive
- put "FileFlex(" & quote & "45" & quote into theFunc
- repeat with i = 1 to the paramCount
- put "," & quote & string(param(i)) & quote after theFunc
- end repeat
- put ")" after theFunc
- return value(theFunc)
- end DBBuildSeekExpr
-
- on DBListIndexFields indexID, delim
- DBCheckActive
- return FileFlex("46", string(indexID),string(delim))
- end DBListIndexFields
-
- on DBCreate dbName, numFields, fields, safety
- DBCheckActive
- return FileFlex("33", dbName, string(numFields), fields,string(safety))
- end DBCreate
-
- on DBCheckIndex indexID
- DBCheckActive
- return FileFlex("34", string(indexID))
- end DBCheckIndex
-
- on DBQuery expr
- DBCheckActive
- return FileFlex("35",expr)
- end DBQuery
-
- on DBLocate expr
- -- NOTE: DBLocate is obsolete and will be eliminated in future releases
- -- DBLocate has been replaced by DBQuery
- DBCheckActive
- return FileFlex("35",expr)
- end DBLocate
-
- on DBCurrDBNum
- DBCheckActive
- return FileFlex("36")
- end DBCurrDBNum
-
- on DBEncrypt theString, key
- DBCheckActive
- return FileFlex("38",theString, key)
- end DBEncrypt
-
- on DBDecrypt theString, key
- DBCheckActive
- return FileFlex( "39", theString, key)
- end DBDecrypt
-
- on DBFindMemo memoField, theString
- DBCheckActive
- return FileFlex("40",memoField, theString)
- end DBFindMemo
-
- on DBConvertCRLF theString, theOption
- DBCheckActive
- if the paramCount = 1 then
- return FileFlex("41",theString)
- else
- return FileFlex("41",theString, theOption)
- end if
- end DBConvertCRLF
-
- on DBPlatform
- DBCheckActive
- return FileFlex("42")
- end DBPlatform
-
- on DBTranslateChars string, table
- DBCheckActive
- return FileFlex("48",string, table)
- end DBTranslateChars
-
- on DBSetSortOrder order
- global gDBWorldSort
- global gDBSortOrder
- if order = EMPTY then
- put EMPTY into gDBWorldSort
- else
- put "1" into gDBWorldSort
- put order into gDBSortOrder
- end if
- return 0
- end DBSetSortOrder
-
- on DBSetCaseTables upperTable, lowerTable
- global gDBWorldCase
- global gDBWorldUpper, gDBWorldLower
- if (upperTable = EMPTY or lowerTable = EMPTY) then
- put EMPTY into gDBWorldCase
- else
- put "1" into gDBWorldCase
- put upperTable into gDBWorldUpper
- put lowerTable into gDBWorldLower
- end if
- return 0
- end DBSetCaseTables
-
- on DBUpper s
- DBCheckActive
- return FileFlex("49",string(s))
- end DBUpper
-
- on DBLower s
- DBCheckActive
- return FileFlex("50",string(s))
- end DBLower
-
- on DBCheckActive
- global gDBActive1030
- if gDBActive1030 <> "true" then
- put DBOpenSession() into dummy
- end if
- end DBCheckActive
-
- -- These routines should never be called by the user. They simply
- -- assign and gather values of the global variables. They are here so
- -- we can test the global value interface to the host application
- --
- on DBSetGlobal globName, globVal
- return FileFlex("202",string(globName),string(globVal))
- end DBSetGlobal
-
- on DBGetGlobal globName
- return FileFlex("201",string(globName))
- end DBGetGlobal
-