Home

V12 Database Engine

image

Contents

1. AS SQL Server Translated to Notes field type V12 field type Binary Ignored Bit Integer DateTime Ignored Decimal Float Float Float fuss String Buffer size 32K Data cannot be imported from Image fields Int Integer Money Float Numeric Integer Real Float SmallDateSize Ignored SmallInt Integer SmallMoney Float SysName String Buffer size is same as MS SQL V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 58 Server field size Text String Buffer size 32K TimeStamp Ignored Tinylnt Integer Buffer size is same as MS SQL VarBinaiy iu Server field size VarChar Sirin Buffer size is same as MS SQL Server field size Syntax mReadDBStructure gDB SQLserver DSN Username Password e where DSN is the name of a valid User DSN System DSN or File DSN see Window s Control Panel e Username is a valid user name to access the DSN e Password is Username s matching password mReadDBStructure reads the structure of a MS SQL Server data source not its content To import the content of the data source see Importing from MS SQL Win 32 only Step 3c Building the Database Once the database structure is read by mReadDBstructure whether from a text file a DBF file or otherwise build the database by calling mBuild mBuild checks if the
2. V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 44 Step 3 Creating a Database At Step 3 you formalize the database you designed at Step 1 Deciding on a Data Model odel into a database descriptor Then you provide that descriptor to the V12 DBE Tool if you choose to use the V12 DBE Tool or to VI2 DBE s mReadDBstructure method if you decided to script the database creation process If you use the V12 DBE Tool just read through the next two sections Descriptors nd Using the V12 DBE Tool and skip to 12 DBE Database If you wish to script the database creation process read through Scripting the Database Creation as well The V12 DBE Tool is a convenient point and click environment for small projects Scripting the database creation process with Lingo requires a little more effort upfront but may end up saving you a lot of time if you need to experiment with your database structure or data before committing to a final form It enables you to automate the database creation process Database Descriptors Following is the format of text and literal database descriptors required by both the V12 DBE Tool and the mReadDBstructure method It is used to build a database structure from scratch If you build your V12 databases from other databases e g MS Access MS Excel etc you can directly skip to Scripting the Database Creation The desired
3. 33 163 L Languages eccceeecesseceeeeeeneeeeeeees 33 163 Ee CG 129 M Master Feld 76 V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 192 E EE 71 109 mMessageList eee 24 Methods sse 22 MOrd rBy oem 76 mAddRecord ekere 88 mPackDatabase sss 110 maAutoBinding sss 94 mhReadDBstructure 51 52 55 mBindField ei h 91 mRefreshBoundFields 93 mbBulld etes 60 mselDelete tege 91 mCloneDatabase sss 110 MS CLEC esee te 95 mDataForma t 85 109 m Select Alt He mDeleteRecord sss 90 Deler One eege eege 102 mlump Structure 61 mSetCriteria 95 96 100 102 mEditRecord ee 89 mSetField 88 89 103 mExportSelection 108 mSetPassword E eee 114 MPING iui seine tia 78 mSetDroperts kd Rika s d de 115 mFixDatabase E eee 111 CharacterSet ie 117 mCeneratchMembers ee 93 Delmters sss 121 mGetField sss 79 Error op 119 mGetMedia esses 88 103 MaxLoggedErrors 119 mGetPosition LL eee 76 MinWordLengtah 121 mGetProperty eee 115 Months u eee 118 CurrentDate e 117 Pro
4. 39 Testing deese e 135 TOOL 5 horto o dm E 49 63 Typecasting sess 33 U Using A V12 DBE Database 73 Xtra Instances eee ets 22 V V12BeginProgress handler 113 V12 DBE Tool 49 63 V12EndProgress handler 113 V12Error method 105 V12Progress handler 113 V12Status method 105 Virtual CH 40 116 W Warnings eee 106 200 What is Av database eo 27 A field eene md 27 Pa dira eni i LN te tege 27 A search criterion 34 e EE 34 A table eine dne 27 The current record 34 Writing Data 89 Of type Date orante 90 of type Float cetus 89 of type Integer sss 89 of type Media 90 Of type SUN g eter 89 X XMLEz dio tiec Renta 69 V12 DBE for Macromedia Director User Manual OlIntegration New Media Inc 1995 98 version 2 1 99 07 27 page 194
5. re SE Ena V12 Database Engine for Macromedia Director Regular Edition Version 3 0 User Manual 99 06 16 integration new media OlIntegration New Media Inc 1995 99 Table of Contents V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 2 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 3 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page4 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 5 OVINQUING 2t ge p e es 85 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 6 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 7 mPrint and V12 Database Engine V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 8 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 9 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 10 Introduction Welcome to V12 Database Engine V12 DBE the most powerfu
6. 141 Database Deseriptors 45 IA 109 raw format 42 90 96 DBF File Formats 43 52 Deleting a Record 90 Delimiters Full Text 30 Descending eke 96 E End User nne EE 135 Error Codes sse 192 Error detection sss 21 jD vel NR N dece 105 106 107 Exporting Dam 108 DBF Format eez 109 Text EO B unes en denke kene reet 108 F Field Delimiter 80 Field Descriptor sss 39 65 Field Type cese eem 32 Fixing a Database file 111 Flat datahbage e 30 Blaat ND N DD nnn 109 Formatting IR 86 Integers and Floats 86 Freeing up Disk Space 110 Full text Indexing UE 30 Delhmuterg ee 121 Shortest words 121 Stop e n enpensa 122 G Generation of Members 93 Global functions eesseene 25 VUbror eke ee 105 V12Status eee e 105 I Importing A text D 65 Data into a VI2 DBE Database 74 From a DBF File 67 From a Literal 66 Mediassa nn 71 ING OXES uic re t ces 28 Installing V12 DBE 16 EE entierement 109 International
7. 6890 6900 6910 6920 6931 6940 6950 6970 6980 6990 7050 7070 7210 7410 7620 Memory allocation error Wrong number of parameters V12base instance not properly opened Invalid table name Missing table definition in database At least one table must be defined ina V12 database No such table in database Failed to open table Database file not open Table was defined but not written to database Table not found Invalid object Empty table name Cannot create table instance Only one table instance can be created Wrong number of parameters Invalid export type Invalid pathname Invalid field delimiter Invalid record delimiter Invalid field name Field s does not exist Invalid record delimiter length Invalid field delimiter length Wrong number of parameters Wrong number of parameters Wrong number of parameters Parameter 2 should be either a valid pathname or a valid source type Literal Text DBF or V12 Invalid pathname Invalid record delimiter Invalid field delimiter Invalid import type Must be Literal Text DBF or V12 Import error Unable to open DBF file Check pathname Unable to open TEXT file Check pathname Empty file name Field 1d does not exist Empty table name Database not properly initialized Invalid DBF file format Field and record delimiters must be different Unable to import data Database must be opened in ReadWrite mode Cannot use line feed
8. Use the PrintOMatic Xtra see http www printomatic com PrintOMatic is available for MacOS Windows 3 11 and Windows 9x NT However it doesn t have an interactive page design tool page layouts must be scripted in Lingo mPrint and V12 Database Engine The main steps to print a report with mPrint are 1 2 6 Use the mPrint designer to layout your reports Save your report a MPF file on your hard disk Choose Code gt Generate gt Director Lingo F7 to have mPrint Designer generate the Lingo script needed for printing Copy and paste the printing script in a Director handler Replace variable references typically designated by the value strings by actual calls to VI2 DBE Print your report At step 6 you can optionally preview your report instead of printing it by replacing the call to tMsPrintReport by tMsPreviewReport V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 141 Example 1 printing a specific field in a record For example to print the content of selected fields of a record first design as report similar to this Add Style Align Code Options Help fa n QQ Cu g a 9g Recommended Dietfor FirstName Recommend Diet for is a mPrint Text object FirstName is a mPrint variable In mPrint Designer choose Code gt Generate gt Director Lingo You get the following script tMsRegisterMPrint
9. 1 perry Index N Index Y Index Table Last Name First Name Address City State Zp Phone record 1 gt Jordan Ann 6772 Toyon Court San Mateo CA 94403 349 5353 record 2 gt Brown Charles 30 Saxony Ave San Francisco CA 94115 421 9963 record 3 gt Pintado Jack 22 Hoover Ave Bowie MD 20712 731 5134 N record 4 Juan Damme Lucie 87 Main St Richmond VA 23233 315 3545 ee Peppermint Patty 127 Big St Lebanon MO 92023 462 6267 N AN fi FieldFielqrielqrield ern J Table j _ Database Full text Indexing Defining an index on a field allows for quick sorting and searching of the first few characters of a field In some applications typically when fields contain extensive information you need to search for words that appear anywhere in a field efficiently V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 29 This is where you need to define a full text index or full index for short on that field A full index is an index defined on every single word of a field Last Name First Name Publication Title Jordan Ann Soups and Salads for Dummies Brown Charles The Hunchback of the Empire State Building Pintado Jack Bounds on Branching Programs Van Damme Lucie Natural and Artificial Intelligence Peppermint Patty Mastering Soups in 3276
10. 110 mGO N X ege kade Sie TI IN 23 mGoPrevious EE eee 77 Password J ke 50 114 mlmport 65 66 67 68 69 70 71 Pathtiaimes scie seed zegoen 23 mlmportFile 66 67 Portability Issues 136 V12 DBE for Macromedia Director User Manual version 2 1 99 07 27 OlIntegration New Media Inc 1995 98 page 193 Progress Indicator s siseeeeeeeeee 112 116 Properties VE EE 122 of Databases 112 115 Predefined a cene eo e 116 ee 120 9 Queries Boolean sons ees 35 Complex oe eker Kaya iet 35 et 34 R RAM butter 46 Reading a record 80 Reading an entire selection 80 Reading data 79 Reading fields of type date x a uev 79 of type float ies 79 of type integer Ee 79 of type media 88 OD SEH nee eee 79 Record Delimiter 80 Relational database cccesceseeseeseeeees 30 RE 102 A Search Criteria Complex 35 100 EE E 99 Sin DR Dn 34 95 STA EE 99 WordEquals eee 100 MWordStarts see bl n cehd keke 99 Selection RE 15 Recotds nete dni 76 EE RA tosta 102 Shortest word Full Index 121 ShowXlib ces 23 Sorting Styled Text Fields 104 eeler EE 30 e 109 163 String Types Custon 163 165 169 System Reguirements 15 T TAB delimited file
11. User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 21 This is a generic approach and works with all Xtras In V12 DBE the preferred way to check for errors is the Vi2Status method See n this manual Using the Xtra Instance Once the preliminary steps have been executed you can start using the Xtra instance of your database for creating tables fields and indexes or for using an existing database Methods of the Xtra need to be called to perform these operations By convention V12 DBE method names begin with the letter m such as mGetfield and mSelect with a few exceptions such as New V12Error and Vi2status New and mMessageList are compulsory methods and all Xtras support them Note In order to learn which methods are supported by an Xtra use the Xtra s builtin documentation See Documentation below This example shows the structure of the database referred to by gDB in the message window put mDumpStructure gDB Closing an Xtra When the Xtra instance has completed its function and is no longer required close it by setting the variable that refers to it to 0 Closing an Xtra performs mandatory housekeeping tasks and closes unneeded files It also frees the memory occupied by the Xtra All Xtra instances created with New must be ultimately set to 0 once they are no longer needed Example set gDB 0 If a V12dbe Xtra instance is not properly set to 0 the file it refers to re
12. V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 38 Step 2 Preparing the Data Step 2 is relevant only if your original data is managed in FileMaker Pro 4 Dimension DBase or any other database management system that has the ability to export TEXT or DBF files If you plan to use an ODBC driver to import your data from MS Access MS FoxPro MS Excel or MS SQL Server or if the records must be keyed in by the user skip to Step 3 In brief Step 2 consists in making sure that your original data is properly structured and in exporting it as Text or DBF files Those files are then imported to V12 databases at Step 4 Importing Data into a V12 DBE Database TEXT File Formats Text files are the most popular data interchange file formats Usually TAB delimited Text files are used to exchange data between database management systems A typical TAB delimited file is in the following format Field A1 TAB Field A2 TAB Field A3 TAB TAB Field An CR Field B1 TAB Field B2 TAB Field B3 TAB TAB Field Bn CR Field C1 TAB Field C2 TAB Field C3 TAB TAB Field Cn CR where Field A1 Field A2 etc designate the actual data in those fields TAB is the ASCII character 9 indicating the end of a field On the Mac CR is the ASCII character 13 indicating the end of a record On Windows CR is the ASCII character 13 followed by the ASCII character 10 Line Feed Since V12
13. ith mSetCriteria If you don t call morderBy mFind sets the current record based on the Master Field chosen by default by V12 DBE which is either the one indexed by the default index if the table was just opened or the one indexed by the best index chosen by V12 DBE during the last search Reading Data From a Database In order to read or write the content of a record you must first set it as the current record Setting the appropriate current record is accomplished by use of the mGoNext mGoPrevious mGoFirst mGoLast and mGo methods see Eee a Reading Fields of Type String Integer Float and Date Once the current record is properly set mGet Field retrieves the data from a specific field mGet Field retrieves data from all field types except Media Syntax set var mGetField gTable fieldName dataFormat Example set cost mGetField gTable price This example stores the content of the price field from the current record in the variable cost You do not need to specify the type of field you are reading The Lingo variable is automatically set to the appropriate type after a successful call to mGet Field see ypecasting n Database Basics Example set cost mGetField gTable price 9 999 99 This example retrieves the formatted content of the price field to the cost variable The formatting is according to the pattern 9 999 99 That is if the field price contains the value 1245 5 the string 1 245
14. LF as field delimiter Duplicate key occurred at line ld Selection empty No current record Selection empty No current record Selection empty No current record 7820 8410 8420 8430 8610 8620 8630 8640 8650 8660 8670 8680 8690 8700 8710 8720 8730 8740 8750 8760 9010 9020 9030 9050 9410 9420 9610 9620 9810 9820 10010 10020 10030 10040 10050 10060 10410 10440 10450 10460 10470 10480 10490 10500 10810 10820 10830 10840 10850 10860 10870 Selection empty No current record Index s does not exist Invalid index name Empty index name Wrong number of parameters Invalid field name Invalid operator Invalid field type Invalid operator Invalid operator Field does not exist No memory available Empty field name Operator not allowed for this type of field Field s is not full indexed Field s does not exist Word length is smaller than the minimum of indexed words 1d Cannot specify boolean operator in first criteria String must have at least one character Maximum number of criteria reached Wrong number of parameters Field s does not exist Invalid index order Empty index name Selection empty No current record Outside of selection range Unable to delete selection Database must be opened in ReadWrite mode Unable to delete record 31d This record is locked by another
15. See Dealing with Datesland for more details on DBF files and data importing rules Importing from V12 DBE Data can be imported from one V12 table into another The name of the source table need not necessarily match the name of the destination table However field names must match Non matching field names are ignored If the source and destination tables have different indexes the destination table s indexes are used Syntax mImportFile gTable V12 FileName password TableName where FileName is the pathname of the V12 database to import from password is the password to unlock it and TableName is the name of the table to import Example mImportFile gTable V12 the pathname amp Catalog V12 top secret articles If two fields have the same name but are of different types when importing data from a V12 DBE database mImport tries to typecast the data fields V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 66 Importing from a Lingo List or Property List Lingo list or a Lingo Property List can easily be imported to V12 tables through mImport This is very convenient for the conversion of projects that use Lingo lists to manage data and that have become difficult to debug and maintain It is also convenient to import XML documents into V12 tables through Macromedia s XML Xtra Syntax mImport gTable List theList mImport gTable Prop
16. delimiters see Custom Delimiters e In MS Access choose File gt Save As Export to an external file or database Then select Text Files in the Save as Type menu Click Export Make sure that Delimited is selected and click Next Click Include Field Names in First Row Dealing with Delimiters Ambiguity Most of the time TABs are used to delimit fields in a Text file and CRs to delimit records If your fields contain TABs or CRs as part of their actual data the legitimate content of your fields would be confused with those delimiters once exported in a text file There is more than one way to deal with this problem Choose the one or combination that best fit your project s needs in the list below Virtual Carriage Returns Some database management systems e g FileMaker Pro export a special character other than ASCII 713 instead of the cRs that appear in your fields For example FileMaker Pro exports ASCII 11 Vertical Tab instead of ASCII 13 Those characters are called Virtual Carriage Returns or VirtualCR for short V12 Database Engine can recognize those characters and convert them to real Carriage Returns ASCII 13 once they are imported See Step 4 Importing Data into a V12 DBE Database mporting Data with mlImport and Text Qualifiers A text qualifier is special character used to begin and end each Text field In most database management systems the quotation mark is the default text qualifie
17. e DD day in 1 or 2 digits e g 04 or 4 for the 4 day of the month The separator between the three chunks of values can be any non numeric character although slash hyphen and period are most commonly used Any date that needs to be imported in a V12 DBE fields of type date needs to be in this raw format This rules applies to the V12 DBE Tool as well as to V12 DBE s Lingo methods that accept dates as input parameters e g mImportFile mSetField and mSetCriteria Note If you omit to initialize a field of type date in a new record or try to store an invalid date in it it is automatically set to 1900 01 01 January 1 1900 DBF File Formats V12 Database Engine can import DBF files two ways V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 42 e on both MacOS and Windows it can read DBF files of type Dbase III Dbase IV Dbase V FoxPro 2 0 FoxPro 2 5 FoxPro 2 6 FoxPro 3 0 and FoxPro 5 0 e on Windows 9x NT only DBF files can be exported through the FoxPro ODBC driver You may want to export your data as DBF files if that format is supported by your database management system DBF is an old file format It was enhanced over the years but most common applications still use the popular Dbase III format whose features are common to all other DBF file variants Limitations include Field names are limited to ten characters all in upper
18. for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 106 mExportSelection takes the format patterns specified in mDataFormat into account The sorting order of the exported records is identical to the one set on the selection Media fields are ignored during the exporting process Exporting in DBF Format The parameters for exporting DBF files are identical to those of exporting text without the field and record delimiters Example mExportSelection gTable DBF Goliath DBF exports all fields of gTable mExportSelection gTable DBF Goliath DBF ItemName catalog number price exports only fields ItemName catalog number and price The following rules apply when exporting to a DBF file format e String fields are exported to fields of type Character if the buffer size of the string field is declared to be no larger than 255 characters Otherwise they are exported to field of type Memo e Integer fields are exported to fields of type Numeric e Float fields are exported to fields of type Numeric with 10 digits after the fixed point e Date fields are exported to fields of type Date e Media fields are ignored Although V12 DBE can read all kinds of DBF file variants it exports data only in the popular DBase III format This is mainly because DBase III is universally read by all DBF compliant systems whereas other more recent formats are not Clo
19. mp xxxxxxxxxx tMsCreateReport the pathname amp myReport mpf tMsBeginRegion MainRegion tMsSetVariable FirstName value tMsEndRegion tMsPrintReport tMsFreeReport Copy this script into your Lingo handler and replace tMsSetVariable FirstName value by tMsSetVariable FirstName mGetField gT FirstName Your report is ready for printing Example 2 printing multiple records from a V12 DBE selection This example shows how to print the first ten records of a V12 DBE selection with mPrint Printing any other number of records or the entire selection is similar First define a Repeat Region with the mPrint Designer gil Edit View Add Style Align Code Options Help 048 EN KEE MainRegion g TEXTI NameListRegion g FirstName Top Ten Performers FirstName Top Ten Performers is a mPrint Text object named TEXTI FirstName is a mPrint variable The rectangle enclosing FirstName is a Repeat Region named NameListRegion V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 142 In mPrint Designer choose Code gt Generate gt Director Lingo You get the following script tMsRegisterMPrint mp xxxxxxxxxx tMsCreateReport the pathname amp NameList mpf tMsBeginRegion MainRegion repeat with i 1 to loop count tMsBeginRegion NameListRegion tMsSetVariable F
20. multiuser OS Not locked Current record locked by other user Locked by self Reset error Clear schema error Bad clear byte Bad set byte Current Record already locked Bad select position number Bad field number Bad select type Bad select Op User abort Bad key number Different select types Invalid open mode Invalid parameter Bad edit mode Unknown error Invalid identifier Valid identifiers must have at least one character Invalid identifier First character must be alphabetic Invalid character s in identifier Invalid identifier length Valid identifiers have at most 32 characters Table s does not exist Field s does not exist in table s Field s of type s of table s is of a type that cannot be full indexed Invalid field type Invalid parameter The parameter must be a valid V12base component Invalid parameter The parameter must be a valid V12table component The database used by the table is not opened Bad table instance Check current instance Too many records Invalid object Invalid database structure Memory allocation error Field does not exist V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 185 1090 1100 1110 1120 1130 1140 1150 1160 1170 1180 1250 1260 1270 1280 1290 1330 1370 1380 1400 1410 1420 1430 1440 1460 1480 1500 1
21. the letters a and 4 may be considered identical in some languages but different in others This behavior is determined by the sorting and searching rules attached to each type of string V12 DBE s default and custom String types sorting and searching rules are defined by the following tables where equivalent characters are listed on the same line separated by one or more spaces and strict precedence is indicated by characters on successive lines For example j J K L wu means that e Ksorts after J and before L e j and J are equivalent likewise k and K are equivalent and 1 and L are equivalent too Characters omitted from a sorting and searching rules table are considered to sort after those listed in the table except for Control characters such as Carriage Return Horizontal Tab Vertical Tab etc which are considered to sort before those listed in the table The default string The default string type has predefined rules that accommodate a large number of languages English French German Italian Dutch Portuguese Norwegian etc If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version Its sorting and searching rules table is 1 39 1 2 ay 7 40 2 3 li 4l 3 4 24 42 4 Dec us 43 5 6 44 6 7 45 7 8 46 8 9t Suse 47 9 10 4 48 a 44 A A 11 49 bB V12 DBE for Macromedia Director User Manual ve
22. valid instances of V12dbe and V12table must exist before the method is invoked This is explained in details in Creating Instances mImport s syntax varies significantly according to the selected input source This is explained in details in importing Data with mImport Setting Xtra instances to 0 when they are no longer needed is mandatory as explained in Closing an Xtra so to make sure that the imported data is secured on hard disk CheckV12Error is a generic error management handler explained in Defensive Programming Previous versions of V12 DBE could import only Text and DBF files via mImportFile mImportFile is still supported for backward compatibility reasons It will be progressively phased out in future versions of V12 DBE Importing Data with mlmport The general syntax for mImport is mlImport gTable InputType InputSource other params where V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 63 e InputType is one of Text DBF literal list propertyList V12 Access FoxPro Excel or SQLserver e InputSource is the data to import or a reference to the data to import It varies according to the selected InputType e other params are parameters that depend upon the selected InputType For example if InputType is text other params is an optional property list that specifies the source text file s field delimiter rec
23. 1520 File is opened in ReadWrite mode Can t open in Shared Readwrite mode 1950 Old database version It was opened in ReadOnly mode 1970 This database is still in demo mode To legalize it please open it once in ReadWrite mode 2420 Already in database Structure edition mode Call mUpdateDBstructure before calling mEditDBstructure again 3620 Unsupported dbf field type 4130 Fields of type media cannot be indexed 4150 6500 6510 6520 6530 6930 6960 7000 7010 7020 7030 7040 7060 7080 7610 7810 10070 11720 12120 12760 14970 15220 16880 16890 Fields of type s cannot be full indexed Unable to export binary field type Field s not exported in DBF file Field s has been truncated to ten characters Selection empty No current record Field s of type Media cannot be export Field s does not exist s is an invalid date Default date has been set Field s at line 1d is longer than the 1d allocated for it and was truncated Too many field delimiters at line 1d The extra data was ignored Missing field delimiter s at line 1d Some fields were set to default data Field s is defined of type media in your database Use mSetMedia to Store data in it The field 1d of your definition has been truncated Exceed the maximum number of characters for a field 32 DBF field s of type s does not match the V12 type HEEM Unsuppo
24. 15650 15660 15670 15680 15810 15820 15830 16010 16020 16030 16040 16050 16410 16420 16430 16440 16450 16460 Invalid parameter Third parameter cannot be of type String Invalid member identifier Invalid parameter 3 attempt to get the binding type Cannot bind field The member 1d is already bound Wrong number of parameters Database structure not created properly Invalid table name Invalid field name Field s does not exist in table s Unable to create full index Call mEditDBstructure first Empty table name Empty field name Field s of type Specified in table cannot be full indexed Unable to edit database structure Database must be opened in Create or ReadWrite mode Unable to edit structure of table s Table already built Conflicting Add Edit mode Call mUpdateRecord before creating a new record Unable to add record Database must be opened in ReadWrite mode Wrong number of parameters Only fields type Integer Float and Date can be formatted Invalid data format Missing apostrophe A sub String was left open ended Too may periods in format specifier At most one period is allowed Empty field name Cannot set field format 200 is the maximum format length Wrong number of parameters Invalid output format Please consult the manual to get a description of the different output formats Error number required Wrong number of parameters Invalid pathna
25. 314159 is formatted 3141592 is formatted 31415926 is formatted as 0004 as 0123 as 314159 as 3141592 as HHH HHH The last formatting in the above example fails because an eight digit integer does not fit in a seven digit pattern The pattern 999 999 9999 is convenient for formatting phone numbers stored as integers For example mDataFormat gTable phone 999 999 9999 put mGetField gTable phone returns something formatted as 514 871 1333 Formatting Dates Valid patterns for fields of type date are combinations of D for days e Mfor months e y for years any other character literally The following example formats the date in the Year Month Day numerical format mDataFormat gTable put mGetField gTable Assume the content of field TheDate for the current record is Jan 5th 95 returned string is 95 01 05 TheDate TheDate YY MM DD the Ds Ms and vs can be combined in the following way To format Days as 1 31 Days as 01 31 Weekdays as Sun Sat Weekdays as Sunday Saturday Months as 1 12 Months as 01 12 Months as Jan Dec Months as January December Years as 00 99 Years as 1900 9999 Use this sequence D DD DDD DDDD M MM MMM MMMM Y or YY YYY or YYYY V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 85 Examples The pattern Formats 5 January 1995 a
26. 32 onl V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 55 mReadDBstructure from MS Access Win 32 Only MS Access databases can be used as templates to V12 databases Like V12 DBE MS Access can store multiple tables per database mReadDBstructure imports all such tables to V12 DBE The MS Access ODBC driver is required to perform this operation The names of the tables and fields of your MS Access file must be valid V2 DBE identifiers see Defining Identifiers in Step 1 Deciding on a Data Model Syntax mReadDBStructure gDB Access FileName Username Password where e FileName is the path to the MDB file e Username is a valid user name to access the MDB file or EMPTY if the MDB file is not protected e Password is Username s matching password or EMPTY if the MDB file is not protected The following rules apply to the translation of MS Access file structures to V12 databases MS Access Translated to Notes field type V12 field type Text Siting ie Ll is same as Access Number byte Integer Number integer Integer Namoa Integer long integer Number single Float Number double Float Number Ignored replication ID Currency Integer Date Time Ignored Autonumber Integer Yes No Integer OLE Object Ignored HyperLink String URL imported as text V12 DBE for Macromedia Dir
27. DBE always ignores Line Feed characters you need not worry about exceptional cases between the Mac and Windows with respect to Record Delimiters Generally using the V12 DBE Tool or the mImport method to import a text file into a V12 DBE database is a straightforward process unless your fields contain TAB or CR characters In such cases V12 DBE confuses the real delimiter with the legitimate content of your field See Dealing with Delimiters Ambigui Field Descriptors V12 DBE requires a special type of Delimited Text file format The file s first line must contain field descriptors or the names of the fields into which the data that follow must be imported This file format is sometimes referred to as mail merge format Following is an example of such a file Name Price CatNumber Ruler 1 99 1431 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 39 Labels 1 19 1743 Tags 6 19 You can easily have FileMaker Pro and MS Access export those field names before exporting the records data as follows e In FileMaker Pro choose File gt Import Export gt Export Records and select Merge MER in the Save as Type menu As a side effect FileMaker Pro exports your data with quotation marks surrounding each field and a comma as field separator Your file can easily be imported to the V12 database with quotation marks as Text Qualifiers Text Qualifiers and commas as field
28. DBE database This section discusses the elements needed to manage your V12 DBE database at runtime If you chose to script the database creation and importing processes once the database file is ready you do not need those Lingo scripts any longer Moreover they do not necessarily need to be delivered to the end user However for your convenience you may want to keep all the scripts related to your project in a single Director movie Using the V12 DBE Behaviors Library The fastest and easiest way to implement V12 DBE into your project s user interface is to use the V12 DBE Behaviors Library See the First Steps manual and the V 2 DBE Behaviors Library manual for an overview of V12 DBE Behaviors However the V12 DBE Behaviors Library enables you to implement a subset of V12 DBE s functionality If the V12 DBE Behaviors Library cannot satisfy the requirements of your project you probably need to use V12 DBE s Lingo interface Using Lingo As for any V12 DBE method a valid V12dbe or V12table Xtra instance depending on which Xtra the method belongs to must exist before the method is invoked Generally you create instances of V12dbe and V12table on StartMovie store their references in global variables and use those instances throughout your project Likewise on StopMovie you set those global variables to 0 thus disposing of the Xtra instances and closing the V12 database file The creation of such Xtra instances
29. Data into a VI2 DBE Database Importing Data with mImport Note Since VI2 DBE always ignores Line Feed characters ASCII Character 10 those cannot be used as field or record delimiters Calculated Fields If your database management system does not support alternative delimiters you can nonetheless force it to export your own delimiters by creating an additional field and setting it as the result of the concatenation of all the other fields with the desired delimiter in between each two fields Then export only the new field in a text file Processing the Exported Text File If the database management system used to store your data is not flexible enough or if the data themselves are not properly structured you can export them in a text file and use Third Party tools to search and replace sequences or patterns of characters Below is a non exhaustive list of helpful tools e BBEdit for MacOS from Bare Bones Software Www barebones com For MacOS For Windows e TextPad from Helios Software Solutions e UltraEdit from IDM Computer Solutions For Windows For MacOS and Windows e MS Excel from Microsoft Corp BBEdit TextPad and UltraEdit feature GREPs General Regular Expression Parsers which are very convenient to structure unstructured data V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 41 Character Sets Character sets are not s
30. EXTENT THAT APPLICABLE LAW REQUIRES SUCH LIABILITY BECAUSE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES THE ABOVE LIMITATION MAY NOT APPLY TO YOU 8 General This Agreement will be construed under the laws of the Province of Quebec except for that body of law dealing with conflicts of law If any provision of this Agreement shall be held by a court of competent jurisdiction to be contrary to law that provision will be enforced to the maximum extent permissible and the remaining provisions of this Agreement will remain in full force and effect 9 The parties acknowledge having requested and being satisfied that this Agreement and its accessories be drawn in English Les parties reconnaissent avoir demand que cette entente et ses documents connexes soient r dig s en anglais et s en d clarent satisfaits The following trademarks are used throughout this manual Director and Xtra are trademarks of Macromedia Inc FileMaker Pro is a trademark of Claris corp Windows Access and MS Excel are trademarks of Microsoft corp Macintosh is a trademark of Apple corp 4th Dimension is a trademark of ACI Photoshop is a trademark of Adobe Systems Inc V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 125 Appendix 3 Capacities and Limits e The size of a V12 DBE database file is limited by disk space
31. Fields of Type Media To write any media type call mSetMedia gTable MediaField DirMember The following example copies the content of member Yeti of castlib photo album to the field photo mEditRecord gTable mSetMedia gTable photo member Yeti of Castlib photo_album V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 88 mUpdateRecord gTab1le Only mSetField and mSetMedia can be called after mEditRecord and before mUpdateRecord Calling any other method aborts the new record adding process and sets the current record to the previous current record Thus if you started editing a record and wish to abort the operation simply call mGetField instead of calling mUpdateRecord Deleting a Record Call mDeleteRecord to delete the current record Syntax mDeleteRecord gTable instance Example mDeleteRecord gTable After calling mDeleteRecord the record which follows the record being deleted becomes the new current record If no record follows the deleted record the preceding record becomes the new current record If no record precedes the deleted record the selection is then empty and the current record is not defined Deleting All the Records of a Selection Call mSelDelete to delete all the records of a selection at once Syntax mSelDelete gTable After mSelDelete has been completed the selection is empty and the current recor
32. FirstName ascending By adding FirstName to the Last NameN x index your initial script mSetCriteria gT LastName Smith mSelect gT yields a selection sorted by FirstName You can further optimize your queries by imposing a specific index for your search if more than one index fits the best index criteria Assume for example that your table contains two compound indexes one for LastName FirstName and one for LastName YearOfBirth TABLE Addresses FIELDS LastName string FirstName string YearOfBirth integer INDEXES V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 148 LastFirstNdx duplicate LastName ascending FirstName ascending LastBirthNdx duplicate LastName ascending YearOfBirth ascending FirstNameNdx duplicate FirstName ascending The query mSetCriteria gT LastName Smith mSelect gT automatically chooses LastFirstNdx as its best index thus delivering a selection sorted by LastName and then FirstName If you need your selection sorted by LastName and then YearOfBirth run the following script mSetCriteria gT LastName Smith mSetCriteria gT AND YearOfBirth gt 0 bogus criterion mSelect gT The criterion YearOfBirth gt 0 does not affect your selection in any way since any data stored in this field is always greater than 0 However its presence forces V12 DBE to use the Las
33. In this example we were lucky enough to have a Scores tables that naturally links Students and Tests but in many cases creating a Many to Many relation is not obvious you often need to create a fake table that only contains the IDs of both sides entities Such a table is called an Associative Table It s sole purpose is to put other tables in relation with each other V12 Database Engine does not contain a language that automatically resolve relations between tables Instead it relies on Lingo to do so V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 151 Resolving a One to Many Relation In the above example resolving a One to Many relation from the Students table is something like given a Student s last name select all the records in table Scores that a related to it The following script performs this operation first locate record of student who s last name is LName mSetCriteria gTStudents LastName LName mSelect gTStudents get student s ID SID mGetField gTStudents ID look for score records where StudentID is sID mSetCriteria gTScores StudentID sID mOrderBy gTScores Score sorting is optional mSelect gTScores At the end of this script gTScores selection contains LName s scores sorted lowest to highest Example if LName was assigned the string Cartman in the above example after the execution of the above
34. Lingo interface to fully script both the authoring and runtime tasks If you are new to Lingo you may want to begin with V12 DBE Light Edition to create more simple projects Both Regular and Light Editions are fully compatible with each other You can start using V12 DBE Light Edition and later easily upgrade to V12 DBE Regular Edition If you are looking for a fast and easy way to integrate V12 DBE into your multimedia projects you may be interested in using the V12 DBE Tool and V12 DBE Behaviors Library both freely available atlhttp www integration qc ca An Online Companion is also available for V12 DBE It enables the management of V12 databases through the Internet You can learn more about it at ttp www integration qc caJ in the Products section V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 11 V12 DBE for Authorware V12 DBE is easy to use with Authorware version 4 x and later It allows you to enter store and retrieve data using Auhthorware as a multimedia front end V12 DBE enables you to easily create multimedia applications whose content is managed separately from Authorware thus speeding up development cycle last minute changes and content updating It also provides Authorware with a simple way to store and retrieve specific pieces of information which is very useful for common data management tasks such as multiple user tracking and score
35. New Media Inc 1995 99 page 61 Step 4 Importing Data into a V12 DBE Database In Btep 3 Creating a Database you created a properly structured although empt V12 database Step 4 explains how to import the data prepared at Btep 2 Preparing the Data into your V12 database You can import data into a V12 database through one of the two following methods e using the VI2 DBE Tool This is a convenient point and click environment for small projects e using VI2 DBE s mImport method in a Lingo handler This approach is efficient when you need to experiment with your database structure or data before committing to a final form However it requires a bit more up front effort to write adapt Lingo handlers than simply using the V12 DBE Tool mImport was introduced with V12 DBE version 3 0 It replaces the former mImportFile method mImportFile is still supported in V12 DBE version 3 0 However it will be phased out in future versions Using the V12 DBE Tool To import data using the V12 DBE Tool 1 Choose File gt Open to open the V12 database you want to import data to A newly created V12 database automatically opens and data can be immediately imported to it 2 Choose File gt Import Text File or File gt Import DBF File 3 Browse through your disk to locate the Text or DBF file to import Click OK If the source data is in more than one file you can successively import them by repeating the above steps For
36. V12dbe Xtra instance in Shared ReadWrite mode Syntax Set gDB New Xtra Vl2dbe FilePathname Shared ReadWrite MyPassword MacOS example new Xtra Vl2dbe MyNetworkDrive Data Catalog V12 Shared ReadWrite password Windows 9x NT 3 1 example F is a mapped volume new Xtra V12dbe F Data Catalog V12 Shared ReadWrite password Windows 9x NT example new Xtra V12dbe BigServer Data Catalog V12 Shared ReadWrite password At most 128 users can open a V12 DBE file in Shared ReadWrite mode If a user opens a database in Shared ReadWrite mode any attempt to open it in an exclusive mode ReadWrite or ReadOnly will fail If the database is open in Shared ReadWrite other users can also open it Shared ReadWrite mode If the database is open in an exclusive mode ReadWrite or ReadOnly it cannot be opened by any other user V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 128 Modifying a Shared Database If you plan on allowing users to modifying the content of your shared database note the following rules e VI2 DBE uses a record locking technique which means that if a user is editing the current record after a mEditRecord then no other user can call mUpdateRecord until that user is finished Any other call to mEditRecord would fail because the record would be locked Both v12Error and V12Status would re
37. a typical way to search for a telephone number There are directories which index information by order of phone number or address but any such directory sorts information in only one specific predetermined order V12 DBE allows you to determine how you want to sort information by defining one or more indexes in a table When a field is indexed V12 DBE creates an internal list that can be used to sort and search quickly the data it contains Non indexed fields can also be searched and sorted but at a slower speed In this example the address book entries are listed according to an index of the first name field and sorted in ascending order A to Z thus appearing in alphabetical order by first name Last Name First Name Address City State Zip Phone Jordan Ann 6772 Toyon Court San Mateo CA 94403 349 5353 Brown Charles 30 Saxony Ave San Francisco CA 94115 421 9963 Pintado Jack 22 Hoover Ave Bowie MD 20712 731 5134 Van Damme Lucie 87 Main St Richmond VA 23233 315 3545 Peppermint Patty 127 Big St Lebanon MO 92023 462 6267 Compound Indexes A compound index or complex index organizes entries composed of two or more fields as opposed to simple indexes or indexes for short which organize single field entries Compound indexes are useful to determine the sorting order of records when some fields contain identical values In the following example three records share the same last names Cartman Indexing the field LastN
38. alternate Internet resources such as Director online User Group Attp www director online com UpdateStage Ahttp www updatestage com Maricopa Attp www mcli dist maricopa edu director and the Lingo User Journal Attp www penworks com Customer Support and Developer Assistance If you need additional assistance INM s experienced team will be happy to help Customer support is available from 9 00 am to 5 00 pm EST Monday through Friday by email to support integration ge ca or by phone at 514 871 1333 choose menu selection6 Priority will be given to registered V12 DBE users Customer suport covers e Helping to understand V12 DBE clarify specifications e Supplying sample scripts e Providing useful tips Where Customer Support stops Developer Assistance begins If you are familiar enough with V12 DBE but want to take your project to a more sophisticated level Developer Assistance is for you Our team of programmers can help you discover easier ways to take advantage of databases in your multimedia projects Here are just some of the services we offer e Project design data structure analysis planning e Technical assistance guidance advice throughout the various steps of your project e Troubleshooting and debugging your scripts e Optimization how to obtain superior performance e Assistance with other Xtras custom development of Xtras Typographic Conventions Important terms such as the names of me
39. and Descending Invalid field name s is a reserved word Field s of table s has an invalid field type Invalid descriptor type Valid types are Literal Text DBF or V12 Empty database descriptor Table s already exists Field s does not exist in table s Unable to edit database Structure Database must be opened in Create or ReadWrite mode Not in database structure edition mode Call mEditDBstructure first Invalid DBF file format Buffer size not required for fields of type s Invalid field size in table HEEM First character of table s must be alphabetic Unable to modify database structure Database must be opened in Create or ReadWrite mode Wrong number of parameters Invalid table name Table s already exists Unable to create new table Call mEditDBstructure before creating new tables Empty table name Unable to edit database structure Open database in Create or ReadWrite mode Table s contains invalid characters First character of table s must be alphabetic Table s has an invalid identifier length Valid identifiers have at most 32 characters Cannot create table s The maximum number of table s is 1d Wrong number of parameters 9 gg 9 gg 4020 4030 4040 4050 4060 4070 4080 4090 4100 4110 4120 4140 4160 4170 4180 4190 4200 4210 4220 4230 4240 4510 4520 4530 4540 4550 4560 457
40. and Warnings Typically two types of faults can occur in using V12 DBE e Errors which lead to major problems that require that you stop the execution of your script e Warnings which happen while executing certain instructions partially or in borderline conditions that you need to be aware of An example of an error is File not found when trying to import data When a file is not found it does not make sense to continue the importing operation until the problem is solved An example of a warning is No previous record when trying to go to the previous record from the first record of the selection In such a case the current record remains valid although unchanged Vi2Status returns negative codes for errors and positive codes for warnings Often the term error is used to designate faults of both types i e errors and warnings Note Usually you call vi2Status to get an error or warning code then V12Error to get a full explanation of that error or warning V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 104 Lingo Syntax Errors When a scripting error occurs e g Lingo syntax error Macromedia Director displays an error message and aborts the execution of the current handler This can be annoying in cases where local database and table instance variables are defined in your handler Example on doSomethingCritical set gDB New Xtra V12
41. another application nable to open V12 file ake sure the file is in he specified path and not Sed by another application nable to open DBF file ake sure the file is in he specified path and not used by another application Unable to modify database structure Call mEditDBstructure first Empty file name Missing END tag in database descriptor Missing field name in table HEEM Field Ser of type Media cannot be indexed Missing TABLE tag in database descriptor Missing table name in database descriptor Invalid field name in table HEEM Field s already exists in table s CSO SGCG C V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 186 3400 3410 3420 3430 3440 3450 3460 3470 3480 3490 3500 3510 3520 3530 3540 3550 3570 3580 3590 3600 3610 3810 3820 3830 3840 3850 3860 3870 3880 3890 3900 4010 Field of type s of table is of a type that cannot be full indexed Invalid field type in table HEEM Maximum number of indexes reached The maximum is ld Index s already exists in table s Invalid index type in index s of table Sei Missing field name for index s in table Ser Field s set in index amp s of table Ser does not exist Missing order for index s of table s Valid orders are Ascending
42. attempts to rebuild the indexes of a damaged V12 DBE file but if the file s headers or data clusters are damaged chances are that the recovery process will fail Progress Indicators V12 Database Engine can display a progress indicator to the user when performing time consuming tasks such as mImportFile mExportFile mGetSelection mSelect mSelDelete mFixDatabase and mPackDatabase Such a progress indicator can optionally feature a Cancel button to enable users to interrupt the current V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 109 task You can also replace the standard V12 DBE progress bar by any custom progress indicator you provide via Director and Lingo mSelect preceded by mSetCriteria with simple or complex criteria enables the display of a single progress indicator for the selection task except if the criteria contain wordStarts or wordEquals operators In that case as many progress indicators as criteria are displayed To activate the progress indicator set the ProgressIndicator property to With Cancel Without Cancel or UserDefined To deactivate it set it to None Options of the ProgressIndicator property With Cancel V12 DBE displays its own progress bar when performing one of the above mentioned tasks The user can click on the Cancel button to abort it You can set the ProgressIndicator Message property to whatever message you wis
43. be stored in a Director member In addition these members names or numbers can be stored in V12 DBE tables This may be convenient if your original media is already located in Director members it yields faster access times given that it avoids useless memory allocations re allocations in transferring data between Director and V12 DBE However storing media directly in V12 DBE databases has its advantages Your data becomes completely independent of your Director projector and it may be easier to update You can import media to V12 DBE fields of type media one at a time using the V12 DBE Tool see the V12 DBE Tool s User Manual You can also automate and customize the media importing process through Lingo scripting Assume your database contains one table and five fields e Field ItemName of type String Field Description of type String Field Price of type Float Field Cata1ogNumber of type Integer Field Photo of type Media In addition assume that the first four fields are in a TAB delimited format named Data txt and that all photos 5 field are in PICT format Each photo is located in the same folder as Data txt with each image file bearing the catalog number of the item with which it corresponds The following example illustrates how to import the text file in a V12 DBE database and then how to review each imported record in order to import the corresponding image file Example Some database creation preliminarie
44. by the CharacterSet property see haracterSet in Properties of Databases virtual_CR determines which character is used as a Virtual Carriage Return and thus must be converted to ASCII 13 after importing see Carriage Returns jin Step 2 Preparing the Data The default character is the one defined by the virtualCR property which is usually ASCII 11 see irtualCR in Properties of Databases rest qualifier determines which character is used to begin and end each Text field Those qualifiers delimit the field so to allow it to contain special characters including those used as field and record delimiters Text qualifiers V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 64 are removed after importing the file See Text Qualifiers in Step 2 Preparing he Data The default text qualifier is QUOTE q For example the following instruction imports the Text file myTextData txt located in the same folder as the current movie into gTab1e with all the default options field delimiter TAB records delimiter RETURN Character set the current operating system s virtual CR ASCH 11 Text Qualifier QUOTE mImport gTable TEXT the pathname amp myTextData txt This second example imports the Text file myFile txt which uses as field delimiter and as record delimiter mImport gTable TEXT the pathname amp myTextData txt field_delimi
45. cannot be opened Example set gDB New Xtra Vl12dbe the pathname amp Catalog V12 ReadWrite top secret Always make sure that the New method succeeded by checking the validity of the returned reference with Object P Example set gDB New Xtra V12dbe the pathname amp Catalog V12 ReadWrite top secret if NOT ObjectP gDB then alert New V12dbe failed Opening a Table Records belong to tables Creating new records reading the contents of records and searching and sorting records are operations that are performed on tables Prior to performing any of these operations you must create a table Xtra instance Syntax set gTable New Xtra V12table mGetRef gDB TableName To create a table Xtra instance use the New method with the following parameters V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 73 e gDE the database Xtra instance to which the current table belongs e TableName the name of the table to open Example set gTable New Xtra V12table mGetRef gDB Articles mGetRef is a standard Xtra method that returns the exact reference of an Xtra instance Always make sure that the New method succeeded by checking the validity of the returned reference with Object P Example set gTable New Xtra V12table mGetRef gDB Articles if NOT ObjectP gTable then alert New V12table failed Following is a com
46. case The number of fields per DBF file is limited to 128 Records are of fixed length determined upon the creation of the DBF file There is more than one way to deal with high ASCII characters accented characters with DBF files This depends on the operating system and application used to manage the DBF file Indexes are saved in separate files with extensions such as IDX MDX NDX or CDX depends on the managing application DBF files cannot be password protected However some applications protect DBF files by encrypting decrypting them Character fields roughly the equivalent of V12 DBE s string fields are limited to 255 characters Any text longer than 255 characters must be stored in separate files called DBT files and referred to by Memo fields Media either Binary or Text are stored in external DBT files pointed to by Memo fields in the DBF file Media fields are limited to 32K of size Various flavors of the DBF file format were introduced over the years such as DBase IV DBase V FoxPro 2 0 FoxPro 2 5 FoxPro 2 6 FoxPro 3 0 and FoxPro 5 0 They all include DBase III s features as core specifications and add new data types or extend certain limits See mReadDBstructure from a DBF File for more details Years ago DBF files were convenient given that they contained less variants than TEXT files However since the introduction of Windows and the popularization of DBF to other Operating Systems DBF files contain
47. computers that do not have the license file V12 DBE returns a warning when opening unstamped databases in such circumstances Files Needed to Use V12 DBE Only one file is required for the Runtime version also called end user version of V12 DBE The name of this file is VI2 DBE for Director XTR on the Macintosh and V12 DBE for Director X32 on Windows 9x NT and V12DBE D x16 on Window 3 11 The Development version requires an additional file the license file located in the System Preferences folder of your Macintosh or the Windows System folder of your PC This encoded file is generated by V12 DBE upon the registration of your license number Although the Runtime version of V12 DBE can be distributed freely in as man copies as you wish you cannot distribute your license file See Appendix 1 Licensing FAQs Bind Appendix 2 License Agreement V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 19 Using Xtras This section deals with Xtras and how they are used in Macromedia Director The V12 DBE Xtra is used as an example throughout the manual You will be introduced to the basic steps involved in using V12 DBE successfully before you actually begin to work with V12 DBE This appendix covers What is an Xtra Making an Xtra available to Director Creating a Lingo Xtra instance Verifying whether the instance was successfully created Using t
48. criteria In the above example all records that contain a price field with a value that is strictly smaller than 2 are selected In addition the selection is sorted with an increasing order of prices given that a search with a defined ascending index was performed on that field The current record is the first record of that selection In our example it is the least expensive item If you want the selection sorted in an order other than the one proposed by mSelect you can do so by calling morderBy right before calling mSelect However keep in mind that this may cost some additional processing time Values provided to mSetCriteria need to be in the same type as FieldName As discussed in Database Basics V12 DBE tries to automatically typecast value to the proper type Borderline conditions such as criteria containing extra spaces carriage returns or other unwanted characters must be avoided Example mSetCriteria gTable price lt 100 is strictly equivalent to mSetCriteria gTable price lt 100 00 but beware of the unpredictable results of mSetCriteria gTable price lt 100 00 Operations on fields of type Date require that Value be supplied in Raw format see Step 2 Preparing the Data V Dealing with Dates The following example locates all records where field theDate contains a date occurring before May 21 1997 mSetCriteria gTable theDate lt 1997 05 21 V12 DBE for Macro
49. database is well defined and creates the file on your disk Syntax mBuild gDB mBuild optionally accepts a second parameter online that makes the created file compatible to the V12 DBE Online companion In this case two additional fields named uID and timeStamp are created for V12 DBE Online to manage internally Both fields are hidden and do not appear in mDumpSt ructure s result Syntax mBuild gDB online Note A valid database needs exactly one table at least one field and at least one index Example mBuild gDB since mBuild does a lot of validations checking for errors warnings is HIGHLY recommended if V12Status then Alert mBuild failed with error code amp V12Error V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 59 Once the database file is built the database instance remains valid and data can be immediately imported into the file It is as if the database was opened in ReadWrite mode For mBuild to create a licensed database that is one that does not display a Demo dialog when opened a V12 DBE license file must be present on your Mac or PC Since the V12 DBE license file cannot be delivered to the end user mBuild cannot be used to create new databases at runtime If your application requires to create new databases_at runtime usee mCloneDatabase see Cloning a Database Viewing the Structure of a Database
50. e The number of database instances and table instances is limited by RAM Up to 128 instances of single database can be opened by 128 different executables Director applications Shockwave movies or Projectors in Shared ReadWrite mode Each executable is entitled to only one database instance of a given database although you may create as many instances of distinct databases as you wish in a single executable Multiple instances of a table can be created on a single computer e Databases that contain media fields are not compatible between version 6 and version 7 of Director They must be used with the version of Director they were created with e A maximum of 128 indexes can be defined on a V12 DBE database Each index can operate on up 12 fields e Since each table requires at least one index the maximum number of tables in a V12 DBE database is also 128 e Avalid VI2 DBE database contains at least one field and one index e Up to 100 criteria can be chained with sequences of mSetCriteria separated by Boolean operators e All records are of variable length Fields of type media are limited to 1Mb Fields of type string are limited to 64K Note Director Field members are limited to 32K e The range of the type Integer is 2 to 27 2147483648 to 2147483647 e The range of the type Float is 79769313486232E 308 to 2 22507385850720E 308 e Any date later than January 1 1600 can be compared retrieved and sto
51. following the current record becomes the new current record If no record follows the deleted record the preceding record becomes the new current record If no record precedes the deleted record the current record 1s not defined Example mDeleteRecord gTable See Also mAddRecord mEditRecord mDumpStructure V12dbe Syntax mDumpStructure gDB Parameters none Description Retrieve information on a database structure Very convenient for debugging Example put mDumpStructure gDB put mDumpStructure gDB into field dummy mEditRecord V12Table Syntax mEditRecord gTable Parameters none V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 170 Description Enable the modification of the current record A normal record modification sequence consists of a call to mEditRecord a sequence of calls to mSetField and a call to mUpdateRecord Example mEditRecord gTable mSetField gTable name funnel mSetField gTable price 2 95 mUpdateRecord gTable See Also mAddRecord mSetField mUpdateRecord mFind V12Table alternative to mGo mGetField V12Table Syntax mGetField gTable fieldName dataFormat Parameters fieldName name of the field to read dataFormat patten for Integer Float and Date formatting Description Retrieve the content of field FieldName for the current record If dataFormat is
52. for all records Then run the Dish is soup or appetizer and Main Ingredient is celery or eggplant query in two rounds mSetCriteria gTable DishType soup mSetCriteria gTable OR DishType appetizer mSelect gtable Then mark all found records repeat with i 1 to mSelectCount gtable mEditRecord gtable mSetField gtable marker 1 mUpdateRecord gtable end repeat Now run the second part of the query mSetCriteria gTable ingredient WordEquals celery mSetCriteria gTable OR ingredient WordEquals eggplant mSetCriteria gTable and marker 1 mSelect gtable V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 137 If there is a third part to you query mark your selection with a 2 in the Marker field and keep on going For best performance the first query must be the most restrictive that is the one that yields the least results At the end restore the marked fields to 0 so to prepare them for another query Workaround 3 Field Concatenation The field concatenation technique works for queries that use ANDs at the lowest level and ORs a the higher level such as Origin is Italian AND Dish is appetizer or Origin is French AND Dish is soup Furthermore all of your search criteria with the possible exception of the last one must use the operators The last operator can be ei
53. from V12 fields of type String The calls to V12 DBE are identical to those used for single byte strings see Step 5 Implementing the User Interface To store a double byte string mEditRecord gTable mSetField gTable name aName a Name is double byte mUpdateRecord gTable To retrieve a double byte string set aName mGetField gTable name You can also store and retrieve styled double byte strings with calls to mSetField gTable name member 5 of castlib V12stuff mGetField gTable name member 5 of castlib V12stuff See Managing Styled Text for details on the storage and retrieval of styled text Indexing Searching and Sorting Data The indexes of V12 Database Engine version 3 0 are not designed to handle double byte strings This implies the following limitations on the queries that can be expressed for searching see Bearching Data with mSetCriteria e the Equal and lt gt operators works properly as with single byte languages e the Starts operator can fail in certain circumstances such as when an odd number of bytes is searched with mSetCriteria e the Contains operator finds all records that match the specified criteria but can also find additional records that don t Remember the contains operator does not take advantage of indexes It is therefore slow e the gt lt gt lt operators will fail most of the time They would work properly only in exceptional cases where the sort order of
54. hat sets items for selection with descriptions such as Hat with two propellers and Hatchet for heavy duty applications If an index is defined on the field description the search process is very fast If not the search takes more time but can be performed nonetheless Contains The contains operator can be used with fields of type string only including custom string types It locates records that contain a given sub string in the specified field Example mSetCriteria gTable description contains hammer sets records for selection containing descriptions such as the greatest hammer in the world and casing for hammers of all sizes Searches using the contains operator are inherently sequential They cannot take advantage of any index definition and can be very slow WordsStarts The wordStarts operator can be used only with fields of type string including custom string types with defined full indexes It locates records that contain words that fully or partially match the value specified to nsetCriteria V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 97 Example mSetCriteria gTable description wordStarts ham sets records for selection containing descriptions such as Gigantic hamburger with fries and The greatest hammer in the world It does not find records containing descriptions such as Champion or Gotham City b
55. integration qc ca for free downloads of V12 DBE and related files During the development of my project I need to have the V12 DBE Xtra in my Director Authorware s Xtras folder When I deliver it to end users I still need to place the V12 DBE Xtra in the Xtras folder Can t the end user simply hijack my V12 DBE license No The V12 DBE Xtra works as a development tool and enables you to create new database structures only if it detects a license file in your System folder Otherwise it works as a playback a k a runtime tool for reading writing and searching data Your license number is encrypted in the V12 database you deliver Thus no one can hijack it Can I deliver a project that uses V12 DBE and that would be used by two or more users simultaneously You can distribute any product or program containing V12 DBE Xtra to be used at runtime I am working as a consultant for a client who will distribute or sell or give away the project I am developing Who needs a V12 DBE license V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 121 A Both you and your client need a license for V12 DBE The only other alternative is for you to permanently transfer your V12 DBE license to your client Integration New Media must be notified of such permanent transfers If you decide to transfer you license you must make sure not to keep a copy of the registration number and th
56. management The V12 DBE Tool used with Authorware will help you quickly implement the most common V12 DBE s powerful functions such as database creation viewing editing importing exporting and more The V12 DBE Tool is available FREE on our web site at http www integration qc ca About This Manual If you are familiar with other database management systems you will find V12 DBE very easy to use If you are only vaguely familiar with database management the First Steps Manual will guide you step by step through the basics required to implement simple database management in your multimedia projects This manual provides you with a brief overview on how to use V12 DBE by illustrating the main development stages involved through a practical example the Portfolio You will be guided from step one which consists in modeling your database up to the final results in a Director movie The Portfolio example is also extended in the Manual s Appendix where you will learn how to add a media field in the project in order to display images in the Portfolio This manual is organized to help you get the information you need efficiently The first two sections deal with basics concerning Xtras Using Xtras and databases Database Basics The third section leads you through explanations on how to use V12 DBE in greater detail Using VI2 DBE You will learn how to prepare data create the database and import data The following sections wi
57. many categories and have become difficult to manage V12 DBE s preferred file importing format is Text In summary the exact structure and limitations of your DBF files largely depend on how your database management system deals with them V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 43 Field Buffer Size Prior to creating your database structures you need to determine the size of the largest chunk of data for each field of type string or media in your database This helps you optimize the size of the buffers needed to manage V12 DBE s internal data structures for each of those fields If you are confident that your strings will not exceed 256 bytes or your media 64K you do not need to worry about the buffer size Default buffers are set to 256 bytes for strings and to 64K for media Database management systems that use a fixed length record format such as the DBF file format use this maximum value to allocate data space on disk Consequently that amount of space is lost for each record of the database regardless of the actual data stored in it V12 Database Engine uses a variable length record format This means that it uses the exact amount of space needed for the storage of a record on disk with no space loss at all The Field Buffer Size is used only to allocate buffer sizes in RAM while transferring data between Director and the V12 database files
58. member say member 25 item 1 of the name of member 25 returns the name of the table from which it is generated and item 2 of the name of member 25 returns the name of the field from which it is generated V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 92 mAutoBinding mAutoBinding tries to bind V12 DBE fields to Director members automatically based on the naming convention described above e g TableName FieldName Syntax mAutoBinding table instance castLib This operation tries to bind each field of table instance toa member of castLib If more than one member is eligible to be bound the one with the smallest number is bound and the others are ignored For example if gTable refers to a table named articles containing the fields ItemName Description Price Catalog number and Photo and if the Director movie s internal cast contains members named Articles ItemName Articles Description Articles Price Articles ItemName and Articles Photo possibly obtained by calling mGenerateMembers mAutoBinding gTable internal performs the following binding operations V12 DBE field e Director member ItemName e Articles ItemName Description e Articles Description Price e Articles Price Catalog number e Articles Catalog number Photo e Articles Photo As does mBindField mAutoBinding accepts the parameter SafeBinding to establish a binding lin
59. menu VI2 DBE comes with an on line help to assist you in the development of your projects It is an unprotected Director movie that can be accessed by selecting the Xtras gt V12 DBE for Director gt Help menu To install it Move V 2Help DIR and VI2Help V12 to the Director folder V12Help DIR is itself a project that relies on dynamic data management thanks to V12 DBE A single Director movie V12Help DIR is used as a screen layout template and pulls content out of a V12 database depending on users requests Replacing the V 2Help V12 database behind this movie by another one makes an entirely new content available to the users V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 16 What s New in Version 3 0 V12 databases versions 2 x and 3 0 are fully compatible to each other Databases created with V12 DBE version 2 x can be used as is with V12 DBE version 3 0 e Multiple users can simultaneously access V12 databases over a Local Area Network See Appendix 4 Multi user Access if you need to make a V12 database available to multiples users through a TCP IP network check V12 DBE s Online Companion e On Win9x NT MS Access databases MS FoxPro files MS Excel workbooks and MS SQL Server data sources can be used as templates to create new V12 database and as sources of data to import records from through ODBC drivers See Database Creation fnd Import
60. more information see the V12 DBE Tool s User Manual Scripting the Data Importing mImport imports data to a V12 DBE table both at authoring time 1 e in Director s development environment and at runtime 1 e from a Projector or Shockwave movie V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 62 mImport is very flexible and can be adapted to a large number of situations It can import data from a Text file a literal value such as a string a Director member etc a DBF file a V12 database Aa Lingo list or Lingo property list a MS Access database through an ODBC driver Win 32 only a FoxPro file through an ODBC driver Win 32 only a MS Excel file through an ODBC driver Win 32 only aMS SQL data source through an ODBC driver Win 32 only Data type translation rules from the above ODBC compliant databases to V12 Databases vary according to the specific ODBC driver installed on your computer The general form of a table importing script is create a V12dbe instance set gDB New Xtra Vl2dbe database filename mode password CheckV12Error create a V12table instance set gTable New Xtra V12table mGetRef gDB TableName CheckV12Error import data mImport gTable InputType InputSource other params CheckV12Error free the V12table and V12dbe instances set gTable 0 set gDB 0 As for any V12table method
61. new record to the table gTable mAddRecord gTable mSetField gTable name hot dog mSetField gTable length 2 mSetField gTable price 1 95 mUpdateRecord gTable See Also mGetField mSetMedia mGetMedia mEditRecord mUpdateRecord mSetindex V12Table Syntax mSetIndex gTable indexName Parameters indexName name of the index to set as current index Description Set the index indexName as the current index A call to mSetIndex must be followed by a call to mSelect It is useless to call mSetIndex before setting search criteria as mSetCriteria selects the most appropriate index for a given query mSetIndex is seldom used It is still supported only for the purpose of backwarding compatiblity V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 180 Example select all records of the table and sort them by order of price mSetIndex gTable priceNdx mSelect gTable See Also mSelectAll mOrderBy mSetMedia V12Table Syntax mSetMedia gTable fieldName Member Parameters fieldName name of the field in which media is to be stored Member cast member from which media is retrieved Description Replace the content of the field FieldName of the current record with the cast member Member Example get the media from the cast named thePhotoCast in cast 1 and store it in the field photo of the curre
62. possible It can sort and search texts in English French Italian Dutch German Norwegian etc pes in the appendices of this manual for a detailed description of st ring s behavior V12 DBE also offers the option of defining fields of type Swedish Spanish Hebrew etc that index and sort data in a way that is compliant with these languages Appendix 16 String and Custom String Types for an exhaustive list and description of those behaviors called custom string types The Regular Edition of V12 DBE allows for the creation of custom string types having each a sort search description table defined by you Therefore you can define your own string type for any language supported by single byte characters including Klingon Everything that applies to the type string also applies to custom string types Throughout this manual the term string is used to designate both the default V12 DBE string and custom string types Selection Current Record Search Criteria The selection is the set of records currently available in the table When a table is opened the selection contains all the records of the table If you search through a table after having defined search criteria the resulting set of records that satisfy the search is the new selection When a selection is first defined the current record is the first record of that selection V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegrat
63. repeat with j 1 to n tMsBeginRegion PriceList tMsSetVariable Price mGetField gT price set totalPrice totalPrice mGetField gT price V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 144 tMsEndRegion end Repeat tMsSetVariable Total totalPrice tMsEndRegion tMsEndRegion tMsPrintReport tMsFreeReport Note that the statement that prints Total was moved to after the repeat loop PrintOMatic and V12 Database Engine First initialize PrintOMatic as you normally would and print the required titles texts tables etc A typical PrintOMatic initialization script is global doc Set doc new xtra PrintOMatic newPage doc add a new page Then if you want to print the content of a specific VI2 DBE field at the current coordinates location of PrintOMatic call V12 DBE s mGet Field method followed by PrintOMatic s append method Example set x mGetField gT FirstName append doc x FALSE If you want to print an entire selection call mGet Field in a loop mGetSelection cannot be of much help Example repeat with i 1 to mSelectCount gT set prod mGetField gT FirstName append doc prod amp RETURN FALSE end repeat If you want to compute a function e g number of items sum average product mean standard deviation etc initialize a Lingo variable and keep updating it in your loop Example to compute
64. short is the process of converting a piece of data from one type to another This is a common mechanism to most programming languages including Lingo V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 32 For example the integer 234 can be casted to the string 234 Conversely the string 3 1416 can be casted to the float 3 1416 Typecasting can be performed explicitly in Lingo using the Integer String and Float functions e String 234 returns the string 234 or automatically i e 12 amp 34 returns the string 1234 V12 DBE has the same ability as Lingo to typecast data when it is required by the context However some borderline conditions can lead to ambiguous results such as trying to store the value 123 in a field of type Integer note the leading space You must always make sure that the data supplied to V12 DBE does not contain spurious characters otherwise typecasting will not be performed properly International Support Although the 26 basic letters of the roman alphabet sort in the same order in all roman languages the position of accented characters also called mutated characters varies from one language to another For example the letter sorts as a regular a in German whereas it sorts after z in Swedish Likewise in Spanish ch sorts after cz and ll sorts after Iz V12 DBE s default string was designed to satisfy as many languages as
65. specified the retrieved data is formatted accordingly Otherwise if a formatting pattern 1s assigned to FieldName with mDataFormat that format is taken into account mGetField s dataFormat parameter overrides mDataFormat s setting Example Set name mGetField gTable theName set date mGetField gTable theDate YY MM DD See Also mDataFormat mGetSelection mGetMedia mSetField mGetMedia V12Table Syntax mGetMedia gTable fieldName Member Parameters fieldName name of the field from which media is retrieved member cast member in which media is stored V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 171 Description Replace the content of cast member Member with the media contained in the fieldName field of the current record Example get the media from field photo and store in the cast named thePhotoCast in castlib 1 mGetMedia gTable photo Member thePhotoCast or mGetMedia gTable photo member thePhotoCast of castlib 1 See Also mDataFormat mGetSelection mGetField mSetMedia mGetPosition V12Table Syntax mGet Position gTable Parameters none Description Return the position of the current record in the selection Example put mGetPosition gTable See Also mGo mGoPrevious mGoNext mGoFirst mGoLast mSelectCount mGetPropertyNames introduced with V12 3 0 Return n
66. string For example if the description field of a certain record contains the text Dark chocolate with hazelnuts mSetCriteria gTable description contains cola would locate that record chocolate contains the sub string cola whereas mSetCriteria gTable description wordStarts cola V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 98 would not This is because no word in the description field starts with the string cola Complex search criteria mSetCriteria can also be called with four parameters The additional parameter is the Boolean operator AND or OR It is added to the second call to mSetCriteria and inserted before the field to be searched Example mSetCriteria gTable name contains hat mSetCriteria gTable and price lt 50 mSelect gTable The above example selects all hats up to 50 00 in the table referred to by gTable The first call to mSetCriteria should use three parameters and it can be chained with as many four parameter calls as needed to specify your query Using mSetCriteria with three parameters will reset and ignore the preceding search criteria Another example using the Boolean OR operator is mSetCriteria gTable name contains hat mSetCriteria gTable or name contains helmet mSetCriteria gTable or name contains cap mSelect gTable It selects
67. syntax used to call it The syntax for mGet Selection to return a result of type String is mGetSelection gTable Literal From recs FieldDelimiter RecordDelimiter FieldNames The syntax for mGet Selection to return a lingo list is mGetSelection gTable List From recs FieldNames The syntax for m er Selection to return a lingo property list is mGetSelection gTable PropertyList From recs FieldNames 1 111 where e gTable is the instance of the table from which records must be retrieved mandatory parameter e From is the number of the first record to retrieve data from It is optional The default value is 1 e recs is the number of records to retrieve starting from record number From It is optional The default value is the number of records between From and the end of the selection plus 1 convenient to retrieve all the records of a selection starting from record number From e FieldDelimiter is the character to use as the field delimiter It is optional The default field delimiter is a TAB e RecordDelimiter is the character to use as the record delimiter It is optional The default field delimiter is a CARRIAGE_RETURN e FieldNames are the names of the fields to retrieve in the specified order If the field names are omitted mGetSelection returns the contents of all the fields of gTable in their order of creation Fields of type Media are ignored by mGetSel
68. table Students Of course this requires the database to be on a writeable volume find all students who took one of Mrs Crabtree s tests and list their last names in alphabetic order without duplicates first locate all Tests authored by Mrs Crabtree mSetCriteria gTests Author Crabtree mSelect gTests put EMPTY into field result loop through each test created by Mrs Crabtree repeat with i 1 to mSelectCount gTests mGo gTests i set tID mGetField gTests ID mSetCriteria gTScores testID tID mSelect gTScores loop through student IDs and retrieve name repeat with j 1 to mSelectCount gTScores mGo gTScores j set sID mGetField gTScores StudentID mSetCriteria gTstudents ID mSelect gTstudents mark the found record mEditRecord gTstudents mSetField gTstudents Marker 1 mUpdateRecord gTstudents end repeat end repeat once all records are marked select them all mSetCriteria gTstudents Marker 1 mOrderBy gTstudents LastName mSelect gTstudents put mGetField gTstudents literal into field results DO NOT forget to restore Markers to 0 to prepare for next search In the above example this modified script would yield the result Broslowsky Cartman McCormick V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 154 Appendix 14 Modifying a Database Structure On
69. the average price of all the products in a selection set n mSelectCount gT set total 0 repeat with i 1 ton set prc mGetField gT price append doc prc amp RETURN FALSE set total total prc end repeat append doc Total amp total amp REUTRN FALSE append doc Average amp total n amp REUTRN FALSE To print multiple columns with PrintOMatic you must first create frames in your document For example to print a list of products along with their corresponding prices prices must obviously right adjust you would write a script similar to the following on PrintProdAndPrice set doc new xtra PrintOMatic newPage doc add a new page products frame is 200 pixels wide 600 pixels tall newFrame doc Rect 0 0 200 600 FALSE repeat with i 1 to mSelectCount gT mGo gT i set prod mGetField gT prodName append doc prod amp RETURN FALSE end repeat prices frame is 50 pixels wide 600 pixels tall V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 145 newFrame doc Rect 200 0 250 600 setTextJust doc right right align column repeat with i 1 to to mSelectCount gT mGo gT i Set price mGetField gT prodName append doc price amp RETURN FALSE end repeat printPreview doc or to print print doc set doc 0 end PrintProdAndPrice It is very convenient with PrintOMatic to first preview your
70. the database Xtra s i e Xtra V12dbe s methods to write an automated database creation script in Lingo V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 36 Step A Importing data into a V12 DBE database Use the V12 DBE Tool to import the Text or DBF file exported at Step 2 Alternatively you can write Lingo scripts to automate the process of importing data into your V12 DBE databases Step 5 Implementing the user interface This step consists of the development of data search retrieval and modification routines at runtime either as Behaviors attached to the various Director sprites or as Lingo handlers in Director script members Sample movies provided in the V12 DBE package or on Integration New Media s web site http www integration qc ca can be used to inspire the development of your projects Each of the aforementioned steps is discussed in subsequent sections Since V12 DBE offers more than one way to attain a goal the simplest approach is explained first then alternate and more powerful or versatile approaches are discussed V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 37 Step 1 Deciding on a Data Model Before creating a database file you need to decide how you want to organize your data If your original data is managed in FileMaker Pro MS Access or a similar database management pro
71. with strings 75 Cream lt olored ponies 87 Crisp apple strudels 92 Doorbellsandslighbells _____________ The table is currently sorted by order of Preference using that field s index and the current record is the first record 27 Raindrop on roses Any modification to the Thing field does not affect the order of the selection However modifying the Preference field would automatically cause the table to be resorted with respect to the current index s sort order For example modifying the value 27 above for 90 would instantly update the selection to the following order with the current record pointing to the 7 record Whiskers on kittens 50 Bright copper ketles 54 Warm woolen mittens s Round paper packages tied up with strings Cream colored ponies Crisp apple strudels Schnitzels with noodles Wild geese that fly with the moon on their wings Door bells and sleigh bells This repositioning occurs right after calling mUpdateRecord V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 134 This behavior may seem even stranger when the V12 DBE Behaviors are used In that case if the current record is 1 the value 27 is changed to 90 and the user clicks on the Next button theoretically to view record 2 35 Whiskers on kittens the record 50 Bright copper kettles is displayed This is because the mGoNext met
72. 0 4580 4590 4591 4600 Invalid table name Invalid field name Invalid field type Invalid buffer size Table s does not exist Database structure not created properly Field s already exists in table s Unable to create new field Call mEditDBstructure and mCreateTable before creating new fields Empty table name Empty field name Invalid buffer size Buffer Size must be greater than zero Buffer size not required for fields of type s Unable to use Sei as a field name This is a reserved word Invalid index type Valid index types are indexed and full indexed Unable to edit structure of table s Table already built Unable to edit database Structure Open database in Create or ReadWrite mode Field s of table s contains invalid characters First character of field s in table s must be alphabetic Field s of table s has an invalid identifier length Valid identifiers have at most 32 characters Field s of table s cannot be indexed It must have at most 29 characters to be indexed Cannot create field s The maximum number of field s is ld Wrong number of parameters Table s does not exist Field s does not exist in table s Database structure not created properly Invalid table name Invalid field name Invalid index name Invalid index type Valid types are Duplicate and Unique Invalid index order Valid orders are Ascending and Descending
73. 12 DBE methods alphabetical NOTE Appendix 19 IS NOT UPDATED FOR VERSION 3 YET mAddRecord V12Table Syntax mAddRecord gTable Parameters none Description Adds a new record to the table and sets it as the current record Calls to mAddRecord are generally followed by calls to mSetField and must end with a call to mUpdateRecord Example add a record to gTable put data in fields name and price and updates the record mAddRecord gTable mSetField gTable field1l string funnel mSetField gTable field2 float 2 95 mUpdateRecord gTable See Also mEditRecord mSetField mUpdateRecord mBuild V12dbe Syntax mBuild gDB Parameters none Description Create the database structure defined by mReadDBstructure and writes it to a disk file After successfully calling mBuild the database remains open in Read Write mode Data can be immediately imported to it Example Reads the database definition contained in a text file set gDB New Xtra V12dbe myBase Create very secret password mReadDBStructure gDB the pathname amp DatabaseDef txt set mBuild gDB See Also new mReadDBstructure V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 168 mCustom V12dbe Syntax mCustom gDB Parameters none Description Undocumented generic method for project specific implementations Contact Int
74. 16 When ErrorLog is on the error log and status code can be explicitly cleared by calling the global function V12ErrorReset Resetting the ErrorLog property to on or off also clears the error log and status code When ErrorLog is on the maximum number of messages allowed for logging can be adjusted with the MaxLoggedErrors property Avoid setting both the Verbose and the ErrorLog properties to on at the same time otherwise Director s Message Window will be quickly loaded with lengthy error logs at every call to V12 DBE MaxLoggedErrors Read write persistent Valid values any integer between 1 and 1000 Default value 32 When the ErrorLog property is set to on the maximum number of messages that can be cumulated can be set with the MaxLoggedErrors property Syntax mSet Property database instance MaxLoggedErrors Max As V12 DBE s methods are called error messages cumulate in an error log and can be retrieved at any time with the V12Error function The V12 DBE error log and status code can be explicitly cleared by calling the global function V12ErrorReset Example mSetProperty gDB MaxLoggedErrors 100 The above example sets the maximum number of messages allowed for cumulation to 100 Note that the last parameter is 100 a string not 100 an integer SharedRWcount Read only non persistent Returns the number of users currently using the database in Shared ReadWrite mode Example se
75. 1s often referred to as Opening a Database and Opening a Table Disposing the Xtra instances is often referred to as Closing the Database and Closing the Table instances V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 72 Opening and Closing Databases and Tables Opening an Existing Database Use the New Xtra V12dbe method to open an existing V12 database If your V12 database is not created yet see Btep 3 Creating a Database o learn how to create t Syntax set gDB New Xtra Vl2dbe database filename mode password Opening a database means creating a V12dbe Xtra instance with the following parameters e database Filename the name if the database file This is usually a filename preceded by the lingo function the pathname amp to indicate that the file is located in the same folder as the current movie see Dealing with n Using Xtras e mode the mode in which the Xtra instance is opened To allow for modifications to the database open it in Shared ReadWrite or ReadWrite mode If you open your database in Shared ReadWrite mode up to 128 users can access your database simultaneously see Access If you open it in ReadWrite mode only one user at a time can access your database If you do not allow modifications to your database open it in ReadOnly mode e password the password If you do not use the correct password the database
76. 2 Toyon Court San Mateo CA 94403 349 5353 Rocco amp Co 526 2342 Brown Charles 30 Saxony Ave San Francisco CA 94115 421 9963 National Laundry 982 9400 Pintado Jack 22 Hoover Ave Bowie MD 20712 731 5134 Rocco amp Co 526 2342 Van Damme Lucie 87 Main St Richmond VA 23233 315 3545 Presto Cleaning 751 5290 Peppermint Patty 127 Big St Lebanon MO 92023 462 6267 Presto Cleaning 751 5290 However adding this information might lead to the duplicate of information given that some people might be working for the same company To prevent duplication and to save on disk space and time required to update you could create a new table containing only the business information For example the new table could be called Companies Each record of that new table would have a unique ID number Company Ref that would also be used in the first table The database now contains two related tables each having a field containing the common information named Company Ref Table 1 containing information about the each person Last Name First Name Address City State Zip Phone Company Ref Jordan Ann 6772 Toyon Court San Mateo CA 94403 349 5353 RO Brown Charles 30 Saxony Ave San Francisco CA 94115 421 9963 NA Pintado Jack 22 Hoover Ave Bowie MD 20712 731 5134 RO Van Damme Lucie 87 Main St Richmond VA 23233 315 3545 PR Peppermint Patty 127 Big St Lebanon MO 92023 462 6267 PR Table 2 containing information about the companies Company ref Company Phone
77. 214 6 252 0 63 3 101 e 139 177 215 x 253 64 Q 102 f 140 178 216 254 b 65 A 103 g 141 179 3 217 255 y 66 B 104 h 142 180 218 0 67 C 105 i 143 181 p 219 0 68 D 106 j 144 182 q 220 0 69 E 107 k 145 183 221 Y V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 164 Mac Standard Character Get If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version 32 70 F 108 I 146 184 pb 222 33 71 G 109 m 147 i 185 p 223 34 x 72 H 110 n 148 186 224 Tt 35 73 l 111 o 149 187 225 gt 36 74 J 112 p 150 188 226 37 75 K 113 q 151 189 227 38 amp 76 L 114 r 152 190 228 o 39 s 77 M 115 s 153 191 o 229 A 40 78 N 116 t 154 6 192 4 230 41 79 O 117 u 155 6 193 i 231 42 A 80 P 118 v 156 194 232 43 81 Q 119 w 157 195 233 44 82 R 120 x 158 196 f 234 45 83 S 121 y 159 197 235 46 84 T 122 z 160 t 198 236 47 I 85 U 123 161 d 199 237 48 0 86 V 124 162 200 238 49 1 87 Ww 125 163 201 239 50 2 88 X 126 164 202 240 51 9 89 Y 127 165 203 241 52 4 90 Z 128 166 T 204 A 242 53 5 91 129 A 167 BR 205 6 243 54 6 92 130 C 168 206 E 244 55 7 93 131 E 169 207 245 56 8 94 132 N 170 7 208 246 57 9 95 133 O 171 d 209 247 58 96 134 172
78. 5 99 page 143 File Edit View Add Style Align Code Options Help DAA 3 IRA MainRegion TEXTI Bg a ProductColumn Your Order is S ProductList ProductName Price g ProductName B a PriceColumn a TEXT2 g Total S PriceList Price T TOTAL Total In mPrint Designer choose Code gt Generate gt Director Lingo You obtain the following script tMsRegisterMPrint mp xxxxxxxxxx tMsCreateReport the pathname amp TwoCols mpf tMsBeginRegion MainRegion tMsBeginRegion ProductColumn repeat with i 1 to loop count tMsBeginRegion ProductList tMsSetVariable ProductName value tMsEndRegion end Repeat tMsEndRegion tMsBeginRegion PriceColumn tMsSetVariable Total value repeat with j 1 to loop count tMsBeginRegion PriceList tMsSetVariable Price value tMsEndRegion end Repeat tMsEndRegion tMsEndRegion tMsPrintReport tMsFreeReport Change this script to obtain the following changes are in bold set n mGetSelection gT set totalPrice 0 local var to sum up product prices tMsRegisterMPrint mp xxxxxxxxxx tMsCreateReport the pathname amp TwoCols mpf tMsBeginRegion MainRegion tMsBeginRegion ProductColumn repeat with i 1 to n tMsBeginRegion ProductList mGo gT i tMsSetVariable ProductName mGetField gT pName tMsEndRegion end Repeat tMsEndRegion tMsBeginRegion PriceColumn
79. 50 is returned by mGet Field Note that the result of a formatted value is always a string Data formatting applies to mGet Field the same way it does to mDataFormat If two distinct formatting patterns are applied to a field with the mGetField option and mDataFormat the mGet Field option overrides mDataFormat See Data Formatting for a complete explanation on formatting patterns Note mGetField retrieves only unformatted text If you store styled text to a V12 record you can retrieve the text without the styles with mGetField and the styled text with mGetMedia See Managing Styled Text V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 78 Reading one or more Entire Records mGetSelection allows for the retrieval of one or more fields in one or more records of the selection The result is one of the followings e a string where fields are delimited by TABs and records by CARRIAGE RETURNS the default delimiters or by any other custom delimiters you specify e a Lingo list of lists where each sub list represents a record and each item of each sub list is the data contained in the corresponding field e a Lingo list of property lists where each sub list represents a record and each item is a property value pair the property is the name of the field and the value is the data contained in it mGetSelection is powerful and flexible It s behavior depends on the
80. 530 1810 1820 1830 1840 1841 1850 1860 1870 1880 1890 Unable to read structure from database Structure not initialized properly Corrupted DBF file Field does not exist Please contact tech support Cannot modify table Invalid database structure Please contact tech support Invalid identifier Cannot create text file Maybe the file already exists Cannot create DBF file Maybe the file already exists Cannot create DBT file Maybe the file already exists Field does not exist Invalid field data Please contact tech support Invalid field type Invalid field size in table No table defined Unable to set password Duplicate key Unable to create or modify a database on a locked file volume Database not initialized properly Please contact tech support Unable to pack database File name already exists Table already in use Set all instances of a table to zero MOA error in V12 DBE Please contact Tech Support Cannot set a void value Cannot bind multiple fields with the same member name Item not found in table Please contact tech support Current record locked by other user Cannot open database This database structure is not supported by the current version of V12 Low level engine not initialized Wrong number of parameters Invalid file name Invalid open mode Valid modes are Create ReadWrite ReadOnly and Clone s is an invalid open m
81. 68 A 206 244 d 55 7 93 131 169 e 207 n 245 8 56 8 94 132 170 a 208 246 57 9 95 133 A 171 209 247 58 96 134 A 172 Va 210 248 59 97 a 135 e 173 i 211 249 60 lt 98 b 136 174 212 E 250 gt 61 99 c 137 175 213 i 251 1 62 gt 100 d 138 176 _ 214 252 63 3 101 e 139 177 _ 215 253 6 amp 4 102 f 140 178 _ 216 254 _ 65 A 103 g 141 i 179 217 255 66 B 104 h 142 180 218 67 C 105 i 143 A 181 219 _ 68 D 106 j 144 182 A 220 _ 69 E 107 k 145 183 A 221 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 166 Appendix 18 V12 DBE methods by category Appendix 18 IS NOT UPDATED FOR VERSION YET Note Database structuring methods require a V12 DBE license to be present Initialization Retrieving Data Browsing through Data SelectCount_ V12Table Searching and Sorting Importing Data Error Management 12Error Global 12status Global Database Structures ReadDBStructure V12dbe Build V12dbe DumpStructure V12dbe Database Utilities GetProperty V12dbe SetProperty V12dbe SetPassword V12dbe Special Methods Custom V12dbe Custom V12Table V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 167 Appendix 19 V
82. 7 210 248 59 H 97 a 135 a 173 211 gt 249 60 lt 98 b 136 a 174 ZE 212 f 250 61 99 c 137 a 175 213 251 4 62 gt 100 d 138 a 176 214 252 63 101 e 139 a 177 Tt 215 x 253 2 64 102 f 140 A 178 216 y 254 65 A 103 g 141 179 217 Y 255 66 B 104 h 142 180 X 218 67 C 105 i 143 e 181 pn 219 u 68 D 106 j 144 182 6 220 69 E 107 k 145 183 221 gt V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 165 MS DOS Character Get If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version 32 70 F 108 1 146 184 222 33 71 G 109 m 147 185 223 _ 34 72 H 110 n 148 186 224 35 73 I 111 o 149 187 225 8 36 74 J 112 p 150 188 220 37 75 K 113 q 151 189 227 38 amp 76 L 114 r 152 jy 190 X 228 6 39 77 M 115 s 153 191 229 40 78 N 116 t 154 192 230 p 41 79 o 117 u 155 o 193 234 p 42 80 P 118 v 156 194 232 b 43 81 Q 119 w 157 195 233 0 44 82 R 120 x 158 x 196 234 45 83 S 121 y 159 f 197 235 0 46 84 T 122 z 160 a 198 a 236 47 I 85 U 123 161 199 A 237 48 0 86 V 124 162 6 200 2388 49 1 87 Ww 125 163 201 239 50 2 88 X 126 164 202 240 51 3 89 Y 127 165 203 241 52 A 90 Z 128 166 2 204 242 _ 53 5 91 129 167 205 243 54 6 92 130 1
83. 7 Easy Lessons In this example looking for the word Soup in the Publication Title field requires a full index for optimal search performance If no index is defined on the Publication Title field the same result can be achieved but with a slower performance If a regular index is defined on the Publication Title field publications that start with the word Soup can be quickly located but publications that contain that word require more time Full indexes apply only to fields of type string including those which contain styled text see Field Types International Support pnd Managing Styled Text Each index takes up disk space so it is not recommended that all fields be indexed Full indexes require much more space than regular indexes Indexed fields should be limited to those likely to be searched and sorted most often For optimal full text search efficiency some level of control is required on the way it is performed For example indexing trivial words such as and or the etc or equivalent words that appear frequently in your application s language is useless as most records would contain one or more occurrences of those words Likewise some applications or languages require that digits be full indexed whereas others would prefer to ignore them V12 DBE enables you to fine tune the behavior of the full indexes by allowing for the definition of Stop Words words that must be ignored Delimiters characters that del
84. 9 20 9401 Floppies 1 89 1743 Labels 1 19 6251 Pencils 5 55 1431 Ruler 1 99 7519 Tags 6 19 The syntax for the Property List result would be set x mGetSelection gTable PropertyList 1 mSelectCount gTable number name price and the result would be number 6780 name Batteries price 9 20 number 9401 name Floppies price 1 89 number 1743 name Labels price 1 19 number 6251 name Pencils price 5 55 number 1431 name Ruler price 1 99 number 7519 name Tags price 6 19 Although this latter request would not be of much interest because property lists are parsed by property names not item positions Reading Unique Values of a Field mGetUnique returns unique values of the Master Field in a string or a Lingo list See Selection and Current Record above for a definition of Master Field Syntax set a mGetUnique gTable literal set b mGetUnique gTable list mGetUnique is very convenient to populate a user interface element such as scrolling list or pull down menu with search values that are relevant only for a specific database and context Example In a clothing catalog you want to display only the available colors for a specific category and size of product e g T shirt and XXL You run the following script mSetCriteria gTable category T shirt mSetCriteria gTable and size XXL mOrderB
85. 9 page 136 mSelect gT1 on gT2 mSetCriteria gT2 ingredient WordEquals celery mSetCriteria gT2 OR ingredient WordEquals eggplant mOrderBy gT2 RecipeID sort by the same field as gT1 above mSelect gT2 You end up with gT1 and gT2 referencing two separate selections both ordered by RecipeID You can run a small Lingo loop to intersect them set field result EMPTY Dir member Can also be a Lingo list repeat while not V12Error by Next on last rec of gT1 or gT2 set sl mGetField gT1 RecipeID set s2 mGetField gT2 RecipeID if sl s2 then put mGetField gT1 RecipeName amp RETURN after field result mGoNext gT1 mGoNext gT2 else if s1 lt s2 then mGoNext gT1 else mGoNext gT2 end if end repeat This Lingo loop performs an AND intersection between two selections It can easily be modified to perform an OR union If you need to run your query with 3 4 5 sets of criteria just modify the above Lingo loop to operate on 3 4 5 V12table instances Workaround 2 Marking Records This technique may be faster 1f the number of records satisfying the search criteria is large but it works only if your database is on a writeable volume ie not on CD ROM In this case you work with a single gTab1e instance In your database structure for that table define an additional indexed field of type Integer named Marker Initially this field contains Os
86. A aA 60 V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 160 Searching and Sorting rules for Strings of Type Spanish If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version CG E 40 2 2 Han 41 3 3 j 42 4 4 cu 43 5 5 44 6 6 45 7 T 46 8 Hi ct 47 9 9r ou 48 a AA 0 49 b B 1 50 c C 2 51 d D 3 52 e EE E E 4 X 53 fF 5 o 54 gG 6 55 hH 7 56 iiiiilliii 8 t 57 j J 9 58 kK 20 59 IL 21 O 60 mM 22 lt gt 61 nN 23 62 aN 24 63 o ce O 0 25 64 pP 26 65 qQ 27 A 66 rR 28 67 sBS 29 68 t T 30 5 69 u U 31 70 vV 32 u 7l wW 33 amp 7 x X 34 73 yy Y Y 35 74 zZ 36 f 75 37 76 38 0 77 39 1 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 161 Searching and Sorting rules for Strings of Type Hebrew If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version requires a hebrew font such as Web Hebrew 400 ay Pi LE e e f l 4 GA GA OLED aleph beth ghimel daleth he vau zain heth teth i
87. ASSEMBLE OR OTHERWISE REDUCE THE SOFTWARE TO ANY HUMAN PERCEIVABLE FORM YOU MAY NOT MODIFY ADAPT TRANSLATE RENT LEASE LOAN OR CREATE DERIVATIVE WORKS BASED UPON THE SOFTWARE OR ANY PART THEREOF 3 Copyright notices You may not alter or change Integration s copyright notices as contained in V12 DBE You must include a a copyright notice in direct proximity to your own copyright notice in substantially the following form Portions of code are Copyright c 1995 99 Integration New Media Inc and b place the Powered by V12 logo on the packaging of your Products or c place the Powered by V12 logo within your Products in the credits section 4 Acceptance V12 DBE shall be deemed accepted by you upon delivery unless you provide Integration within two 2 weeks therein with a written description of any bona fide defects in material or workmanship 5 Termination This Agreement is effective until terminated This Agreement will terminate immediately without notice from Integration or judicial resolution if you fail to comply with any provision of this Agreement Upon such termination you must destroy the Software all accompanying written materials and all copies thereof and Sections 7 and 8 will survive any termination 6 Limited Warranty Integration warrants for a period of ninety 90 days from your date of purchase as evidenced by a copy of your receipt that the media on which the Software is recorded will be free from d
88. By mSelectAll V12Table Syntax mSelectAll gTable Parameters none Description Select all the records of a table The sorting order for the selection is the same as the most recently chosen index unless it is preceded by mOrderby That index is either explicitely chosen by you mSetIndex or automatically chosen by mSetCriteria and or mOrderBy Example mOrderby gT price mSelectAll gTable See Also mOrderby V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 178 mSelectCount V12Table Syntax mSelectCount gTable Parameters none Description Return the number of records in the selection If the selection is empty this method returns 0 Example put mSelectCount gTable into field TotalHits See Also mGetPosition mSetCriteria V12Table Syntax mSetCriteria gTable boolOp fieldName operator value Parameters boolOp and or fieldName fieldin which value must be searched Operator lt gt lt gt lt gt starts contains wordEquals wordStarts value is value to look for Description Specify a search criteria A call or sequence of calls to mSetCriteria must be followed by a call to mSelect to trigger the search process If more than one criterion is used subsequent criteria must use the boolean operator and or or Example find
89. D OR String Integer Float Date or Media are not suitable for use as identifiers When indexing fields of type String up to the 200 first characters of each string are actually entered in the index The remaining characters are ignored Full indexes are built with words not exceeding 31 characters Words longer than 31 characters are truncated to 31 characters for the purpose of indexing this does not affect the actual data New database structures cannot be created at runtime without the presence of a V12 DBE license file actually they can but they will be non licensed V12 databases They can only be cloned from existing databases V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 127 Appendix 4 Multi user Access V12 DBE allows for multi user access to its databases This means that a V12 DBE file can be shared by many users provided the V12 DBE file is available to them on a mounted volume An icon on the desktop represents a mounted volume on the Macintosh computer You can mount such a volume by selecting it in the Chooser in the Apple menu On windows 9x NT a mounted volume is either a volume that is mapped to a drive letter or a volume or partition accessible in the Network Neighborhood On Windows 3 1 a mounted volume is a network drive Opening a file in Shared ReadWrite Mode To open a V12 database in a multi user environment create a
90. DBF file mReadDBstructure detects its presence and automatically defines an index for that field in the current table V12 DBE does not check the validity of that index therefore you can fool it to create an index for a field named MyField by creating an empty file named MyField IDX in the same folder as your DBF file The following rules apply to the translation of DBF file structures DBF Translated to field type V12 field type Notes Buffer size size of field in Character String DBF file Integer Integer Numeric with no digit after fixed Integer point Numeric with one or more digits Float after fixed point Float Float Double Float On Windows 3 1 and Mac68K Currency Float acceptable values are in the range 2 to 2 1 where k 31 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 52 minus the number of decimal places Date Date Data cannot be converted from fields of type DateTime Only Perque Date the default date 1900 01 01 is imported FALSE values are translated to Logical itere Os TRUE values to s and OEC eg undefined values represented by in the DBF file to s Media String Buffer size 32K General Ignored Character Binary Ignored Memo Binary Ignored Memo fields are those typically used to store text longer than 255 characters Memo fields c
91. Data displayed in the bound members comply to the formatting pattern supplied to mDataFormat if such a pattern is specified At any given time a maximum of one field can be bound to a Director member However a single field can be bound to several members and they can all display the bound field s content from the current record This may lead to ambiguous results if two or more of these members are edited and need to be saved in the associated field When updating such data V12 DBE always gives precedence to the last bound member Ifa V12 DBE field of type string is bound to a Director member of another type the type of the Director field is forced to the type imposed by the binding that is string its contents will be replaced Fields of all types can be bound to Director members including fields of type Media If a V12 DBE field is bound to a member such as a check box or radio button the member is checked if the field contains a non zero value It is not necessary to call mUnBindField before you free a table setting its instance to zero Once free all bindings pertaining to the fields of a table are automatically revoked V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 90 Binding Types V12 DBE offers the possibility of controlling when the binding features are applied i e refreshing the screen and updating the database information It is defined as ei
92. Inc 1995 1999 Please check the on line help in the Xtras V12 DBE menu new object me string databasename string openmode mBuild object me mCloneDatabase object me string databasename mCreateField object me string tablename string fieldname mCreateFullIndex object me string tablename string fieldname mCreateIndex object me string tablename string indexname string isunique string fieldname string order mCreateTable object me string tablename mCustom object me mDeleteTable object me string tablename mDumpStructure object me mEditDBStructure object me mError object xtraRef mFixDatabase object xtraRef string databasename string newdatabasename mGetPropertyNames object me mGetProperty object me string property mGetRef object me mPackDatabase object me string newdatabasename mReadDBStructure object me string inputtype string source mRenameField object me string tablename string oldfieldname string newfieldname mSetPassword object me string oldpassword string newpassword mSetProperty object me string property string value mStatus object xtraRef mUpdateDBStructure object me VIZ2Error V12ErrorReset Vi12Status mXtraVersion object xtraRef Methods that expect a fixed number of parameters are those for which each parameter is listed Methods that accept a variable number of parameters are those followed by a Following are a few explanations mE
93. M SOLD Integer INDEXES TitleNdx duplicate TITLE ascending Default Index TypeNdx duplicate TYPE ascending END mReadDBStructure reads the structure of a DBF file not its content To import the content of a DBF file see Importing from a DBF File mReadDBstructure from V12 DBE Any V12 DBE database can be used as a template for the creation of a new V12 DBE database provided you know the password to unlock it The syntax is as follows mReadDBStructure gDB V12 FileName Password The following example uses the database Catalog V12 as a template for a new database named Specials V 12 on CreateDatabase set gDB New Xtra V12dbe the pathname amp Specials V12 Create MyNewPassword CheckV12Error mReadDBStructure gDB V12 the pathname amp Catalog V12 top secret CheckV12Error mBuild gDB CheckV12Error set gDB 0 end CreateDatabase mReadDBStructure reads the structure of a V12 DBE file not its content To import the content of a V12 DBE file see mporting from V12 DBE and Adding Records to a mReadDBstructure from FoxPro Win 32 Only A FoxPro database is a directory containing a collection of DBF files along with their index files A directory containing one or more MS FoxPro files can be collectively used as a database template to a V12 database The FoxPro ODBC driver is required to perform this operation The names of your FoxPro files and their field names must be valid V2 DBE i
94. Mrs Crabtree we would run the following script find all students who took one of Mrs Crabtree s tests first locate all Tests authored by Mrs Crabtree mSetCriteria gTests Author Crabtree mSelect gTests put EMPTY into field result loop through each test created by Mrs Crabtree repeat with i 1 to mSelectCount gTests mGo gTests i set tID mGetField gTests ID mSetCriteria gTScores testID tID mSelect gTScores loop through student IDs and retrieve name repeat with j 1 to mSelectCount gTScores mGo gTScores j mSetCriteria gTstudents ID z mSelect gTstudents put mGetField gTStudents LastName amp RETURN after field result end repeat end repeat For example assuming that Mrs Crabtree is the author of both the Trigonometry and the Rocket Science courses running this script on the above example would yield the following result Cartman Broslowsky V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 153 McCormick Broslowsky A shortcoming of this script is it s inability to sort the results or to remove duplicates from the results A possible work around this limitation consists in creating an additional field named Marker in table Students and instead of immediately listing all last names in field result setting the Marker field of found records to 1 At the end just find all marked records in
95. NA National Laundry 982 9400 PR Presto Cleaning 751 5290 RO Rocco amp Co 526 2342 The two databases could also be compared as follows Flat database with one table Relational database with two tables TTT TTT EEDPEFLELE T TIT CCC SS l Sl a ege Table with 9 fields Table 1 with 8 fields with 3 fields The relational database is smaller because it avoids useless data duplication In order to retrieve full information about any given individual in your address book you would perform a search in your first table retrieve the company reference and then perform a search in the second table The flat model may be easier to manage when retrieving data given that only one search is required however it tends to consume valuable disk space V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 31 Relational Database Management Systems RDBMS are usually programmed with SQL System Query Language which has the ability to automatically resolve relations between related tables Although V12 Database Engine can store multiple tables per database it relies on Lingo scripts to resolve relations It cannot automatically such resolve relations Field Types For optimal data sorting and searching you can specify the kind of information to be stored in each field In V12 DBE fields can be designated to contain strings integers floating point numbers date
96. S Excel file structures to V12 databases MS Excel Translated to Notes field type V12 field type General Float Number Float Currency Integer Accounting Integer Convert to text first if importing Dae ignored to V12 DBE is needed i Convert to text first if importing Tie Ignored to V12 DBE is needed Percentage Float Fraction Float Scientific Float Text String Buffer size 255 bytes Special Float V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 57 Custom Float MS Excel cannot define indexes on its fields when reading an Excel workbook V12 DBE automatically indexes the leftmost field of each worksheet Syntax mReadDBStructure gDB Excel FileName where FileName is the path to the XLS file mReadDBStructure reads the structure of a MS Excel database not its content To import the content of a database see mporting from MS Excel Win 32 only mReadDBstructure from MS SQL Server Win 32 Only A MS SQL Server version 6 or 7 data source can be used as a template to a V12 database In contrast to MS Acces MS FoxPro and MS Excel files mReadDBstructure requires a DSN Data Source Name to be supplied instead of a pathname The MS SQL Server ODBC driver is required to perform this operation The following rules apply to the translation of MS SQL Server data sources to V12 databases A
97. T deliver the license file V12 30 LIC which is in the System Preferences folder of your Macintosh or the Windows System folder of your PC Note Although V12 DBE works fine with Shockwave movies you cannot have it automatically downloaded via the net from a Shockwave movie Testing for end users It is always a good idea to thoroughly test the product before delivering it to the end user Tests must be performed on computers with configurations very similar to those of end users However if you need to perform end user tests on the computer that contains the V12 DBE license you can reproduce an end user environment by proceeding as follows e Make sure Director or a Director Projector is not running e Open the System Preferences folder of your Macintosh or the Windows System folder of your PC e Move the V12 LIC file out of that folder to the destination of your choice except of course the trash can or the recycle bin e Open your project either with a Projector or Macromedia Director and perform the tests e Once the tests are completed close the Projector or Macromedia Director and put the license file back in its original folder Note DO NOT attempt to rename or tamper with the license file If you do you may need to re register V12 DBE V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 132 Appendix 7 Portability Issues Some files a
98. That process must be terminated by a call to mBuild If openMode is readOnly data can be read but not be written to the database If openMode is readWrite data can be read and written to the database Example create a new database named myBase and lock it with password very secret set gDB New Xtra V12dbe myBase Create very secret open an existing database file named myBase in Read Only mode i e the database cannot be modified set gDB New Xtra Vl12dbe myBase ReadOnly very secret open an existing database FirstDB v12 and clone it in the directory of the current movie set gDB1 New Xtra V12dbe KrazyCD DataFiles FirstDB v12 ReadOnly top secret new V12Table Syntax new Xtra V1l2table mGetRef gDB tableName Parameters gDB reference to the database object that contains tableName tableName name of table to open Description Create a table Xtra instance and opens the table tableName new returns a reference to that Xtra instance which is normally assigned to a global variable for later reference Example set gDB New Xtra Vl2dbe myBase ReadOnly Exclusive very secret set gTable New Xtra V12dbe gDB MegaTable See Also new v12dbe V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 183 V12Error Global Syntax V12Error Para
99. TimeToPrepare lt 30 mSetCriteria gT AND DishType soup mSetCriteria gT OR DishType appetizer mSelect gT which finds all soups that require less than 30 minutes of preparation time and all appetizers regardless of the time required to prepare them Thus the order in which criteria are expressed to V12 DBE is important However V12 DBE cannot handle four criteria or more with alternating ANDs and ORs For example the query Dish is soup or appetizer and Main Ingredient is celery or eggplant cannot be directly expressed to V12 DBE Following are three techniques to workaround this limitation Many others can be easily derived from those techniques but they all require some Lingo programming Workaround 1 Merging Selections This technique requires to act on two V12table instances of the same table and to merge the resulting selections Define a separate table instance of the same V12 table for each set of query your are performing For example Set gT1 new Xtra vl2Table mgetRef gBD Recipes set gT2 new Xtra vl12Table mgetRef gBD Recipes Run your segments of query on each table instance first on gT1 mSetCriteria gT1 DishType soup mSetCriteria gT1 OR DishType appetizer mOrderBy gT1 RecipeID sort by a uniquely indexed field V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 9
100. User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 147 Further assume that Field2 contains a lot of duplicate values the sub sorting order of the duplicate records would be determined by the chosen index s second segment or the order in which records are input if the chosen index is not compound As a result you can control the sorting order of your selection without calling mOrderBy Example consider the following address book table TABLE Addresses FIELDS LastName string FirstName string YearOfBirth integer INDEXES LastNameNdx duplicate LastName ascending FirstNameNdx duplicate FirstName ascending The following query uses the index LastNameN x It delivers a selection sorted by LastName and then by order of input Since all the last names in the selection would be identical Smith the selection s sorting order would be the order in which records were added to the database mSetCriteria gT LastName Smith mSelect gT If you need to sort all the Smiths in your table by order of First Name run the following script mSetCriteria gT LastName Smith mOrderBy gT FirstName mSelect gT You can optimize this script by slightly modifying your database structure as follows TABLE Addresses FIELDS LastName string FirstName string YearOfBirth integer INDEXES LastNameNdx duplicate LastName ascending FirstName ascending FirstNameNdx duplicate
101. V12 DBE database structure is stored in a text file or Director member called the database descriptor in the following format TABLE NameOfTable FIELDS FieldNamel FieldTypel IndexTypel FieldName2 FieldType2 IndexType2 FieldName3 FieldType3 BufferSize3 IndexType3 etc END The TABLE tag is be followed by one parameter the name of the table This is an identifier see Defining Identifiers The FIELDS tag is followed by as many lines as you need to define fields in the above defined table The syntax of each line is as follows see Database Basics for a thorough explanation of these concepts e FieldName the name given to the field to be created This is an identifier see Defining Identifiers V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 45 e FieldType string integer float date media or a custom string type see Field Types e BufferSize the amount of RAM to allocate for the internal management of the field s content This parameter is relevant only for fields of type string and media If omitted fields of type string are created with a default buffer size of 255 characters and fields of type media are created with a default buffer size of 64K See Field Buffer Size in Step 2 Preparing the Data e IndexType the word indexed if the field must be indexed or the word full indexed if the field must be full indexed or nothing if
102. You can view the structure of a database with mbumpStructure Syntax mDumpStructure gDB Example put mDumpStructure gDB into field myDBstructure The above example places the structure of the database referred by gDB in the member named myDBstructure Structure of file HardDisk myDatabase V12 created on Thu Apr 29 15 55 07 1999 last modified on Tue May 11 15 31 53 1999 file format version V12 3 0 0 Multi User TABLE Articles FIELDS name string 256 category string 256 price Float catalognumber Integer description string 600 INDEXES nameNdx duplicate name ascending Default index categoryNdx duplicate category ascending priceNdx duplicate price ascending cat Ndx unique catalognumber ascending catNameNdx duplicate category ascending name descending FULL INDEXES description END V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 60 Note that the date hour of the last modification mentioned in the header of the above output is provided by the Operating System Therefore it reflects the date hour at which the V12 database was closed regardless of when the modification occurred This output is fully compatible with the database descriptors discussed in Database Descriptors and thus can be used as is with mReadDBstructure V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration
103. a Unable to edit record Database must be opened in ReadWrite mode Selection empty No current record Cannot write data Call mEditRecord first Duplicate key s Check the following field s Ss Unable to delete record Database must be opened in ReadWrite mode Selection empty No current record Wrong number of parameters Cast s does not exist Cast ld does not exist Cast member s does not exist Cast member 1d does not exist Invalid member identifier Wrong number of parameters Field s is not bound Call mBindField first Cast s does not exist Cast 1d does not exist Cast member Se 1d does not exist Field s does not exist Wrong number of parameters Invalid member identifier Wrong number of parameters Unable to find Field s Cast s does not exist Cast 1d does not exist Cast member Ser does not exist Cast member 1d does not exist Unable to update record Database must be opened in ReadWrite mode Wrong number of parameters Field s does not exist Cast 1d does not exist Cast member s does not exist Cast member 1d does not exist Wrong number of parameters Please consult the manual You must specify a CastLib Cast member Ser not found Invalid CastLib identifier Wrong number of parameters Field s does not exist 14430 14440 14450 14460 14810 14850 14860 14870 14890 14910 14920 14930 14940 14950 14960 15210 15230 15610 15620 15630
104. a e g CD ROM hard disk etc This form of distribution is interesting for users who need to view content locally on their own computer and eventually connect to the World Wide Web by clicking on hyperlinks In this case the Shockwave movies you deliver must playback on the end user s computer in a web browser Microsoft Internet Explorer or a Netscape browser using a playback engine installed in the System folder If you plan to deploy Shockwave movies over the Internet or require that Shockwave movies access a V12 database located on a server on the Internet you must either use the V12 DBE Online Companion or devise a way to bring the V12 database to the local hard disk before opening it and using it The V12 Database Engine Xtra can only open files that are available locally or on mounted volumes Shockwave movies like projectors need to handle two files the V12 DBE Xtra and your V12 database These files must be placed in a location on the end user s computer depending on which browser is used as explained below When using Netscape The Xtra file must be placed into the Shockwave Plug In folder located in Netscape s Plug Ins folder This folder s name is V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 25 e windows shockwave xtras on Microsoft Windows e System folder Extensions Macromedia Shockwave Xtras on Macintosh The database file filena
105. a Record without Setting it as the Current Record This example retrieves the content of record 4 without setting it as the current record set x mGetSelection gTable LITERAL 4 1 sets the variable x to the following string Pencils TAB 5 55 TAB 6251 CR The List and ProperyList would respectively return Pencils 5 55 6251 and name Pencils price 5 55 number 6251 Reading the Entire Selection with Special Delimiters This example retrieves the entire content of each record of the selection with commas as field delimiters and slashes as record delimiters set x mGetSelection gTable LITERAL 1 mSelectCount gTable no ufu sets the variable x to the following string Batteries 9 20 6780 Floppies 1 89 9401 Labels 1 19 1743 Pencils 5 55 6251 Ruler 1 99 1431 Tags 6 19 7519 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 81 Reading Selected Fields in a Selection This example retrieves the content of a single field name for all the records of the selection Note that the TAB parameter is unused in the result but it should nonetheless be present set x mGetSelection gTable LITERAL 1 mSelectCount gTable TAB RETURN name sets the variable x to the following string Batteries CR Floppies CR Labels CR Pencils CR Ruler CR Tags CR The syntax for the Li
106. a from a formatted field are affected These include mGet Field and mGetSelection Syntax mDataFormat gTable FieldName Pattern The following example forces all data retrieved from the field price to be formatted with 3 integral digits and 2 decimal places Example mDataFormat gTable price 999 99 mDataFormat can be applied to fields of type float integer and date Media and string fields cannot be formatted To reset the formatting of a pattern to its original value call mDataFormat with an empty string Example mDataFormat gTable price Formatting Integers and floats Valid patterns for fields of type integer and float contain the following e 9 designates a digit at that position possibly 0 e i designates a digit or a space at that position e period designates the decimal point e any other character literally The following example forces the output of the field ratio to 2 integral digits 2 decimal places and a trailing 96 sign V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 84 mDataFormat gTable put mGetField gTable ratio n99 99 ratio If the value in field ratio is 34 567 the displayed string is 34 57 The pattern 9999 forces the output of an integer field to be formatted within no less than four digits and with three leading spaces if necessary Thus 4 is formatted 123 is formatted
107. all records whose name fields contain either hat or helmet or cap Complex searches that use the OR operator are always slower than those that use the AND operator This is true with V12 Database Engine as well as most other database management systems Complex criteria are very powerful but can be tricky to use The following example illustrates complex criteria mSetCriteria gTable name hat mSetCriteria gTable or name helmet mSetCriteria gTable and price lt 50 mSelect gTable This section of script selects all hats priced under 50 00 and all helmets under 50 00 This is very different from mSetCriteria gTable name hat mSetCriteria gTable and price lt 50 mSetCriteria gTable or name helmet mSelect gTable where the selection consists of all hats under 50 00 and all helmets listed at any price To illustrate the semantic difference between the two requests we could express the first as name hat or name helmet and price lt 50 whereas the second could be written as V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 99 name hat and price lt 50 or name helmet The current version of V12 DBE does not have the ability to perform searches such as name hat or name helmet and price lt 50 note the parentheses The first two
108. alled just before the mSelect method is used NOTE when mOrderBy is used before mSelectAll fieldName must be indexed Example mOrderBy gTable lastName ascending by default mSelect gTable mOrderBy gTable lastName ascending mSelect gTable mOrderBy gTable lastName descending mSelect gTable V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 176 See Also mSelectAll mSelect mSetIndex mReadDBStructure V12dbe Syntax mReadDBStructure gDB inputType inputData password accepts importing from ODBC drivers Parameters inputT ype LITERAL TEXT V12 DBF inputData database descriptor expression if inputT ype LITERAL or pathname of template file otherwise password is releavnt only if inputType V12 Description Create a new database or modify an existing one mReadDBstructure can read a definition from a string field or variable LITERAL from a text file TEXT from another V12 database file or from a DBF file DBF The size of the database descriptor is limited to 32K Example read a definition from a Director field member mReadDBStructure gDB LITERAL field definition read a definition from a TEXT file mReadDBStructure gDB TEXT the pathname amp definition txt read a definition from a V12 database file mReadDBStructure gDB V12 the pathname amp definitio
109. ame alone would certainly force Last Names to be properly ordered But this would not determine the order in which the Cartmans are sorted Last Name First Name City State Zip Cartman Wendy San Mateo CA 94403 Brown Charles San Francisco CA 94115 Pintado Jack Bowie MD 20712 Cartman Lucy Richmond VA 23233 Cartman Eric Lebanon MO 92023 If you want your records sorted by Last Name and by First Name in case of identical Last Names you define a compound index on the fields LastName and FirstName The sorted result would then be V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 28 Last Name First Name City State Zip Brown Charles San Francisco CA 94115 Cartman Eric Lebanon MO 92023 Cartman Lucy Richmond VA 23233 Cartman Wendy San Mateo CA 94403 Pintado Jack Bowie MD 20712 If you want them sorted by Last Name and then by State in case of identical Last Names you define a compound index on the fields LastName and State The sorted result would then be Last Name First Name City State Zip Brown Charles San Francisco CA 94115 Cartman Wendy San Mateo CA 94403 Cartman Eric Lebanon MO 92023 Cartman Lucy Richmond VA 23233 Pintado Jack Bowie MD 20712 Up to twelve fields can be declared in a single compound index in V12 Database Engine Database A table its fields and the indexes defined are stored in a database A database can contain one or more such tables y N
110. amed hats or hatchet will not be selected Since V12 DBE does not differentiate upper case and lower case characters items named HAT or Hat will be selected Not Equal lt gt won The lt gt operator has the opposite effect of the that are different than the specified value operator It is used to locate data Example mSetCriteria gTable price lt gt 9 99 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 95 specifies a search for all items except those that cost 9 99 Less than lt The lt operator is used to locate data that are strictly smaller that the specified value Example mSetCriteria gTable price lt 10 specifies a search for items that cost less than 10 Items that cost exactly 10 are not selected Example mSetCriteria gTable ItemName lt hat specifies an alphabetical search for items with names that precede the letter h in hat This includes cap bonnet but excludes hat Less or equal lt The lt operator is used to locate data that are smaller or equal to the specified value Example mSetCriteria gTable price lt 10 specifies a search for items that cost no more than 10 Example mSetCriteria gTable ItemName lt hat specifies an alphabetical search for items with names that precede equal h in hat This includes cap bonn
111. ames of properties mGetProperty V12dbe Syntax mGetProperty gDB Prop Parameters Prop virtualCR characterSet resources shortWeekDays months shortMonths currentDate weekDays Description Retrieve the value of the property Prop Example put mGetProperty gDB characterSet return Windows ANSI V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 172 put mGetProperty gDB months return January February March April May June July August September October November See Also mSet Property mGetSelection V12Table Syntax mGetSelection gTable outputType From recs FieldDelimiter RecordDelimiter FieldNames Parameters outputT ype LITERAL LIST PROPERTYLIST From number of first record to retrieve default position of current record recs number of records to retrieve default value is Size of selection From 1 FieldDelimiter delimiter between fieldsn default Tab for LITERAL only RecordDelimiter delimiter between record default Return for LITERAL only FieldNames any number of field names Description Retrieve one or more fields in one or more records of the selection Optionally you can specify custom field and record delimiters with the Literal option only Delimiters are not supported by the List
112. an also store binary data of arbitrary formats those cannot be imported in V12 DBE databases When importing data from a DBF file that contains Memo fields the corresponding DBT files are automatically processed by V12 DBE The following example uses the file VIDEO DBF as a template to build a table named video in the V12 DBE database named VideoStore V12 The structure of the file VIDEO DBEF is as follows Field Type Width TITLE Character 30 DESCRIPT Memo 10 RATING Character 4 TYPE Character 10 DATE ARRIV Date 8 AVAILABLE Logical 1 TIMES_RENT Numeric sl NUM SOLD Numeric 2 Two index files named TITLE IDX and TYPE IDX are available in the same folder as VIDEO DBF The Lingo script 1s as follows on CreateDatabase set gDB New Xtra Vl12dbe the pathname amp VideoStore V12 create 2 nm CheckV12Error mReadDBStructure gDB DBF the pathname amp Video DBF CheckV12Error mBuild gDB CheckV12Error put mDumpStructure gDB set gDB 0 end CreateDatabase V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 53 The resulting V12 DBE database can be verified immediately with mDumpStructure see Viewing the Structure of a Database The following is a sample output from mDumpStructure TABLE Video FIELDS TITLE String 30 DESCRIPT String 30000 RATING String 4 TYPE String 10 DATE ARRIV Date AVAILABLE Integer TIMES RENT Integer NU
113. an be used in mCreateField and mReadDBstructure to define new fields V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 163 Appendix 17 Chatacter sets Windows ANSI Character Set If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version 32 70 F 108 146 184 222 b 33 71 G 109 m 147 185 1 223 f 34 72 H 110 n 148 186 224 35 73 111 o 149 187 225 36 74 J 112 p 150 188 226 37 75 K 113 q 151 189 227 38 amp 76 L 114 r 152 190 228 a 39 77 M 115 s 153 TM 191 A 229 40 78 N 116 t 154 192 230 41 79 O 117 u 155 193 231 c 42 80 P 118 v 156 ce 194 232 43 81 Q 119 w 157 195 A 233 44 82 R 120 x 158 196 234 45 83 S 121 y 159 Y 197 235 6 46 84 T 122 z 160 198 236 i 47 85 U 123 161 i 199 C 237 48 0 86 V 124 162 200 238 i 49 1 87 W 125 163 201 239 50 2 88 X 126 164 n 202 240 6 51 3 89 Y 127 165 203 241 f 52 4 90 Z 128 166 204 i 242 6 53 5 91 129 167 205 243 6 54 6 92 130 168 206 244 6 55 7 93 131 f 169 207 245 6 56 8 94 132 170 a 208 D 246 6 57 9 95 _ 133 171 209 N 247 58 96 134 t 172 210 248 o 59 97 a 135 173 211 249 60 98 b 136 174 212 250 61 99 c 137 1757 213 251 62 gt 100 d 138 176
114. and PropertyList options If fieldNames are omitted all fields are returned Otherwise only the specified field are returned LITERAL returns a string LIST returns a Lingo list PROPERTYLIST returns a Lingo property list Example set x mGetSelection gTable set x mGetSelection gTable LITERAL mGetPosition gTable 1 set x mGetSelection gTable LITERAL 1 mSelectCount gTable TAB RETURN number name price Notes Use mError to discover whether mGetField has succeeded mGetField is the only method that follows this rule See Also mGetField mSetField mDataFormat mGetUnique V12Table similar to mGetSelection Operates on Master Field only Returns unique values mGo V12Table Syntax mGo gTable toPosition V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 173 Parameters toPosition index of a record in the selection Description Set the current record to the toPosition nth record of the selection Example get the current record to the 45th of the selection mGo gTable 45 See Also mGoFirst mGoLast mGoNext mGoPrevious and mGetPosition mGoFirst V12Table Syntax mGoFirst gTable Parameters none Description Set the current record to the first record of the selection Example mGoFirst gTable See Also mGoLast mGoPrevious mGoNext mGo and mGetP
115. assword the password for V12 files importing tableName an identifier for V12 files importing Description Import the data from the specified source Syntax varies according to inputT ype See manual Example import from within Director mImportFile gTable LITERAL field data Default delemiters TAB and RETURN mImportFile gTable LITERAL field data TAB RETURN import from a TEXT file mImportFile gTable TEXT data txt TAB RETURN import from a V12 database file you need to specify the password put if there is none and specify from which table the data is taken from mImportFile gTable V12 the pathname amp data v12 password table import from a DBF database file mImportFile gTable DBF the pathname amp data DBF Notes During the importation of data from a V12 database if two fields bear the same name but are of different types try type casting The index of the files from which you are importing the data are not taken into consideration Only the indexes of the host files are brought up to date See Also mEditRecord mUpdateRecord mOrderBy V12Table Syntax mOrderBy gTable fieldName SortOrder Parameters fieldName name of field to use as the sorting key SortOrder ascending descending Default ascending Description Sort the selection according to field fieldName This method is normally c
116. astName string FirstName string Age integer INDEXES CompoundNdx duplicate LastName ascending FirstName ascending V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 47 END The general syntax of a compound index definition is INDEXES Indxi UniqueOrDup FieldName AscOrDesc where e Indx1 is the name of the compound index e UniqueOrDup is either unique or duplicate depending upon whether or not you allow duplicate entries for that index e FieldName is the name of a field defined under the FIELDS tag e AscOrDesc is ascending if you want that field sorted low to high or descending otherwise Up to ten FieldName AscOrDesc couples can be defined for a single compound index Adding Comments to Database Descriptors Database descriptors can also contain comments in much the same way Lingo scripts do In Lingo comments are preceded by double hyphens and must be followed by a CARRIAGE RETURN In database descriptors comments must be preceded by and be followed by They can include any sequences of characters including CARRIAGE RETURNS Example description of the Mega Cookbook recipes table version 1 1 by Bill Gatezky 14 Feb 97 This is a valid comment despite the fact that it contains Carriage Returns TABLE Recipes this is also a valid comment FIELDS NameOfRecipe string indexed END The comment o
117. ateRecord Calls to mSetField will result in an error if not preceded by mEditRecord If an error occurs when updating a record e g Duplicate Key error in a given field none of the preceding calls to mSet Field are taken into consideration When writing to a field whose type is not the same as the supplied parameter V12 DBE tries to cast the parameter to the appropriate type and to interpret it as accurately as possible see l ypecasting Example mSetField gTable price 3 14 stores the value 3 14 mSetField gTable price xyz stores the value 0 00 mSetField gTable name 1234 stores the string 1234 Note Updating the content of a field that has a full index may take more time than equivalent fields without full indexes Writing to Fields of Type Date Writing to a field of type Date is similar to writing to field of type Integer Float or String except that V12 DBE requires the date to be supplied in Raw format YYYY MM DD Example mSetField gTable BirthDate 1993 02 22 is valid mSetField gTable BirthDate 02 22 1993 is not valid Storing the current date in Raw format may be difficult as Lingo s the Date function returns the current date in the Control Panel settings of the computer it is running on In this case use mGetProperty gDB CurrentDate to retrieve the current date in Raw format see CurrentDate n Properties of Databases Properties of Databases Writing to
118. aws and international treaties 1 License a You may install one copy of the Software on a single computer To install the Software means that the Software is either loaded or installed on the permanent memory of a computer i e hard disk This installed copy of the Software may be accessible by multiple computers however the Software cannot be installed on more than one computer at any time You may only install the Software on another computer if you first remove the Software from the computer on which it was previously installed You may not sublease rent loan or lease the Software b You may make one copy of the Software in Machine readable form solely for backup purposes As an express condition of this Agreement you must reproduce on each copy any copyright notice or other proprietary notice that is on the original copy supplied by Integration c You may permanently transfer all your rights under this Agreement to another party by providing to such party all copies of the Software licensed under this Agreement together with a copy of this Agreement and the accompanying written materials provided that the other party reads and agrees to accept the terms and conditions of this Agreement and that you keep no copy of the Software If the Software is an update any transfer must include the update and all prior versions d Your license is limited to the particular version collectively Version of the Software you have pur
119. ble to the V12 DBE Online Companion See step 3c Building the e mOrderBy can now properly sort on any field whether indexed or not See Selection mOrderBy in Step 5 Implementing the User Interface e Table field and index identifiers must begin with an alphabetic character and must be followed by up to 31 alphanumeric characters Unlike former versions of V12 DBE they cannot contain spaces or punctuation marks V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 17 e VI2 DBE is now a Shockwave Safe Xtra It properly runs with Shockwave document ran off a CD ROM or any local medium However it cannot be automatically downloaded from a Shockwave movie Version History V12 Database Engine version 1 0 was released in 1996 as both an Xobject and Xtra for Macromedia Director 4 and 5 It was essentially meant to serve as an advanced data management system for Director titles with elaborate user interfaces delivered on CD ROM such as games and virtual workshops V12 Database Engine Xtra version 2 0 was released in early 1998 It focused on making database technology easier to learn an use by Director users It added features that better suit projects such as electronic catalogs electronic books template based movies etc Some of these features are full text indexing simplified database creation data binding styled text management a behaviors library etc How to r
120. bound by mBindField Explicitly triggering member field updates uses mUpdateBoundFields in much the same way as mUpdateBoundFields forces the writing of Director members content into their bound V12 DBE fields mUpdateBoundFields gTable or for a partial update of selected bound fields mUpdateBoundFields gTable fi f2 f3 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 91 Automatic Generation of Members and Auto binding When starting a new project you need to create Director members for each V12 DBE field you need to represent on the stage name them in an appropriate way and write the script to retrieve and store data for each member or use mBindField For convenience you may want to have these members created and named automatically and then bound automatically to matching fields This is accomplished with mGenerateMembers and mAutoBinding mGenerateMembers mGenerateMembers is usually used immediately after the creation of a database to generate members that correspond to the created fields Syntax mGenerateMembers table instance fromMember This instruction creates as many members as there are fields in table instance starting the creation process from member romMember The members are of types compatible with the V12 DBE field they were generated from Fields of type String Integer Float and Date generate members of type field in D
121. ce a V12 database is created modifying its structure is not an easy task Because V12 DBE files are optimized both for speed and file size only a limited number of modifications are allowed to an existing database For example to add a field to an existing table you must first create a new table create all fields and indexes in it including your new field import all your records to the new table and finally delete the old table The methods used to modify an existing V12 database are see details in Methods References mEditDBStructure mUpdateDBStructure mCreateField mCreateFullIndex mCreateIndex mCreateTable mDeleteTable mRenameField Modifying an existing database s structure is a tedious task and can be easily worked around as follows 1 Dump the structure of your initial database see Viewing the Structure of a Database 2 Modify the returned database descriptor 3 Create a new V12 database based on the modified descriptor 4 Import the content of each table to the new V12 database see 12 DBE The above steps can be executed either through Lingo handlers or using the V12 DBE Tool V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 lntegration New Media Inc 1995 99 page 155 Appendix 15 Data Encryption Though V12 Databases are password protected and as such can not be readily opened by other V12 DBE users they are not encrypted This means that a hacker using the right tools e
122. chased Therefore use of a Version other than the one encompassed by this License Agreement requires a separate license e The Software contains a license file LIC which is subject to the restrictions set forth above and may not be distributed by you in any way However Integration grants you a royalty free right to reproduce and distribute the files named V12 DBE for Director XTR V12 DBE for Director X32 and V12DBE D X16 collectively Runtime Kit provided that 1 you distribute the Runtime Kit only in conjunction with and as part of your own Products ii own a license for the specific Version of the Software that contains the Runtime Kit iii agree to indemnify hold harmless and defend Integration from and against any claims or lawsuits including attorney s fees that arise or result from the use or distribution of your Products with the Runtime Kit V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 123 f Any third party who may distribute or otherwise make available a product containing the V12 DBE Runtime Kit must purchase its own V12 DBE license g Any third party who will use the VI2 DBE Runtime Kit in an authoring environment must purchase his own V12 DBE license 2 Restrictions The Software contains trade secrets in its human perceivable form and to protect them you may not MODIFY TRANSLATE REVERSE ENGINEER REVERSE ASSEMBLE DECOMPILE DIS
123. ciated V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 101 with that specific record field by an empty image A subsequent call to mGetMedia would then return the placeholder By opening a Director 5 or 6 movie in Director 7 old Text members are automatically converted to new Text members However Director 5 or 6 styled texts that are stored in V12 databases cannot be converted to Director 7 text members To you need to convert such V12 fields into Director 7 compatible members first export them to Director 5 6 Castlibs convert the Castlibs to Director 7 and then store them back to V12 DBE A utility movie called Media Cue ene nee performs this conversion Searching and Sorting Styled Text Fields As a result of this technique it is possible to search and sort fields that contain styled text based on the content component of the fields Since the fields used to store styled text are of type string integer float or date operations such as indexing sorting searching etc all remain valid V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 102 Errors and Defensive Programming Effective error management is key to any reliable script or program If you choose to implement the user interface of your project with the V12 DBE Behaviors Library you automatically take advantage of thi
124. closed between apostrophes Example mSetProperty gDB Weekdays Montag Dienstag Mittwoch Donnerstag Freitag Samstag Sonntag ShortWeekdays Read write persistent Valid values any 12 word string The ShortWeekdays property contains the short names of the weekdays used by mDataFormat to format dates the DDD pattern in mDataFormat The value parameter is any 12 word string Words must be separated by spaces Short names of weekdays that contain spaces themselves must be enclosed between apostrophes Example mSetProperty gDB ShortWeekdays Lun Mar Mie Jue Vie Sab Dom ErrorLog Read write persistent Valid values on and off Default value off When the ErrorLog property is set to off V12 DBE s error log and status code are reset before each call to a V12 DBE method When ErrorLog is set to on error messages are cumulated in an error log as V12 DBE methods are called Likewise the status code is set to reflect the most recent error warning code according to the following rule e Vi2Status reflects the code of the most recent error e If no error occurred Vi2Status reflects the code of the most recent warning e fno warning was reported V12Status signals a success Syntax mSetProperty database instance ErrorLog on or off Example mSetProperty gDB ErrorLog on V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 1
125. criteria are always grouped first and the third criteria is added to the result See Appendix 9 Advanced or possible workarounds Partial Selections The selection process can be time consuming if a large number of records match the criteria you specify The worst case scenario is when all the records of a table match the specified criteria This can handicap your project if you have no control over that the queries the end user can express To speed up the selection process you can limit the number of records V12 DBE places in the selection with the following syntax of mSelect mSelect gTable from recs Example mSetCriteria gT LastName Smith mSelect gT 1 100 The above example returns up to a maximum of 100 records in the selection regardless of the total number of Smith in the database If less than 100 Smith exist all of them would be selected To retrieve the next 100 records that contain Smith in the LastName field call mSelect gT 101 100 Partial selections also work with complex searches but not all of them They are only accepted for complex searches that do not use full text indexes De WordStarts or WordEquals Checking the Size of a Selection It is sometimes useful to know the number of items localized in a selection This is the purpose of the mSelectCount method Example mSetCriteria gTable name hat mSelect gTable set selSize mSelectCount gTable In
126. d is undefined Use this method with caution There is no way to undelete records in V12 DBE As a general rule avoid giving direct access of this method to the end user through your user interface Data Binding Throughout this section the term field is used to designate a V12 DBE field and member to designate a Director member V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 89 mBindField establishes a live link between a field and a member Once bound the member automatically displays and updates the content of its associated field for the current record Syntax mBindField table instance V12FieldName DirMember Example mBindField gTable price member thePrice mBindField gTable age member AgeOfStudent of Castlib External two mUnBindField performs the opposite function it breaks the link between a member and whatever field with which the link is bound Syntax mUnBindField gTable DirMember Example mUnBindField gTable member thePrice mBindField spares you multiple calls to mGet Field and mSet Field every time the current record changes It performs a complete read write binding between the member and its associated field Every time the current record changes V12 DBE updates the field with the Director member content goes to the new current record and then refreshes the Director member with the new field s content
127. dbe FileName create Password CheckV12Error mReadDBStructure gDB InputType other params CheckV12Error mBuild gDB CheckV12Error set gDB 0 end CreateDatabase where e FileName is the full pathname of the V12 database to create e Password is the password to protect FileName e InputType is one of Text Literal DBF V12 FoxPro Access Excel or SQL Server V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 49 e other params are one or more parameters depending on the selected InputType See CheckV12Error in Errors and Defensive Programming for a definition of the Checkv12Error handler used throughout this section Step 3a Creating a Database Xtra Instance Use the New method to create a database Xtra instance Syntax set gDB New Xtra V12dbe Name create Password The parameters you provide are e Name the name of the new database file including its path if needed see Dealing with Pathnames in Using Xtras e Create or the Mode the mode in which the Xtra instance is defined In this case the mode is Create create a new database file Other possible modes are ReadOnly ReadWrite and Shared ReadWrite See an Existing Database e Password the password is required if you wish to protect your database against tampering and or data theft You can lock the database with a password but make sure to record i
128. dbe the pathname amp catalog V12 ReadWrite top top top set gTable New Xtra V12table mGetRef gDB Articles other Lingo statements with a syntax error somewhere which causes the handler to abort set gTable 0 set gDB 0 end doSomethingCritical In this example a Lingo error is detected and the database remains open If the database was opened in ReadWrite mode and changes were made the database file might become corrupted You can prevent this problem by declaring the instance variables as global variables Example on doSomethingCritical global gDB gTable set gDB New Xtra Vl12dbe the pathname amp catalog V12 ReadWrite top top top set gTable New Xtra V12table mGetRef gDB Articles other Lingo statements with a syntax error somewhere which causes the handler to abort set gTable 0 set gDB 0 end doSomethingCritical When a Lingo syntax error is detected and the handler aborts you can still type set gTable 0 set gDB 0 in the Message Window to close your database file V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 105 Additional V12 DBE Methods Exporting Data mExportSelection allows exporting of data from a V12 DBE table to TEXT or DBF files DBase III Only the selected records are exported i e those in the selection To export a complete table make sure it is entirely selected firs
129. dentifiers see Defining Identifiers in Step 1 Deciding on a Data Model Syntax mReadDBStructure gDB FoxPro DirectoryPath V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 54 where DirectoryPath is the path to a directory not a file Thus it must necessarily end with a V The following rules apply to the translation of FoxPro databases to V12 databases FoxPro Translated to Notes field type V12 field type Ge Sana Buffer size is the size of the field in the DBF file Integer Float Numeric Float Float Float Double Float Currency Float Date Date Data cannot be converted from ue pu amp imported Logical Integer Memo String Buffer size 32K General Swine Buffer size is the size of the field in the DBF file Character Binary String Buffer size is 32K Memo Binary String Buffer size is 32K FoxPro indexes are translated to V12 DBE indexes with unique values Example on CreateDatabase set gDB New Xtra V12dbe secret CheckV12Error mReadDBStructure gDB CheckV12Error mBuild gDB CheckV12Error set gDB 0 end CreateDatabase the pathname amp myDB V12 create FoxPro the pathname amp FoxDB mReadDBStructure reads the structure of a FoxPro database not its content To import the content of a database see mporting from MS FoxPro Win
130. ditDBStructure object me means that the mEditDBStructure method requires exactly one parameter the database instance mSetProperty object me string property string value V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 24 means that mSetProperty requires three parameters the database instance the property a string and the value of the property a string mDumpStructure object me means that mDumpStructure requires at least one parameter and possibly more indicated by the asterisk You must refer to the documentation of this method to know what additional parameters are accepted mStatus object xtraRef the leading sign means that mStatus is a static method a method that can be used with a database instance i e mStatus gDB and a database library instance i e mStatus Xtra V12dbe Static methods are seldom used in V12 DBE Vl12Status the leading means that v12status is a global method a method that can be used at any time regardless of Xtra instances It is only required that the Xtra be present when that function is called Note In addition to its built in documentation V12 DBE offers detailed on line help accessible from the Xtras gt V12 DBE for Director Help menu in Director Using Xtras with Shockwave V12 DBE can be used with Director movies delivered in Shockwave format a k a shocked movies on local medi
131. duct that database s model is probably the best starting point for your V12 database model The questions you need to address are e which fields are required and what are their respective types e which fields should be indexed for quick searching and sorting e how many tables are required to group the fields e are there any relationships between the various tables In the stationary catalog example below only one table is needed It is called Articles The seven fields you need are e Field ItemName of type String Field Category of type String Field Description of type String Field Price of type Float Field CatalogNumber of type Integer Field Photo of type Media Field Date of type Date Since only the fields ItemName Price and CatalogNumber will be searchable only them are indexed Defining Identifiers Tables field and indexes are given names called identifiers and V12 DBE makes reference to them by use of these identifiers An identifier must start with a low ASCII alphabetic character a z A Z and can be followed by any combination of alphanumeric characters 0 9 a z A Z a 6 The maximum length for an identifier is 32 characters No two fields or indexes of a table can have the same name V12 DBE is not case sensitive That is upper cases and lower cases are identical The following identifiers are considered identical in V12 DBE articles ARTICLES Articles aRtICleS
132. e Also mGetProperty mUpdateRecord V12Table Syntax mUpdateRecord gTable Parameters none Description Save modifications of the current record to the database file A call to mUpdateRecord must be preceded by a call to mEditRecord or mAddRecord Example mEditRecord gTable mSetField gTable name field name mUpdateRecord gTable See Also mEditRecord mAddRecord mSetField new V12dbe Syntax new Xtra V12dbe databaseName openMode password now accepts Shared ReadWrite mode V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 182 Parameters databaseName name of the database file to create clone or open This can be a partial or full pathname to that file openMode is the mode in which the database will be opened Valid values are create readWrite readOnly and clone If openMode is create the third parameter is a password and it is stored in the database file for later reference If openMode is readOnly or readWrite the third parameter is a password and it is checked against the one provided with create Description Create a database Xtra instance and returns a reference to it Usually that reference is assigned to a global variable and used throughout the Lingo script to refer to that database If openMode is create and new database file is created Table field and index definitions must follow
133. e if charToNum char i 1 of str 1 then set res res amp numToChar 1 end if set i i 1 else set res res amp char i of str end if end repeat return res end cleanEscape To use the above handlers first assign the encryption key of your choice to the global variable gEncryptKey Then at startup call initCrypt eg on StartMovie To store an encrypted string to a V12 table call mSetField gT Account encrypt secretData To retrieve an encrypted string from a V12 table call set x decrypt mGetField gT Account encrypt secretData You can further enhance the strength of your encryption by creating an additional field in your table for the encryption key as opposed to using the same global gEncryptKey for all fields and records Thus each record would be encrypted with a different key making it harder to hackers to crack your algorithm If you want to encrypt dates floats or integers convert them to strings first V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 157 Appendix 16 String and Custom String Types V12 DBE enables you to develop applications containing different types of strings such as English German Swedish and Spanish Basically each V12 DBE table can contain any combination of those string types String comparisons depend on how special characters are defined in their corresponding languages For example
134. e license file At all time a V12 DBE license file can be installed only on a single computer Q We are two employees of the same company working on a project involving V12 DBE Both of us need to create database structures and or write scripts to call V12 DBE methods Do we both need V12 DBE licenses A Yes You need two separate V12 DBE licenses unless you share the same computer A V12 DBE license file can be installed on only one computer at a time Q Iam working on a project involving V12 DBE however I never need to create or modify database structures neither do I write or modify V12 DBE related scripts Do I need a V12 DBE license A No If you only need to view or modify the content add delete records of a V12 DBE database no license is required If your project requires you to create or modify a V12 DBE database structure a k a adding deleting tables or if you need to write V12 DBE related scripts then you must have a V12 DBE license Q I developed a software tool that uses V12 DBE and I want to make it available to colleagues and associates for use at authoring time Must they also have V12 DBE licenses A Yes Users of software that use V12 DBE in an authoring environment must have V12 DBE licenses As a student am I entitled to an educational license of V12 DBE Yes but you must conform to specific conditions To obtain an educational license of V12 DBE you agree to use V12 DBE only for educational purp
135. e selection s sorting order is called the master field Selection at startup When a table is first opened its selection is the entire content of that table sorted by the field that is indexed by the default index The first record of that selection which is also the first record of the table is the current record The default index is the first index that was defined for the table in the database descriptor You can use mDumpStructure to verify which of the table s index is the default index see iewing the Structure of a Database You never need to explicitly manage indexes in V12 DBE The best index is always chosen by V12 DBE to perform a search See Appendix 12 Optimization Using Indexes for advanced index management Selecting All the Records of a Table Call mSelectA11 at any time to set the selection to the whole table Syntax mSelectAll gTable To force a specific sort order call norderBy before calling mSelectA11 Example mOrderBy gTable price ascending mSelectAll gTable This example sets the selection to the whole table as referred by gTable in ascending order of prices least to most expensive The field price must be indexed for mSelectAl1 to work efficiently Otherwise it would be very slow Browsing a Selection Browsing a selection means changing the position of the current record The following methods enable you to change the current record in a selection to set the current rec
136. each stored double byte string happens to match the numeric i e single byte ordering of that string V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 139 e WordEquals and WordStarts cannot be used because unlike single byte languages delimiting words in double byte languages require language specific dictionaries Work Around A convenient and easy way to work around the above limitations is to manage double byte strings as if they were media That is only use them for the purpose of storage and retrieval and use additional fields of type Integer or single byte String to store codes that would determine the searching behavior and sorting order of the corresponding double byte strings Either fields of type String or Media can be used to store such double byte strings V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 140 Appendix 11 Printing From V12 DBE There are three popular ways to print from Director movies Directly print Director s stage with the PrintFrom Lingo command This is very easy to implement and does not require an additional Xtra However it simply prints Director s stage and thus prints at 75 or so dots per inch Use the mPrint Xtra see http www mediashoppe com mPrint is easy to use and features an advanced page design tool However it only runs on Windows 9x NT
137. ecause the words in these records don t start with the sub string ham Although words such as hamburger and hammer can be quickly found by the above query the word ham will never be found because it is shorter than the minimum word length set for full indexing Since wordStarts operates on full indexes searching is performed very quickly WordEquals The wordEquals operator can be used only with fields of type string with defined full indexes It locates records that contain words that fully match the value specified to mSetCriteria Example mSetCriteria gTable description wordEquals form sets records for selection containing descriptions such as claim form Records containing words such as forms or formalism would not be selected Since wordEquals operates on full indexes searching is performed very quickly Words shorter than the minimum word length set for full indexing cannot be looked for with the WordEquals operator In such cases you must use the WordStarts operator instead Difference Between Contains and WordStarts Why should you bother using the slow Contains operator 1f wordStarts does the job faster Because wordStarts requires that a full index be defined on a field Full indexes allow for quick searches but require more disk space and more time when updating data Another reason is that wordStarts can only search for words that match or begin with a given
138. ection V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 79 Besides gTable all other parameters are optional However if a parameter is present all its preceding ones must also be present For example if recs is present result_format and From must also be present mGetField requires that you set the current record to the record you need to retrieve data from mGet Selection does not The examples below show various ways of using mGetSelection All examples assume that the table gTable contains 3 fields name price and number declared in that order when creating the table and that the selection contains 6 records Reading the Entire Selection This example retrieves the entire content of each record of the selection with TABs as field delimiters and CARRIAGE RETURNs CRs as record delimiters Fields are sorted in their order of creation The records sort order is the one defined by the selection set x mGetSelection gTable sets the variable x to the following string Batteries TAB 9 20 TAB 6780 CR Floppies TAB 1 89 TAB 9401 CR Labels TAB 1 19 TAB 1743 CR Pencils TAB 5 55 TAB 6251 CR Ruler TAB 1 99 TAB 1431 CR Tags TAB 6 19 TAB 7519 CR Reading a Range of Records in a String variable This example retrieves the content of 3 successive records in the selection starting with record 2 with TABs as field delimiters and CARRIAGE_RETURNs CRs as rec
139. ector User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 56 Memo Binary Ignored Buffer size is 32K MS Access unique and duplicate indexes are properly converted to unique and duplicate V12 DBE indexes with ascending field values mReadDBStructure reads the structure of a MS Access database not its content To import the content of a database see mporting from MS Access Win 32 only mReadDBstructure from MS Excel Win 32 Only MS Excel workbooks can be used as templates to V12 databases MS Excel workbooks can contain one or more worksheets with each worksheet corresponding to a V12 table and each column to a V12 field The resulting V12 database contains as many tables as there are worksheets in the Excel file The MS Excel ODBC driver is required to perform this operation The names of the worksheets and columns of your MS Excel file must be valid V2 DBE identifiers see Defining Identifiers in Step 1 Deciding on a Data Model The types of the field defined in the new V12 database depend on the format of the corresponding MS Excel columns To change the format of a entire column in MS Excel select it by clicking in its heading choose Format Cells and select the Number tab It may be necessary to Save As your workbook with a new name to force MS Excel to commit to the new column s format depends on version of Excel The following rules apply to the translation of M
140. ed files whether Text or DBF with the Windows ANSI Mac Standard or MS DOS character set tables mSetProperty gDB CharacterSet Mac Standard See Step 2 Preparing the Data Character Sets Resources Read only non persistent put mGetProperty gDB resources Returns information on the number of available indexes and the index used by the last call to mSelect Example Number of indexes used 6 Current index in table articles nameNdx using field name V12 DBE resources should not be confused with the MacOS resources those normally edited with ResEdit they are completely unrelated V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 114 CurrentDate Read only non persistent mGetProperty returns the current date in V12 DBE s raw format YYYY MM DD regardless of the Control Panel settings of the Mac or PC Example set aDate mGetProperty gDB CurrentDate put aDate 1999 12 31 Verbose Read write non persistent Valid values are on and off When Verbose is set to on V12 DBE constantly displays a detailed feedback on the tasks it is performing in Director s Message Window Example mSetProperty gDB verbose on mGetProperty gDB verbose Avoid setting both the Verbose and the ErrorLog properties to on at the same time otherwise Director s Message Window will be quickly loaded with lengthy erro
141. efects in materials and workmanship under normal use and the Software will perform substantially in accordance with the manual Integration s entire liability and your sole and exclusive remedy for any breach of the foregoing limited warranty will be at Integration s option replacement of the disk refund of the purchase price or repair or replacement of the Software 7 Limitation of Remedies and Damages In no event will Integration its parent or subsidiaries or any of the licensers directors officers employees or affiliates of any of the foregoing be liable to you for any consequential incidental indirect or special damages whatsoever including without limitation damages for loss of profits business interruption loss of business information and the like whether foreseeable or not arising out of the use of or inability to use the Software or accompanying written materials regardless of the basis of the claim and even if Integration or an Integration representative has been advised of the possibility of such damage Integration s liability to you for direct damages for any cause whatsoever and regardless of the form of the action will be limited to the greater of US 350 00 or the money paid for the Software that caused the damages V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 124 THIS LIMITATION WILL NOT APPLY IN CASE OF PERSONAL INJURY ONLY WHERE AND TO THE
142. egister your V12 DBE license Evaluation copies of V12 Database Engine are available on Integration New Media s web site http www integration qc ca along with full documentation and sample movies You can download those files and start developing your project without purchasing a V12 DBE license The evaluation copy of V12 DBE is not limited in any way it only displays a splash screen upon startup To get rid of the splash screen you must purchase a V12 DBE license or as many as required by the V12 DBE license agreement Such a license is granted to you as a registration number that you enter in Director s Xtra gt V12 DBE for Director gt Register menu item Mtas Window Help Update Movies V12 DBE for Director About V12 DBE Behavior Lib V12Spider Help Shockwave for Audio Settings Convert WAV to SWA Import PowerPoint File Once your copy of V12 DBE is licensed all new databases you create are automatically stamped as legal and do not show a splash screen Existing databases are also stamped as legal as soon as they are opened by the registered V12 DBE V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 18 Existing V12 database must be opened once in ReadWrite or Shared ReadWrite mode to be stamped as legal If you open them in ReadOnly mode or from a CD ROM they cannot be legalized and the splash screen will continue to appear on
143. egration New Media Inc for specific implementations mCustom V12Table Syntax mCustom gTable Parameters none Description Undocumented generic method for project specific implementations Contact Integration New Media Inc for specific implementations mDataFormat V12Table Syntax mDataFormat gTable fieldName format Parameters fielName name of field to which format must be applied format format applied to the content of fieldName Description Associate a formatting pattern to the data retrieved from fieldName Data formats can be applied to fields of type Float Integer and Date If the retrieved data is longer then the formatting pattern V12 returns the corresponding number of 56 78 would be returned as 3B if the format was set to 9 99 Example mDataFormat gTable date dd mm yy characters can be added before the data such as 56 78 is formated to 00056 78 mDataFormat gTable price 99999 99 56 78 is formated to 56 788 mDataFormat gTable price 99 99 56 78 is formated to 56 87 mDataFormat gTable price 99 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 169 See Also mGetField mGetSelection mDeleteRecord V12Table Syntax mDeleteRecord gTable Parameters none Description Delete the current record After calling mDeleteRecord the record
144. ensive Lingo interface requires very little knowledge of Lingo and provides as much guidance as possible when programming such as checking the number of parameters the types of the parameters etc In a nutshell the Lingo basics you need to acquire before delving into V12 DBE are Local and global variables Control structures if statements repeat loops etc Handlers Object instances this is covered in detail later in the section of this manual You re Not Alone Whether you are looking for a quick answer or in depth information you may find the following resources to be very helpful V12 L Distribution List On the VI2L List you will find developers at every level of expertise and in every area of multimedia This friendly group is the perfect place to bounce ideas around with other V12 developers Sign up at http www integration qc ca V12L FAQs INM s FAQs discusses many of the questions that are frequently asked by V12 developers Please check http www integration qc ca products v12director faqs Other Online Resources Macromedia s web site at http www macromedia com support is also a possible source of information It contains amongst other things directions on how to subscribe to Macromedia s support Newsgroups the NNTP server is forums marcomedia com V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 14 You may want to check
145. ertyList thePropertyList where e theList is a Lingo list of lists The first element is a list containing the names of the V12 fields to which subsequent items must be imported in the right order If the first item of the list contains field names that are not present in the current V12 table the corresponding data is ignored e thePropertyList is a Lingo list of property lists where properties have the same names as the V12 fields into which the corresponding data must be imported Examples of valid Lingo lists LastName FirstName Age Cartman Eric 8 Testaburger Wendy 9 Einstein Albert 75 CatalogNumber 8724 9825 1745 Examples of valid Property lists LastName Cartman FirstName Eric Age 8 FirstName Wendy LastName Testaburger Age 9 LastName Einstein FirstName Albert CatalogNumber 8724 CatalogNumber 9825 CatalogNumber 1745 Importing XML to V12 DBE You can import an XML document to a V12 table using Macromedia s XML parser Xtra delivered with Director 7 This is a two step process 1 Convert the XML document to a Lingo property list using the XML parser Example the XML string xm1St ring below is convert to xm1PropList parserObj new xtra xmlparser node parseString parserObj xmlString error getError parserObj if voidP error then xmlPropList makeList parserObj else alert Sorry t
146. erves as a database template Windows 32 only requires the Excel ODBC driver e a MS SQL Server data source which serves as a database template Windows 32 only requires the MS SQL Server ODBC driver It is always a good practice to check the value returned by vi2Error or vi2Status after calling mReadDBstructure see to find out if an error occurred You may also call mDumpStructure right after calling mReadDBstructure to check the actual database structure V12 DBE will build once mBuild is called Database structure translation rules from the above ODBC compliant databases to V12 Databases vary according to the specific ODBC driver installed on your computer mReadDBstructure from a Text File To read a database descriptor into V12 DBE use the following Lingo statement mReadDBStructure gDB TEXT File Pathname Assuming that the name of the database descriptor s filename is Def txt the following Lingo code creates a new V12 DBE database file named Catalog V12 and structures it as described in Def txt on CreateDatabase set gDB New Xtra V12dbe the pathname amp Catalog V12 Create top secret CheckV12Error mReadDBStructure gDB TEXT the pathname amp Def txt CheckV12Error mBuild gDB CheckV12Error set gDB 0 end CreateDatabase mReadDBstructure from a Literal A literal is either a Director member of type Field or a Lingo variable that actually contains the database descriptor as opp
147. et and hat Greater than gt The gt operator is used to locate data that are strictly larger than the specified value Example mSetCriteria gTable CatalogNumber gt 1000 specifies a search for items with catalog numbers larger than 1000 Catalog number 1000 will not be selected Example mSetCriteria gTable birth date gt 1961 12 31 specifies a search for records with a birth date field occurring after Dec 31 1961 excluding that date The earliest birth date in the selection should be Jan 1 1962 or later V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 96 Greater or equal gt The gt operator is used to locate data that are larger or equal to the specified value Example mSetCriteria gTable CatalogNumber gt 1000 specifies a search for items with catalog numbers larger or equal to 1000 Catalog number 1000 will be selected Example mSetCriteria gTable birth date gt 1961 12 31 specifies a search for records with a birth date field occurring on or after Dec 31 1961 Therefore the earliest birth date in the selection may be Dec 31 1961 Starts The starts operator can be used with fields of type string only including custom string types It locates records that start with a given sub string in the specified field Example mSetCriteria gTable description starts
148. ew information Moreover you can find modify and update information quickly and easily Records Fields and Tables An entry in a database is called a record Each record consists of pieces of information called fields All records are stored in a table For example data entry in an address book typically consists of seven pieces of information called fields last name first name street address city state zip code and phone number All the information relevant to one person makes up one record The collected records make up the table and are contained in a database file Entries below are typical of those found in an address book This is a table These are fields This is the 1st record the 2 1 record the 3 record Last Name First Name Address City State Zip Phone Jordan Ann 6772 Toyon Court San Mateo CA 94403 349 5353 Brown Charles 30 Saxony Ave San Francisco CA 94115 421 9963 Pintado Jack 22 Hoover Ave Bowie MD 20712 731 5134 Van Damme Lucie 87 Main St Richmond VA 23233 315 3545 etc V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 27 Peppermint Patty 127 Big St Lebanon MO 92023 462 6267 Note Some database management systems refer to fields as columns and to records as lines or rows In V12 DBE the terms remain fields and records Indexes In a telephone directory information is indexed by last name
149. fine this property first before modifying other string properties such as Delimiters StopWords and MinWordLength To modify the sort order of the default string just omit the Language identifier mSetProperty gDB String field NewCompTable String Language Delimiters Read write persistent Valid values any valid delimiters descriptor Delimiters defines for an existing string type the list of characters that are acceptable as word delimiters for full text indexing By default word delimiters for the predefined types are all non alphanumeric characters everything except 0 9 A Z a z and accented characters Example mSetProperty gDB String Spanish Delimiters 1 0 22 amp 1 9 68 4 2 24 N In the above example the punctuation characters indicated as the value parameter are considered as delimiters If you need to specify the double quote as part of the delimiters either use the Lingo constant QUOTE or place the delimiters in a Director member of type Field and use that field as a value parameter as follows V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 118 mSetProperty gDB String Spanish Delimiters field myDelimiters All non printing characters such as TAB Space CTRL J etc i e characters lower than ASCII 32 are always considered as delimiters To modify the delimiters of the default string just omit the Langua
150. functions commands and methods require a certain number of parameters For example in Lingo the Go to frame command expects one parameter the destination frame identifier Likewise the getAt function expects two parameters list and position While the two aforementioned examples require exactly one and two parameters respectively some commands and functions offer more flexibility by accepting optional parameters For example in Lingo the Beep command requires one parameter the number of beeps However if that parameter is omitted Lingo assumes that one beep is required Xtras offer the same mechanism some methods require an exact number of parameters fixed number of parameters others assume default values if parameters are omitted V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 23 variable number of parameters Each of these methods can be easily identified in the Xtras built in documentation explained below see Basic Documentation DC Basic Documentation In Director Xtras contain a built in mechanism that provides documentation for Lingo developers In the Message Window type put mMessageList Xtra V12dbe in the Message Window where Xtra V12dbe is the name of the Xtra library not of an Xtra instance The above command returns the following Xtra description Xtra V12dbe part of V12 Database Engine 9Integration New Media
151. g a hexadecimal editor can open a V12 database and view its content In more exceptional cases s he can modify data in it although this is very hard to accomplish without corrupting the database This applies to V12 DBE as well as FileMaker Pro MS Access and many other database management systems To protect you V12 database from illegal viewing and or tampering you can use simple techniques such as giving it a system file s name or making it invisible to the Mac Finder or Windows Explorer If you really need to encrypt your data you can use a third party Xtras see p www macromedia com software xtras director or use your own Lingo encryption handler In either case you will not be able to index encrypted strings Searching and sorting encrypted indexed strings would not work properly Encrypted fields must rely on other non encrypted fields for searching and sorting The following Lingo handlers enable the encryption and decryption of strings based on a variation of the One Time Pad algorithm One Time Pad is very easy to program however it is only moderately secure especially if a hacker is entitled to generate large amounts of original encrypted message pairs global gEncryptKey on initCrypt change this encryption key to the string of your choice The longer the string the stronger your encryption algorithm set gEncryptKey thisisthesecretkey end initCrypt on encrypt str set res avoid redundant cal
152. ge 20 The V12 DBE Xtra The brief description of V12 Database Engine is that it is a Lingo Xtra The more accurate description is that it actually contains two Lingo Xtras and one Tool Xtra e a Lingo Xtra named V12dbe which basically represents a database file e a Lingo Xtra named V 2table which represents the table within the database file sce Database Bat es EEN e a Tool Xtra that enables you to access V12 DBE s on line help and to register your V12 DBE license Making an Xtra Available to Director Xtras are designed to be opened automatically by Director in authoring mode or by your Projector in runtime mode also called playback mode The Xtras must be placed in the Xtras folder located either in Director s folder or the same folder as your Projector This feature is supported on both Macintosh and Windows Creating an Xtra Instance This step creates an Xtra instance of your database and stores its reference in a global variable gDB for future use It uses the New method of the database Xtra Example set gDB New Xtra V12dbe the pathname amp myBase V12 Create myPassword Checking if New Was Successful You should always ensure that the Xtra was created successfully immediately after calling New New can fail for many reasons such as a lack of free memory or as a result of misplaced files Example if NOT ObjectP gDB then alert Could not create Xtra instance V12 DBE for Macromedia Director
153. ge identifier mSetProperty gDB String Delimiters field newDelimiters String Language MinWordLength Read write persistent Valid values an integer in the range 1 100 passed as a String parameter MinWordLength determines the size of the shortest word that must be considered for full indexing All words shorter than MinWordLength are ignored and hence refused by the mSetCriteria method when used with the operator WordEquals Example mSetProperty gDB String Spanish MinWordLength 3 Note that the Value parameter is 3 with quotation marks This is because mSetProperty expects a Value parameter of type String only The following is also a valid formulation mSetProperty gDB String Spanish MinWordLength String 3 To modify the MinwordLength of the default string just omit the Language identifier mSetProperty gDB String MinWordLength 2 The default value for MinWordLength is 4 String Language StopWords Read write persistent Valid values a string no longer than 32K StopWords allows for the definition of a list of words that must be ignored in the full indexing process The Value parameter is a string containing the stop words in any order separated by spaces TAB or Carriage Returns Example mSetProperty gDB String Spanish StopWords in on the a To modify the stop words list of the default string just omit the Language identifier mSetProperty gDB String StopWords a the on fo
154. gration New Media Inc 1995 99 page 120 Appendix 1 Licensing FAQs We invite you to carefully read and agree to the terms and conditions of the license before using V12 Database Engine For your information the following answers the most frequent questions on our licensing policy The full licensing agreement follows these FAQs Do I have to pay royalties or a per project fee for using V12 Database Engine No Integration New Media s one time licensing fee enables you to use V12 DBE royalty free Once you own a V12 DBE license you can use it for as many projects as you wish What do Authoring time and Runtime mean in the context of V12 DBE You use V12 DBE at authoring time if the V12 DBE Xtra is present in Director s or Authorware s Xtras folder when developing a project that requires it Writing scripts that call the V12 DBE Xtra and creating modifying database structures a k a database schema are authoring time tasks You use V12 DBE at runtime if the V12 DBE Xtra is present in a playback executable s Xtras folder a Director projector or Authorware runtime A business associate of mine is interested in evaluating V12 DBE What am I entitled to give him her for the purpose of evaluation You can give away the V12 DBE Xtra its manuals and other related files in as many copies as you wish except for the license file LIC and the V12 DBE registration number Better yet refer your business associate to http www
155. gressIndicator 112 116 DBye rsioni 254452125405 555 se kak 120 ProgressIndicator Message 116 Delimiters eite 121 ShortMonths 118 Error og 119 ShortWeekDays 119 MaxLoggedErrors 119 Stop W OTdS sss 122 MinWordLength 121 e 121 Months cesses 118 Mer DOG ele 117 ProgressIndicator 112 116 VirtualCR ue eee 116 ProgressIndicator Message 116 Weekday eee 118 RESOUICES y 5oo H e Ken eee 117 mUnBindField 91 SharedRWcount 120 mUpdateBoundFields 93 ShortMonths 0 0 0 0 ecceeeeseeteeees 118 mUpdateRecord 89 ShortWeekDays UU 119 mXtraVersion ee 114 StopWotrds hts 122 Ti SWE eA 21 23 50 74 String N DD ever REG 121 XI2Brtor nonsese ees 105 Nerbose 5 45 445 55c35c lt r eriein iens 117 NASIRD N gre 105 VirtualCR esses 116 Mode an nea d ye en este RU 50 MWeckdaxg o a55 550y54055454d41 eiee 118 ilon N r 110 mGetPropertyNames 115 Multiple Instances 134 meet 74 75 o mGetSelection sss 80 prett lm gue eege eer 84 Operators searching sss 97 MOO REN TT 79 P EE EE TI MGOLASt EE 77 Packing a Database file
156. h to display in the upper part of the progress window If you set the ProgressIndicator Message property to an empty string V12 DBE displays its own context dependant message Without Cancel Without Cancel VI2 DBE displays its own progress bar when performing one of the above mentioned tasks No Cancel button is shown and the current task cannot be interrupted You can set the ProgressIndicator Message property to whatever message you wish to display in the upper part of the progress window If you set the ProgressIndicator Message property to an empty string V12 DBE displays its own context dependant message UserDefined V12 DBE does not display a progress bar of its own Instead it calls three Lingo handlers that must be defined in your movie V12BeginProgress V12Progress and V12EndProgress See User Defined Progress Indicators below None No Progress Indicator is shown and no callbacks are performed to Lingo handlers default value See also Properties of Databases f ProgressIndicator V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 110 User Defined Progress Indicators If you wish to display your own progress indicator to the user you must set the ProgressIndicator property to UserDefined and define three Lingo handlers in your movie Vi2BeginProgress V12Progress and V12EndProgress e The Vi2BeginProgress handler is called when the task starts t
157. he Lingo Xtra instance Freeing the Lingo Xtra instance What is an Xtra Xtras are components alternatively know as add ons or plug ins that add new features to Macromedia Director Many of Director s own functions are implemented as Xtras Macromedia Director supports five types of Xtras e Lingo Xtras add new Lingo commands and functions to Director They must be delivered to the end users along with your project To list all available Lingo Xtras type ShowXlib in Director s Message Window To find out what methods are provided by a Lingo Xtra type put mMessageList Xtra lt the Xtra s name gt in the message window e Tool Xtras extend Director s features at authoring time They appear in Director s Xtra menu e Transition Xtras add new transitions to Director s own transitions set They only appear in Director s Modify gt Frame gt Transition window e Asset Xtras enable you to create members of new types and place them on Director s stage They appear in Director s Insert menu e MIX Xtras are translation modules that enable you to import export foreign media such as WAV MP3 files etc Xtras for Windows 9x NT must have a X32 file extension as in V12 DBE for Director X32 Xtras for the Macintosh generally have the an XTR extension The file extension X16 is reserved for Xtras for Windows 3 1 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 pa
158. here was an error amp amp error end if V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 67 2 Import the resulting property list to your V12 table Example mImport gT PropertyList xmlPropList Importing from MS Access Win 32 only MS Access MDB files can be imported to V12 databases one table at a time A MS Access ODBC driver must be present but no DSN Data Source Name is required Syntax mImport gTable Access FileName UserName Password TableName where e FileName is the path to the source MDB file e Username is a valid user name to access the MDB file or EMPTY if the MDB file is not protected e Password is Username s matching password or EMPTY if the MDB file is not protected e TableName is the name of the table to import Converting an MS Access database into a V12 database is a two step process First create the V12 database see mReadDBstructure from MS Access Win 32 Only Then import data to each of its tables with mImport as explained above Generally MS Access databases are encoded in the Windows ANSI character set Thus you must make sure that the CharacterSet Property is properly set to Windows ANSI before importing the data Windows ANSI is the default setting for the CharacterSet property See CharacterSet in Properties of Databases Importing from MS FoxPro Win 32 only Fox Pro DBF files can be imp
159. hod called by the Next button updates record 1 thus relocating it as record 7 and then goes to the new record 2 which is 50 Bright copper kettles To avoid this behavior you must prohibit the modification of fields used in the current index Or better yet create an additional indexed field that can be used as an internal ID This is how many database engines work internally Note Selections defined by calls to mSetCriteria mSelect are not affected by this symptom V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 135 Appendix 9 Advanced Boolean Searches Two or more search criteria can be chained in a single query with V12 Database Engine as in mSetCriteria gT DishType soup mSetCriteria gT AND TimeToPrepare lt 20 mSelect gT or mSetCriteria gT Ingredients WordStarts celery mSetCriteria gT OR Ingredients WordStarts pumpkin mSetCriteria gT OR Ingredients WordStarts carrot mSetCriteria gT OR Ingredients WordStarts eggs mSelect gT You can also mix ANDs and ORs as follows mSetCriteria gT DishType soup mSetCriteria gT OR DishType appetizer mSetCriteria gT AND TimeToPrepare lt 30 mSelect gT The above query finds all soups and appetizers that require less than 30 minutes of preparation time This is not equivalent to mSetCriteria gT
160. ies a database Xtra named V12dbe and a table Xtra named V12table The database Xtra is used to create a new database or to open an existing database in a given mode read only read write or create The table Xtra is used to manage the content of the table in your database The Main Steps Step 1 Step 2 Step 3 If you read through the First Steps manual a typical step by step use of V12 DBE was outlined The individual steps to using V12 DBE are explored in greater details in this section Deciding on a data model Before you create your database decide which fields are needed the type of those fields how they should be grouped in the tables and which fields should be indexed This is a design effort that does not require a special tool with the possible exception of a word processor to help you edit your ideas If your original data is managed in FileMaker Pro MS Access or a similar database management product that database s model is probably the best starting point for your V12 database model Preparing the data If your original data is managed in FileMaker Pro MS Access or a similar database management product in step 2 you make sure that your data 1s properly entered and that it is in a format readable by V12 Database Engine Text file DBF file or one of VI2 DBE s ODBC compliant formats Creating a V12 DBE database Use the V12 DBE Tool to create the V12 database you designed at Step 1 Alternatively you can use
161. imit word boundaries and MinWordLength the size of the shortest word that must be considered for full indexing Flat and Relational Databases A flat database usually consists of one table In flat database management systems such as FileMaker Pro the terms table and database are interchangeable A relational database presents a more sophisticated use of information In relational database management systems two or more tables are contained in the database Therefore you can store as many tables as you wish in a single database file and each table could have one or more indexes Tables can be linked so that information can be shared saving you the trouble of copying the same information into several locations and in the maintenance of duplicate information This is important if there are relationships between the various pieces of information Though tables can be linked or related to other tables in a flat database management system manipulation is cumbersome and changes made in one record are not automatically updated in other s V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 lntegration New Media Inc 1995 99 page 30 For example if you want to add information to the entries contained in the address book in our first example such as the company address and phone number one way to do this would be to add them to the table Last Name First Name Address City State Zip Phone Company Phone Jordan Ann 677
162. ing Data with mImport e Text files can be easily imported from FileMaker Pro MS Access and MS Excel thanks to the new mImport file method and its TextQualifier property mImportFile is still supported for the purpose of backward compatibility However it will be progressively phased out See Importing Data with mImport e Lingo lists and property lists can be easily imported to V12 databases with the mImport method One can easily convert a project that has become hard to manage with Lingo lists to one that takes advantage of V12 DBE Also it makes it possible to import XML documents to V12 databases through Macromedia s XML parser See Importing Data with mImport e Partial Selections mSelect optionally returns a limited number of records in the selection This is convenient when users can express queries that match very large numbers of records See Partial Selections jin Step 5 Implementing the User Interface e mFind allows the setting of the current record within the selection based on a value as opposed to mGo which requires a record number fnFind jin Step 5 Implementing the User Interface e mGetUnique retrieves unique values of the field that determines selection s order It is convenient to populate a pop up menu or a scrolling list with all the possible search values on a given field See Reading Unique Values of a ied e mBuild accepts an additional parameter online and can create V12 databases that are compati
163. ion New Media Inc 1995 99 page 33 e IC exactly one record satisfies the search criteria the selection contains only the record which automatically becomes the current record e If two or more records satisfy the search criteria the selection is the set of those records and the first record of the selection becomes the current record e If no record satisfies the search criteria then the selection is empty and the current record is undefined Any attempt to read or write in a field will result in an error The following figure illustrates the idea of searching a table for records satisfying a certain criteria The result is placed in a selection the first record of which becomes the current record Current et Search Criteria Selection Table containing ail records All operations on any fields such as reading and writing data are done on the current record Therefore before performing these operations you must designate the record on which you wish to work as the current record by selecting it and by using methods such as mGoFirst mGoLast mGoNext mGoPrevious and mGo At any given time with the possible exception of no record satisfying the criteria there is a current record All record operations apply to the current record and do not apply to any other record You can read the content of a field in the current record modify its content or delete the entire record The current record is changed when you m
164. irector Fields of type Media generate members of type Bitmap That would change to Sound Palette or any other member type depending on the exact content retrieved by mGetMedia For example assume gTable refers to a table named articles containing the fields ItemName of type String Description of type String Price of type Float Catalog number oftype Integer and Photo of type Media mGenerateMembers gTable member 22 creates five members in the internal castlib starting from member 22 If all members 22 26 are empty upon calling mGenerateMembers members 22 23 24 25 and 26 are created If any of the members 22 26 are not empty upon calling mGenerateMembers the members are skipped In the above example suppose that members 24 and 26 already existed mnGenerateMembers would have then created members 22 23 25 27 and 28 mGenerateMembers can also generate members in any castlib other than the default Director internal castlib as follows mGenerateMembers gTable member bird of castlib album The newly created members are named after the table from which they were generated followed by the V12 DBE field name they represent with a comma in between In the above example the newly created members are named Articles ItemName Articles Description Articles Price Articles Catalog number and Articles Photo This naming scheme enables you to get each piece of information as follows for a given auto generated
165. irstName value tMsEndRegion end Repeat tMsEndRegion tMsPrintReport tMsFreeReport Change this script to obtain the following changes are in bold tMsRegisterMPrint mp xxxxxxxxxx tMsCreateReport the pathname amp NameList mpf tMsBeginRegion MainRegion repeat with i 1 to 10 tMsBeginRegion NameListRegion mGo gT i tMsSetVariable FirstName mGetField gT FirstName tMsEndRegion end Repeat tMsEndRegion tMsPrintReport tMsFreeReport Your report is ready for printing Example 3 printing multiple columns This example shows how to print two columns on a mPrint report the left column is a list of products The right column in a list of prices matching each product of the left column The right column is right aligned This example also shows how to print a sum at the bottom of a column This technique can be easily extended to print a product mean standard deviation etc In mPrint Designer draw two Regions In each region create a Repeat Region one for each column In the left region Repeat Region create a variable named ProductName In the right region Repeat Region create a variable named Price Open the Properties of the Price variable and choose Alignment Right Finally in the PriceColumn Region but outside of the PriceList Repeat Region create a variable named Total V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 199
166. is already opened 10 Not closed properly 11 No Space 12 File already exists 13 Not created properly 14 Incomplete Data 15 Bad Header 16 Bad Node 17 Bad Split Entry 18 File Not Open 19 File Not Closed 20 No Root Node 21 No Current 22 Bad Index Number 23 Bad data length 24 Bad reference type 25 Bad field reference 26 Bad field pointer 27 Bad field handle 28 Bad field type 29 Bad Sequence type 30 Bad key length 31 Bad key type 32 Bad Duplicate type 33 Buffer overflow 34 Bad file specification 35 Bad minimum extend 36 Over demo limit 37 File seek 38 Log record number not used 39 Double lock current info 40 Double unlock current info 41 Entry has bad data length 42 Bad segment number 44 Memory allocation error 45 Data checksum error 46 Data definition checksum error 47 Unable to open database The maximum of users as been reached 48 Bad build key 49 Duplicate key 50 Invalid number of buffers 51 Key too big 52 Too many segments 53 Bad lock current info 81 Bad load shared library 82 101 102 103 104 105 106 107 108 109 110 sit 201 202 203 204 205 206 207 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 1010 1030 1050 1060 1070 1080 Function not loaded Function not found File locked File mode error Not enough memory or not
167. k between fields and members where data updating and refreshing operations must be explicitly triggered with mUpdateBoundFields and mRefreshBoundFields Syntax mAutoBinding gTable Cast SafeBinding Searching Data with mSetCriteria When searching data you often need to isolate a specific group of records that satisfy a common condition in a table These conditions are called search criteria and the subset of isolated records is the selection see Database Basics for an explanation of selections and current records mSetCriteria is the method used to specify search criteria followed by mSelect to trigger the search process Syntax mSetCriteria gTable FieldName operator Value mSelect gTable V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 93 Simple Search Criteria A search criterion has at least three characteristics e FieldName this is a valid field name in the table instance e operator this is a comparison keyword Valid operators are lt lt gt gt lt gt starts contains wordStarts and wordEquals e value this is the value to which the field contents must be compared to in order to be selected The following example selects all items that are cheaper that 12 mSetCriteria gTable price lt 12 mSelect gTable Upon completion of mSelect the resulting selection contains the set of records that satisfy the defined
168. l and user friendly cross platform database management Xtra for Macromedia Director and Macromedia Authorware V12 DBE for Director V12 DBE was originally designed in 1996 to be used specifically with Director It extends Director s features and helps you speed up the development of your multimedia titles You will discover many benefits in using V12 DBE to create interactive applications such as electronic catalogs storybooks kiosks training material sales material games and more You will be using it as a back end to your multimedia projects to efficiently manage text numeric data dates images sound clips as well as any type of media that Director can store in its members V12 Database Engine enables you to provide advanced functionality to your end users while bringing down your development and maintenance costs V12 DBE is very flexible and scalable It can be used in a wide range of applications from simple projects where Lingo Lists and FilelO have become difficult to manage to true database driven applications V12 DBE for Director is available in Light and Regular editions V12 DBE Light Edition can be used with Director 6 x and later and supports Windows 95 98 NT and PowerMac V12 DBE Regular Edition runs with Director 5 x and later and supports Windows 3 x 95 and 98 NT Mac68K and PowerMac Lingo programmers can work through more complex projects by taking advantage of V12 DBE Regular Edition s rich and flexible
169. l for the clone Example set gClone New Xtra Vl12dbe myClone V12 clone mGetRef gDB In this example the new Xtra instance gClone refers to the file myClone V12 Freeing up Disk Space packing Most database management systems including V12 DBE do not reclaim the space freed by deleted records for the sake of performance Consequently as records are created and deleted the size of the database grows continuously mPackDatabase can be used periodically to reclaim lost bytes Syntax mPackDatabase database instance NewFilePathName Example mPackDatabase gDB the pathname amp Packed DB V12 mPackDatabase gDB LAN Shared Projects Barney KidsStuff V12 The first example compresses gDB into a new file named Packed DB V12 located in the same folder as the current Director movie The second example compresses gDB into a new file named KidsStuff V12 located on a different volume removable media LAN etc At the end of the operation database instance stays valid referring to the non packed database and NewFilePathName is a new file that can be opened with V12 DBE V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 108 If you just need to compress your current database without creating a new file you can do so by compressing it into a new temporary database deleting your initial database and renaming the temporary database to your initial da
170. le mGoLast sets the current record to the last record of the selection Example mGoLast gTable mGo mGo takes one integer parameter call it n and sets the current record to the n item of the selection Example mGo gTable 11 This example sets the current record to the eleventh record of the selection If no such record exists mGo signals a warning V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 76 mFind mFind sets the current record to one in the selection whose Master Field equals or starts with the keyword provided in parameter see definition of Mater Field in Selection and Current Record mF ind is a great complement to mGo which can set the current record only based on its position in the selection The syntax is mFind gTable First Keyword mFind gTable Next mFind gTable Previous where Keyword 1s the value to look for in the Master Field If the Master Field is of type String the matching record s content must start with Keyword If it is of type Integer Float or Date it must equal Keyword Use the first form with the First parameter if you want the new current record to be the first one of the selection that matches Keyword Use the second form with the Next parameter if you want it to be the next record in the selection according to the present current record Use the third form Previous if you want i
171. lectAll gTable1 mSelectAll gTable2 This example defines two table instances gTablei and gTable2 for the table articles The selection in gTab1e1 is sorted by order of price whereas in gTable2 it is sorted by order of name Note 1 The multiple instance definition technique is sometimes convenient for Read Only databases but can lead to inconsistencies when used in Read Write mode This happens particularly when editing a current record which is also the current record of the other instance 2 Each table instance takes up RAM V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 131 Appendix 6 Delivering to the End User V12 DBE is designed in a way that minimizes any last minute changes needed before delivery to the end user Unlike other database management systems where you need to swap the development version of certain files with the runtime versions no swapping is required with V12 DBE You deliver the Xtra file V 2 DBE for Director XTR and or V12 DBE for Director X32 and or VI2 DBE for Director X16 For an Xtra to be available to a Director projector you must to place it in a folder named Xtras located in the same folder as the projector itself Alternately with Director 7 you can package the required Xtras into your Director projector by including them in the Modify gt Movie gt Xtras window As stated in the licensing agreement you DO NO
172. ll show you how to use the methods available to you in V12 DBE The next sections cover the integration of V12 DBE with Macromedia Director here you can get a sense of how V12 DBE can be helpful to your projects The Appendices deal with very specific issues such as capacities and limitations errors end user delivery portability etc V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 12 Where to Start Before browsing through this User Manual we recommend that you look at the First Steps The First Steps contains an introductory tutorial example scripts and sample projects to help you get started with V12 DBE and Lingo in a few short steps You may also benefit from browsing through the Sampler and the Mini Sample movies All available for free on INM s web site at http www integration qc ca downloads Please make sure you understand V12 Database Engine s license agreement_before proceeding The full license agreement is at the end of this user manual in Appendix_ Answers to commonly asked questioned can be found in the licensing FAQ section in System Requirements for Running V12 DBE Macintosh Version Mac68K or PowerMac with System 7 1 or later and 1 Mb of free disk space On the Macintosh V12 DBE and any other Xtra will share the same memory partition as Macromedia Director For simple database applications you do not need to change the memory pa
173. ls compute lengths in advance set keyLength length gEncryptKey set strLength length str repeat with i 1 to strLength Set keyIdx i mod keyLength set tmp numToChar charToNum char i of str charToNum char keyIdx of gEncryptKey mod 256 check if resulting string contains 0 if so Director would trucate the string if tmp numToChar 0 then the escape code for a 00 char is 0102 Set tmp numToChar 1 amp numToChar 2 encode 01 as well to differentiate from encoded 0 s else if tmp numToChar 1 then Set tmp tmp amp tmp the escape code for a 01 char is 0101 end if set res res amp tmp end repeat return res end encrypt V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 156 on decrypt str set res first clean up escape codes set str cleanEscape str set keyLength length gEncryptKey set strLength length str repeat with i 1 to strLength set keyIdx i mod keyLength set res res amp numToChar charToNum char i of str charToNum char keyIdx of gEncryptKey 256 mod 256 end repeat return res end decrypt on cleanEscape str just replace every instance of 0101 by 01 and 0102 by 00 set res set strLength length str repeat with i 1 to strLength if charToNum char i of str 1 then if charToNum char i 1 of str 2 then set res res amp numToChar 0 els
174. lt C V12 DBE first checks if Field1 is the first segment of an index i e a simple index is defined for it or it is the first field of a compound index If such an index exists it is automatically considered to be the best index for the query Otherwise V12 DBE checks if Field2 is the first segment of an index If so that index is the best index for the query Otherwise V12 DBE attempts to apply the same logic to Field3 If none of Fieldl Field2 and Field3 is indexed or appears in the first segment of a compound index the table s default index 1s used This logic does not apply to OR operators AND operators further refine a selection whereas OR operators constantly add new data to them This is also why queries with ORs are slower than those with ANDs The index chosen by mSelect determines the selection s default sorting Thus if Field1 is not indexed and rield2 s index is chosen the following script yields a selection sorted by Field2 mSetCriteria gT Field1 A mSetCriteria gT AND Field2 starts B mSetCriteria gT AND Field3 lt C mSelect gT Actually VI2 DBE can use two or more indexes for a single search However for the purpose of combined search and sort operations using an index for sorting would require more CPU effort than actually sorting the selection with Quicksort Quicksort is the most efficient sorting algorithm known to date V12 DBE for Macromedia Director
175. m MS Excel Win 32 only Then import data to each of its tables with mImport as explained above Importing from MS SQL Win 32 only MS SQL Server data sources can be imported to V12 databases one table at a time through a PC s ODBC driver and a valid DSN Data Source Name Data sources can be created through Window s ODBC Data Sources Control Panel which is accessible from Start gt Settings gt Control Panel menu Syntax mImport gTable SQLserver DSN Username Password TableName where e DSNis a valid Data Source Name e Username is a valid user name to access the SQL Server e Password is Username s matching password e TableName is the name of the table to import Example mImport gTable SQLserver InventoryDSN Admin XBF48 Products V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 69 Converting an MS SQL Server data source into a V12 database is a two step process First create the V12 database see mReadDBstructure from MS SQL Server Win 32 Dnry Then import data to each of its tables with mImport as explained above Importing Media into a V12 database Although V12 DBE databases can store different types of media anything that can be stored in a Director member except Film Loops and QuickTime movies there is an alternative to storing media directly in V12 Instead of storing media in V12 DBE files they can
176. mains open and cannot be re opened unless the computer is restarted In some cases it can even become corrupted V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 22 Checking for Available Xtras You can learn which Xtras are available to Director by typing the following in the Message Window ShowXlib If V12 DBE is installed you should see V12dbe and V12table listed in ShowX1ib s output as well as all other available Lingo Xtras Note that this technique applies to Lingo Xtras only Dealing with Pathnames The New method in V12dbe requires that you specify the name of the V12 DBE file you want to create or open If only a file name is specified the file is assumed to be located in the same folder as Director or the Projector Example set gDB New Xtra Vl2dbe myBase V12 Create myPassword assumes that myBase V12 is in the same folder as Director or the Projector This is strictly equivalent to set gDB New Xtra V12dbe the applicationPath amp myBase V12 Create myPassword Most of the time however placing the database file in the same folder as the movie that uses it is more convenient Use the pathname Lingo function to get the current movie s folder Example set gDB New Xtra V12dbe the pathname amp myBase V12 Create myPassword Passing Parameters to Xtras As in any programming language including Lingo
177. me Empty pathname Invalid new pathname Empty new pathname Wrong number of parameters Invalid table name Empty table name Invalid old field name Empty new field name Cannot rename field Database must be opened in Create or ReadWrite mode V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 190 16470 Table does not exist 16480 Field does not exist in table s 16490 Unable to rename field s of table s Table already built 16500 Unable to modify database structure Call mEditDBstructure first 16510 Cannot rename field Field s already exist in table HEEM 16810 Field s does not exist 16820 Invalid output format Please consult the manual to get a description of the different output formats 16830 Invalid start position Must be a number greater than zero 0 and smaller than the number of records in the selection 16840 Invalid number of records to read Must be a number greater than zero and smaller than the number of records in the selection 16850 Invalid field delimiter 16860 Invalid record delimiter 16870 Invalid field name 1 1 1 1 nun 9 oO 9 9 Warnings 1390 File is opened in ReadOnly mode Check if medium or file is read only 1450 Cannot update bound fields Not in ReadWrite mode 1470 No field match No data copied 1510 File is opened in ReadOnly mode Can t open in Shared Readonly mode
178. me V12 must be placed in the same folder as Netscape If the Shocked movie is used locally that is not downloaded by the user from the Web the V12 database file can also be placed in the same folder as the Shockwave movie When Using Internet Explorer The Xtra file must be placed into the Shockwave Plug In folder e windows shockwave xtras on Microsoft Windows e System Folder Extensions Macromedia Shockwave Xtras on Macintosh The V12 database file must be placed in the same folder as the shocked movie ed V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 26 Database Basics Overview If your understanding of what a database is and does is unclear we recommend that you read this section The following sections deal with database basics e what is a database records fields and tables indexes and full text indexes flat and relational databases field types selection current record and search criteria What is a Database A database is a collection of information that can be structured and sorted A telephone book is an example of a hardcopy database and government statistical records are examples of electronic databases Database management programs such as V12 DBE provide many advantages over hardcopy databases Unlike using a telephone directory that sorts data in alphabetical order database software allows you to change the way you sort and vi
179. media Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 94 Sorting a Selection mOrderBy You can define a sort order on a selection by calling the morderBy method prior to calling mSelect Specify the sorting order whether ascending or descending and the field upon which the sort is performed Example mSetCriteria gTable ItemName contains hat mOrderBy gTable price descending mSelect gTable The above example selects all hats in gTable and returns a selection sorted by a descending order of prices most expensive to least expensive If morderBy is not called before calling mSelect the sort order of the selection depends on the index used to perform the search That index is automatically chosen by V12 DBE to optimize the search time See i Optimization Using Operators The following is a list of valid operators and their meanings Although comparisons of integers floats and dates are straightforward comparing strings and custom string types depends on how those comparison rules are defined see String and Custom String Types Media fields cannot be compared Equal The operator is used to locate data that exactly match the specified value Example mSetCriteria gTable price 3 14 specifies a search for items that cost exactly 3 14 Example mSetCriteria gTable ItemName hat specifies a search for items named hat Items n
180. meters err an integer optional parameter Description If you call v12Error without the Err parameter and right after calling a V12 method it returns an accurate and contextual description of the result When called with the Err parameter a generic explanation of that error code is provided V12Error is global method it is an alternate syntax to mError Example set errMsg set errMsg V12Error V12Error 30000 See Also V12status V12status Global Syntax Vi2Status Parameters none Description Return the result code of the last V12 DBE method called A return code of 0 means no error occurred A positive code signals a warning A negative call signals an error Call V12Error to get a complete explanation of the problem s that occurred in the last method Example mSetCriteria gTable name buzzlightyear if V12Status then Alert V12Error See Also V12Error XtraVersion Global Return version of Xtra V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 184 Appendix 20 Error Codes This section lists error codes and their descriptions Two kinds of errors may be returned warnings and errors Errors 1 Selection empty 2 Not initialized properly 3 Internal error 4 Bad global area 5 Disk read error 6 Disk Write Error 7 Header Read Error 8 Header Write Error 9 The file does not exist or
181. ming Syntax mImport gTable DBF FileName Options V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 65 where FileName is the pathname of the DBF file to import and Options is an optional Lingo Property list containing the following property character_set is one of Mac Standard Windows ANSI or MS DOS It determines which character set the DBF file is encoded in Most systems automatically encode DBF file in the MS DOS character set See la aca ci jn Step z Preparing he Da a he defini eha elen eet hen defined by the CharacterSet property see EharacterSet in Databases Databases It is normally Windows ANSI on the Windows version of V12 DBE and Mac Standard on the Macintosh version of V12 DBE DBF is an antiquated file format It is always assumed to be encoded in the MS DOS character set When importing a DBF files make sure to assign the right Character Set See haracterSet in Properties of Databases Example mImport gTable DBF the pathname amp Pierl Import DBF character_set MS DOS If a field in the destination table has the same name as a field in the source DBF file but is of a different type mImport tries to typecast the data to match the destination field type When importing data from a DBF file that contains Memo fields the corresponding DBT files are automatically processed and imported by V12 DBE
182. msg mGetProperty gDB ProgressIndicator Message V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 113 mSetProperty gDB ProgressIndicator Message Exporting records Please be patient This property sets the text that must be displayed in the upper part of V12 DBE s progress window If you set it to an empty string V12 DBE displays a message that depends on the current operation See VirtualCR Read Write persistent Valid values any ASCII character When importing or exporting data convert Carriage Returns ASCII 13 to this ASCII character This is convenient to avoid the confusion of real Carriage Returns with Record Delimiters This property can be overridden by a specific VirtualCR character passed as parameter to mImport set c mGetProperty gDB VirtualCR put CharToNum c show ASCII number in message window mSetProperty gDB VirtualCR NumToChar 10 define ASCII character 10 as virtual CR See Step 2 Preparing the Data Virtual Carriage Returns CharacterSet Read Write persistent Valid values Windows ANSI Mac Standard MS DOS Default Windows ANSI on the Windows version of V12 DBE and Mac Standard on the Macintosh version of V12 DBE This property affects all of V12 DBE s import and export functions It can be overridden by a specific character set passed as parameter to mImport Translates imported and export
183. n the other way around that is starting from the Scores table you get a N 1 or Many to One relation noted N 1 Scores StudentID Students ID In exceptional cases relations can be established from a table s records onto records of the same table V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 150 Assume that we add a Tests table to the database to store the description of each test TABLE Tests FIELDS ID integer indexed Title string indexed Topic string indexed Author string CreationDate date LastUpdateDate date Field Test ID of table Scores refers to field ID of table Tests This is another Many to One relation N 1 Scores TestID Tests ID Example SCORES Student STUDENTS 127 TESTS Title vr Cartman Lew E Trigonometry H28 Broslowsky S u Genetics 129 McCormick mm _ 128 Rocket Science 129 The structure of the overall database now contains three tables and can be represented by the following Entity Relation Diagram ID inte ger lt ID integer LastName string Title string FirstName string Topic string Email string Author string Faculty string CreationDate date LastUpdateDate date Many to One Many to One SCORES TestID integer StudentlD integer Score integer TimeSpent integer Tables Students and Tests are said to be in a Many to Many relation
184. n v12 top secret read a definition from a DBF database file mReadDBStructure gDB DBF the pathname amp definition dbf See Also new mBuild mSelDelete V12Table Syntax mSelDelete gTable Parameters none Description Delete all the records of a selection At the end of the operation the selection is empty Example the following will delete the current selection mSelDelete gTable See Also mDeleteRecord V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 177 mSelect V12Table Syntax mSelect gTable gt aecepts partial selections Parameters none Description Trigger the selection process This is required after calls to mSetIndex mSetCriteria and or mOrderBy If no record satisfies the search criteria mSelect returns an empty selection and sets the current record to an undefined value Example select all records of the table and sort them by order of catalog number mSetIndex gTable CatNumberNdx mSelect gTable gelect all items that cost at least 20 and at most 40 mSetCriteria gTable price gt 20 mSetCriteria gTable and price lt 40 mSelect gTable select all items that cost at most 40 and sort them by alphabetic order mSetCriteria gTable price lt 40 mOrderBy gTable name mSelect gTable See Also mSetIndex mSetCriteria mOrder
185. nd before mUpdateRecord Calling any other method aborts the new record adding process and sets the current record to the previous current record Thus if you started to add a record and wish to abort the operation simply call mGetField instead of calling mUpdateRecord Updating Data in a Database Writing data is very similar to reading data Writing data is accomplished with mSetField Prior to updating a field you must set the current record and your intentions must be indicated in V12 DBE with mEditRecord Once this is completed V12 DBE will update your database with mUpdateRecord After calling mUpdateRecord the modified record is kept in a cache it 1s not immediately written to disk Thus if the computer crashes or a power failure occurs the database file on disk may become corrupt To secure the updated record onto the hard disk close the database and open it again see Opening and Closing Databases and Tables V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 87 Writing to Fields of Type Integer Float and String In the following example the name of the current record is changed to funnel and its price to 2 95 mEditRecord gTable mSetField gTable name funnel mSetField gTable price 2 95 mSetField gTable CatalogNumber 1234 mUpdateRecord gTable Like mAddRecord every call to mEditRecord must be balanced with a call to mUpd
186. ned in Create or ReadWrite mode Database structure not created properly Missing index Table s must contain at least one index Unable to edit database structure Unable to modify database structure Use mEditDBStructure and mUpdateDBStructure to change a database structure Unable to build database Database must be opened in Create or ReadWrite mode Unable to update database structure At least one index per table is required Unable to build database structure At least one index per table is required Wrong number of parameters Invalid password Password should not exceed 32 characters Invalid character s in password Wrong password s does not match with the current password 5450 5610 5620 5630 5640 5650 5660 5670 5680 5690 5700 5810 5820 5830 5840 5850 5860 5870 5880 5890 5900 5910 5920 5930 5940 5950 5960 5970 5980 5990 6010 Unable to write to database Database must be opened in ReadWrite mode Wrong number of parameters Database structure not created properly Invalid output format Please consult the manual to get a description of the different output formats Table s does not exist Field s does not exist in table s Can only get size information on fields of type Media or String Invalid table name Invalid field name Empty table name Empty field name Property does not exist Invalid prope
187. ngo List result would be set x mGetSelection gTable List 1 mSelectCount gTable name and the result would be Batteries Floppies Labels Pencils Ruler Tags Note This 1s a list where each element is itself a single element list The syntax for the Property List result would be set x mGetSelection gTable PropertyList 1 mSelectCount gTable name and the result would be name Batteries name Flsoppies name Labels name Pencils Hname Ruler name Tags Reading Records with a Determined Order of Fields This example retrieves the content of all the records of the selection with TABs as field delimiters and CARRIAGE RETURNS CRs as record delimiters with fields ordered in the sequence number name price set x mGetSelection gTable LITERAL 1 mSelectCount gTable TAB RETURN number name price sets the variable x to the following string 6780 TAB Batteries TAB 9 20 CR 9401 TAB Floppies TAB 1 89 CR 1743 TAB Labels TAB 1 19 CR 6251 TAB Pencils TAB 5 55 CR 1431 TAB Ruler TAB 1 99 CR 7519 TAB Tags TAB 6 19 CR The syntax for the Lingo List result would be set x mGetSelection gTable List 1 mSelectCount gTable number name price V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 lntegration New Media Inc 1995 99 page 82 and the result would be 6780 Batteries
188. ning a Database Cloning a database makes a copy of an existing database file with all the table field and index definitions but with none of the data This is similar to creating a database file from a template rather than starting a new project Contrary to creating a database with mReadDBstructure which requires a V12 DBE license to create legal V12 DBE databases this method can be used at runtime Syntax V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 107 mCloneDatabase db instance new pathname Example mCloneDatabase gDB the pathname amp myClonedFile V12 In this example a new database file named Cloned V12 is created using the same tables fields and index definitions as well as the same password as the database file designated by the global variable opp This implies that the original database file designated by the variable gDB must have been opened with the appropriate password prior to proceeding with the cloning An alternate syntax for cloning databases is also supported for the purpose of backward compatibility It is similar to creating a new instance of an existing database and it uses the New method Syntax cloned db instance New Xtra V12dbe new pathname clone mGetRef main db instance where new pathname is the pathname of the database file to be created and main db instance is the database instance that serves as a mode
189. no indexing is required If you need to both index and full index a field see an Index and a Full index on a Field If you try to store a text longer than the size of the buffer allocated for a field type string V12 DBE signals a warning and stores the truncated text into the field Media that are larger than the maximum buffer size of a fields are not stored at all END indicates the end of the descriptor It is a mandatory tag In each line of the descriptor file tokens i e field name index name value etc must be separated by one or multiple Tabs and or space characters A convenient way to build a descriptor file for a database containing a large number of tables fields or indexes is to type it in a spreadsheet thus taking advantage of advanced editing functions The result can then be saved to a TAB delimited file or Copy Pasted to a Director field for processing by mReadDBStructure Example TABLE Recipes FIELDS NameOfRecipe string indexed Calories integer indexed CookingTime integer TextOfRecipe string 5000 full indexed Photo media 300000 END Note A valid database needs exactly one table at least one field and at least one index Defining Both an Index and a Full index on a Field In exceptional cases you would need to define both an index and a full index on a field Since the IndexType parameter defined above can represent only one of V12 DBE for Macromedia Director User Manual ve
190. nt record mSetMedia gTable photo member thePhotoCast or mSetMedia gTable photo member thePhotoCast of CastLib internal See Also mSetField mGetMedia mSetPassword V12dbe Syntax mSetPassword gDB oldPassword newPassword Parameters oldPassword current password newPassword new password Description Change the current password oldPassword to a new one newPassword Either oldPassword and or newPassword can be empty strings Example Change the password very secret to even more secret mSetPassword gDB very secret even more secret change from an empty password to my new password mSetPassword gDB my new password V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 181 mSetProperty V12dbe Syntax mSetProperty gDB prop value Parameters Prop virtualCR characterSet weekDays shortWeekDays months shortMonths Description Set an existing property Prop to value or create a new property named Prop and assigns value to it Special rules apply to properties that start with string see manual Example turn on the verbose property mSetProperty gDB months January February March April May June July August September October November December mSetProperty gDB string MinWordLength String 5 Note See user manual for additional information Se
191. o allow you to initialize or open whatever progress indicator you want to show One parameter is supplied to v12BeginProgress it is either 100 which is the upper bound that is eventually reached by the first parameter at the end of the operation or 1 if no such upper bound is known up front e The v12Progress handler is repetitively called as long as the task is performed Two parameters are supplied to v12Progress The first parameter is the actual progress made so far and thus increases at every call The second one is either 100 which is the upper bound that is eventually reached by the first parameter at the end of the operation or 1 if no such upper bound is known up front Vi2Progress must return FALSE to keep V12 DBE performing the current task or TRUE to abort it See example below e The v12EndProgress handler is called at the end of the task to allow you to cleanup or close your progress indicator In V12 DBE 2 1 only mSelect calls vi2BeginProgress and V12EndProgress with an upper bound of 1 All the other methods i e mrmportFile mExportFile mSelDelete mFixDatabase and mPackDatabase pass an upper bound parameter of 100 Example spinning a custom cursor If you want to spin a custom cursor while V12 DBE is performing time consuming tasks you need to define the following three handlers on V12BeginProgress this is an empty handler Spinning a cursor does not require intialization end V12BeginProgres
192. od caph lamed A OD DO fg We m Mr e e gt mp Gr OD 50 i7 mem 16 nun fi samech o ain 66 phe 66 sadi koph resch sin tau 0 1 2 3 4 5 6 7 8 9 aAAAAAA b B c C d D e E fF gG h H III j J k K IL mM nNN o O 6 p P q Q rR sis tT u U vV w W x X yyYY zZ ZE A V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 162 User definable Custom String Types In addition to V12 DBE s predefined string types you can define your own string types with mSetProperty Up to 32 custom types can be defined including the ones already predefined in V12 DBE To define your own sorting and searching rules build a table similar to the ones listed above in a Director member of type Field Equivalent characters are listed on a single line whereas precedence is indicated by successive lines Then call mSetProperty with the keyword String note the period after String followed by the name of the custom string type For example if your sorting and searching rules are defined in a Director field named Klingon Sort Order and if the new custom string type is Klingon the following statement defines the new custom type mSetProperty gDB String Klingon field Klingon Sort Order From then on the type String Klingon c
193. ode Valid modes are Create ReadWrite ReadOnly and Clone V12 DBE instance was not opened properly Corrupted variables Reboot the computer Invalid pathname File already exists Error at file creation 1900 1910 1920 1930 1940 1960 2210 2410 2810 2820 3010 3020 3030 3210 3220 3230 3240 3250 3260 3270 3280 3290 3300 3310 3320 3330 3340 3350 3360 3370 3380 3390 Error while writing header files File does not exist or is already open Not enough disk space Wrong password Cannot get password Please contact tech support Invalid password Check if the password is not VOID Invalid object Unable to edit database structure Database must be opened in ReadWrite mode Unable to update database structure Database must be opened in ReadWrite mode Not in database structure edition mode Call mEditDBstructure before modifying database structure Wrong number of parameters Invalid pathname Empty pathname Wrong number of parameters Invalid descriptor type Valid types are Text Literal V12 and DBF Invalid database descriptor Check descriptor s syntax Unable to locate decode password Unable to read database structure Field Ser of table s has an invalid index order Valid orders are Ascending and Descending Missing or Unable to open TEXT file Make sure the file is in he specified path and not sed by
194. operty must be a string e g 35 Note Value is limited to 4096 characters mSetProperty can be used to define a new property or to change an existing one Using mSetProperty with a value of EMPTY deletes that property Properties pertaining to Strings see The String Property below cannot be deleted Note mSetProperty is a very powerful tool If you are unsure about what you re doing always work on a copy of your original database Valid PropertyNames and Values are listed below Both parameters must be of type String Both are case insensitive hence resources Resources and RESOURCES are all three equivalent You can retrieve the list of all the properties of a database by calling mGetPropertyNames as in set props mGetPropertyNames gDB Note V12 DBE properties can only be accessed by the mSetProperty and mGetProperty methods They are totally unrelated to Windows 9x NT file properties Predefined Properties ProgressIndicator Read Write persistent Valid values are None With Cancel Without_Cancel UserDefined Default value is None set x mGetProperty gDB ProgressIndicator mSetProperty gDB ProgressIndicator With Cancel Enables V12 DBE to show a progress indicator while performing time consuming tasks or calls back Lingo handlers to enable custom progress indicator implementations See Progress Indicators ProgressIndicator Message Read Write persistent set
195. ord delimiters set x mGetSelection gTable LITERAL 2 3 sets the variable x to the following string Floppies TAB 1 89 TAB 9401 CR Labels TAB 1 19 TAB 1743 CR Pencils TAB 5 55 TAB 6251 CR Reading a Range of Records in a Lingo List This is identical to the previous example except that the result is returned in a Lingo list set x mGetSelection gTable LIST 2 3 sets the variable x to the following list Floppies 1 89 9401 Labels 1 19 1743 Pencils 5 55 6251 V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 80 Reading a Range of Records in a Property List Same as the two previous examples except that the result is returned in a Lingo property list set x mGetSelection gTable PropertyList 2 3 sets the variable x to the following list name Floppies price 1 89 number 9401 name Labels Hprice 1 19 number 1743 name Pencils price 5 55 number 6251 Reading the Entire Content of the Current Record This example retrieves the entire content of the current record in a single call to V12 DBE set x mGetSelection gTable LITERAL mGetPosition gTable 1 sets the variable x to the following string Batteries TAB 9 20 TAB 6780 CR The List and ProperyList would respectively return Batteries 9 20 6780 and name Batteries price 9 20 number 6780 Reading
196. ord delimiter etc If InputType is Access other params are the user name password and table to import The details are explained below Importing from a TEXT File The imported text file must begin with a field descriptor line A field descriptor is a sample record that contains the names of the fields in which subsequent data must be imported see Field Descriptors jin Step 2 Preparing the Data These fields can be listed in any order Some of them can be omitted Syntax mImport gTable TEXT FileName Options where FileName is the pathname of the text file to import and Options is an optional Lingo Property list containing the following properties field delimiter determines which character is used to delimit fields in the text file The default character is TAB ASCII 9 record_delimiter determines which character is used to delimit records in the text file The default character is RETURN ASCII 13 If the Text file contains Carriage Returns ASCII 13 followed by Line Feeds ASCII 10 as records delimiters Line Feeds are automatically ignored character_set is one of Mac Standard Windows ANSI or MS DOS It determines which character set the Text file is encoded in Usually Text files exported on MacOS are encoded in the Mac Standard character set and Text files exported on Windows are encoded in the Windows ANSI character set See Character Sets jin The default character set is the one defined
197. ord to various values related to a given selection mGetPosition mGetPosition checks the position of the current record in a table and returns an integer between one and the total number of records in the selection Example set currRec mGetPosition gTable returns the current record s position in the Message Window put the current record is amp currRec V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 75 mGoNext mGoNext sets the current record to the record following the current record Example mGoNext gTable Suppose that the current record is the tenth item in the selection After calling mGoNext the current record becomes the eleventh If the selection contains only ten records the current record does not change and a warning is reported by V12 DBE see Errors and Defensive Programming mGoPrevious mGoPrevious sets the current record to the record preceding the current record Example mGoPrevious gTable Suppose that the current record is the tenth item in the selection Upon calling mGoPrevious the current record becomes the ninth If the current record is the first record of the selection upon calling mGoPrevious the current record does not change and a warning is reported by V12 DBE see Errors and Defensive Programming mGoFirst mGoFirst sets the current record to the first record of the selection Example mGoFirst gTab
198. orted to V12 tables provided a MS FoxPro ODBC driver is present on your PC No DSN Data Source Name is required Syntax mImport gTable FoxPro FileName where FileName is the path to the source DBF file Always make sure to set V12 DBE s CharacterSet property to the encoding that matches your DBF file s see CharacterSet in Example mImport gTable Excel the pahtname amp Results XLS TableName V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 68 Converting a FoxPro database into a V12 database is a two step process First create the V12 database see mReadDBstructure from FoxPro Win 32 Only Then import data to each of its tables with mImport as explained above Importing from MS Excel Win 32 only MS Excel workbooks XLS can be imported to V12 databases one table at a time through a PC s ODBC driver No DSN Data Source Name is required Syntax mImport gTable Excel FileName TableName where e FileName is the path to the source XLS file It is assumed to be encoded in the Windows ANSI character set default encoding on Windows e TableName is the name of the table to import Example mImport gTable Excel the pahtname amp Results XLS Protected MS Excel workbooks cannot be imported Converting a MS Excel workbook into a V12 database is a two step process First create the V12 database see mporting fro
199. osed to containing the pathname of the descriptor Text file Building a database from a literal description is very similar to the building it from a text file The literal must contain the database descriptor as defined in The Lingo script to build the database is mReadDBStructure gDB LITERAL Variable or Field Name V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 51 For example assume that the Director member of type Field and named descriptor contains a database descriptor the following example creates a V12 DBE database compliant to that description on CreateDatabase set gDB New Xtra Vl12dbe the pathname amp Catalog V12 create top secret CheckV12Error mReadDBStructure gDB LITERAL field Descriptor CheckV12Error mBuild gDB CheckV12Error set gDB 0 end CreateDatabase mReadDBstructure from a DBF File A DBF file alone represents a flat file thus a single V12 DBE table A DBF file can be used as a template for a V12 DBE table in much the same way as a text file or literal can The name of the created V12 DBE table is identical to the DBF filename without the DBF extension The syntax is mReadDBStructure gDB DBF File Pathname For a DBF file to be used as a complete and valid V12 DBE table descriptor at least one index must be defined If that index is defined by an IDX or NDX file located in the same folder as the
200. oses Educational means that V12 DBE is intended for use by students and faculty of educational institutions only for non commercial projects What are my obligations as V12 DBE license holder In your project you must mention Portions of code are Copyright c 1995 99 Integration New Media Inc next to your own copyright notice You must also place the Powered by V12 logo on the packaging of your product or within your product in the Credits section About box or equivalent location The Powered by V12 logo is available on the VI2 DBE CD ROM and on Integration New Media s web site ttp www integration qc ca V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 122 Appendix 2 License Agreement PLEASE READ THIS LICENSE AGREEMENT CAREFULLY BEFORE USING V12 DATABASE ENGINE BY USING V12 DATABASE ENGINE YOU AGREE TO BECOME BOUND BY THE TERMS OF THIS LICENSE AGREEMENT The enclosed computer program s license file and data collectively Software are licensed not sold to you by Integration New Media Inc Integration for the purpose of using it for the development of your own products Products only under the terms of this Agreement and Integration reserves any rights not expressly granted to you Integration grants you no right title or interest in or to the Software The Software is owned by Integration and is protected by International copyright l
201. osition mGoLast V12Table Syntax mGoLast gTable Parameters none Description Set the current record to the last record of the selection Example mGoLast gTable See Also mGoFirst mGoPrevious mGoNext mGo and mGetPosition V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 174 mGoNext V12Table Syntax mGoNext gTable Parameters none Description Set the current record to the record following the actual current record in the selection Example mGoNext gTable See Also mGoFirst mGoLast mGoPrevious mGo and mGetPosition mGoPrevious V12Table Syntax mGoPrevious gTable Parameters none Description Set the current record to the record preceding the actual current record in the selection Example mGoPrevious gTable See Also mGoFirst mGoLast mGoNext mGo and mGetPosition mlimport V12Table New method import from Text DBF ODBC drivers mlimportFile V12Table Syntax mImportFile gTable inputType inputData fieldDelimiter recordDelimiter l Parameters inputType type of the file to import LITERAL TEXT V12 DBF inputData pathname of file to import fieldDelimiter and recordDelimiter single character delimiters V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 175 p
202. ove from one record to the next in the selection Besides sorting a table through indexes you can find information based on search criteria You can define simple search criteria also called simple queries such as e First name is Jack e State is California e Number of points is less than 30 e Last name begins with P Or you can define complex search criteria also called Boolean queries using and or such as e First name is Jack or Last name begins with P e State is California and Number of points is less than 30 e State is California and Number of points is less than 30 and Last name contains pe V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 34 Database Management Systems that use SQL as their programming language can define search criteria such as Dish is soup or appetizer and Main Ingredient is celery or eggplant or pumpkin V12 Database Engine does not support this alternation of ANDs and ORs See Advanced Boolean Searches for possible workarounds V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 35 Using V12 DBE Overview This section covers the main steps in using V12 DBE If you have looked at the First Steps manuals you should already be familiar with these five steps V12 DBE Basics V12 DBE is a powerful database management engine composed of two Xtras librar
203. page before printing it To preview a page call printPreview doc To print a document call print doc The reports printed by the above PrintOMatic sample scripts are not visually identical to the ones illustrated in the mPrint section You need to add a few page layout and font styling scripts to match those illustrations V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 146 Appendix 12 Optimization Using Indexes Two methods in V12 DBE take advantage of database indexes mOrderBy and mSelect mSelect chooses the index that delivers the fastest search time based on the database structure It does an excellent job most of the time However it can be fooled in some extreme cases where the actual data in the database is not uniform In such cases you can optimize your queries to further improve searching time mOrderBy indifferently uses any one index defined for the field it sorts if more than one such index is defined There is no performance handicap in using one index or another However at any time only one index can be used by V12 DBE Thus if you call morderBy and mSelect in a single query V12 DBE uses the best index it can to build the selection and then sorts the selection without relying on indexes mSelect chooses its best index based on the following algorithm Assume that your query is Fieldi A AND Field2 starts B AND Field3
204. pening tag for database descriptors must be followed by a blank character such as a space tab or CARRIAGE RETURN Likewise a comment closing tag must be preceded by a blank character Thus invalid comment will generate an error is an invalid comment whereas valid comment is valid V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 48 Using the V12 DBE Tool To create a V12 database using the V12 DBE Tool 1 Choose File gt New 2 Fil out the Database Descriptor field according to the syntax described in Database Descriptors 3 Provide a name and optionally a password for your new V12 database 4 Click the Create button Instead of filling out the Database Descriptor field manually in the V12 DBE Tool you can edit it in a text file and load that text file to the Tool s Database Descriptor field You can also directly read the structure of a DBF file or of another V12 database into the Tool s Database Descriptor field For more information see the V12 DBE Tool s User Manual Scripting the Database Creation Automating the creation a V12 database through Lingo with V12 DBE consists in three steps e Creating an Xtra instance of the database with New e Defining its structure with mReadDBstructure e Building the database with mBuild The general form of a database creation Lingo handler is on CreateDatabase set gDB New Xtra Vl12
205. plete example of a script that would run on startMovie on StartMovie global gDB gTable set gDB New Xtra Vl12dbe the pathname amp Catalog V12 ReadWrite pwd CheckV12Error set gTable New Xtra V12table mGetRef gDB Articles CheckV12Error end StartMovie Closing a Table To close a table set the variable that refers to it to 0 Example set gTable 0 Closing a Database To close a V12 database set the variable that refers to it to 0 Example set gDB 0 Always make sure to dispose of all V12table instances before you dispose of the V 12dbe instance that contains them Following is a complete example of a script that would run on StopMovie on StopMovie global gDB gTable set gTable 0 set gDB 0 end StopMovie Selection and Current Record To read or write data to a record set it as the current record The current record concept is strongly related to the concept of selection Both concepts are fundamental to this section See Database Basics karlier in this manual for more details At any time the selection is sorted according to one of its fields You can enforce that sorting order with morderBy see Porting a Selection mOrderBy Otherwise the V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 74 selection s sorting order would be defined by the index chosen by V12 DBE for its last search The field that determines th
206. ponent is used for storage and retrieval Any V12 DBE field of type integer float date or string can be used to store a text member through the following syntax mSetField gTable fieldName member For example assume that gTable contains a field of type string named Banner and that member 28 is a Text member containing the anti aliased text The Tiger in your Engine mSetField gTable banner member 28 stores the styled Text member 28 in the field Banner Technically the string The Tiger in your Engine is stored in the field Banner and the media component of the Text member is stored in an hidden Media field To retrieve styled text call nGetMedia as follows mGetMedia gTable Banner member myBanner This instruction retrieves the banner image from the V12 DBE database and places it in the member named myBanner Note that the V12 DBE field Banner mentioned above is of type string and not media Alternatively you can retrieve the content the individual characters of the data contained in the field Banner as follows set aText mGetfield gTable Banner assigns The Tiger in your Engine to aText If for some reason your script does the following mSetField gTable banner member 28 mSetField gTable banner the text of member 28 the second call to mSet Field would replace the content of the field Banner with the unformatted text contained in member 28 This would replace any image asso
207. port such failures e Any attempt to retrieve the content of a locked record using mExportFile mGetSelection etc will return a warning and cancel the action e If many users proceed to making modifications on the same table simultaneously synchronization problems may arise between the actual content of the table and the selection as reflected in the users V12table instances Such instances must be refreshed by invoking mSelect To detect whether a table was modified by another user call mNeedSelect at any time mNeedSelect returns TRUE if records were added deleted or modified since the current instance last called mSelect In some cases it is a good idea to check for mNeedSelect on idle and refresh the displayed records when signaled to do so Example on idle if mNeedSelect gTable then mSelect gTable do wathever necessary to refresh the display end if end idle Counting the number of Users The sharedRWcount property is ReadOnly and non persistent It returns the number of users currently sharing the V12 DBE database file in Shared ReadWrite mode Syntax mGetProperty gDB sharedRWcount V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 129 Possible Configurations E 7 Projector Projector X DX DX 12DBE REMOTE Y12DBE SERVER Scenario 1 User 1 and User 2 access the same V12 database on a Remote Server Thi
208. put mGetField gTStudents LastName amp RETURN after field result end repeat Example if we run this script on the above example we would get Cartman Broslowsky This script lists the last names of all the students that match the specified criteria in a Director member in contrast to the previous script which leaves them in a V12 DBE selection Although a V12 DBE selection can be easily dumped to a Director field the opposite is not true Thus if you need to further manage the list of last names created above you must set the current record to the one that matches a specific last name s and then perform the required operation This is sometimes called the lazy approach whereby a piece of data is accessed only when it is needed as opposed to processing data before it is actually needed which may yield faster results but at a higher pre processing overhead V12 DBE s high speed data search and retrieval routines enable you to implement the lazy approach without handicap of performance Resolving a Many to Many Relation Resolving Many to Many relations is much more complex than resolving other types of relations Even powerful query languages such as SQL cannot perform this operation in a simple way A typical Many to Many relation resolving question in the above example would be list the last names of all the students who took Mrs Crabtree s tests Assuming that table Tests possibly contains zero one or more tests authored by
209. r Its main purpose is to group a field s content between two identical marks so to enable the occurrence of field and record delimiters without the risk of confusion Example Name Description CR Hat high quality excellent fabric available in CRFRedC A GreenC A Blue Shoe this description field contains commas and CarriageC A Returns V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 40 Text qualifiers are automatically placed in text files exported from MS Access FileMaker Pro Mail Merge format and MS Excel only for fields that contain commas Text files containing Text Qualifiers are easily imported to V12 databases by setting the mImport method s TextQualifier property to the right character See Importing Data into a V12 DBE Database Importing Data with mImport Custom Delimiters Another way to avoid delimiter ambiguity is to choose delimiters other than TAB and cr Some database management systems allow you to select appropriate delimiters before exporting a TEXT file eg 4 Dimension Some others allow only the selection of a custom field delimiter and always use CRs as records delimiters e g MS Access FileMaker Pro and MS Excel do not allow for any customization V12 DBE s mImport method assumes by default that the field and record delimiters are TAB and CR However other delimiters can be specified See Step 4 Importing
210. r PhotoMember This example stores the content of the field photo from the current record into the member named PhotoMember in Director s internal castlib If more than one castlib is used in a project mGetMedia can also retrieve media to any castlib through the following syntax V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 86 Example mGetMedia gTable photo member 28 of castlib album Adding Records to a Database To add a new record to a V12 DBE table use mAddRecord Calls to maddRecord must be balanced by mUpdateRecord In the following example a new record is created for the item goggles and its price is set to 158 99 mAddRecord gTable mSetField gTable ItemName Goggles mSetField gTable Price 158 99 mUpdateRecord gTable If mUpdateRecord is not called the record created with mAddRecord is not saved to the database After calling mUpdateRecord the record is created and kept in a cache it is not immediately written to disk Thus if the computer crashes or a power failure occurs the database file on disk may become corrupt To secure the newly added records onto the hard disk close the database and open it again see losing Databases and Tables New records are always added to the end of the selection regardless of the criteria used to form the selection Only mSetField and mSetMedia can be called after mAddRecord a
211. r in by as By default the StopWords property is empty A typical list of stop words in English 1S a by in the an for is this and from it to are had not was as have of with at he on which be her or you but his that Note Remember that at most 4096 characters can be stored in properties V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 119 Custom Properties Advanced Users Advanced users may want to define their own properties and make them persistent to a database This is a convenient way to store preferences in your database and it eliminates the trouble of having to create a table that includes only one record For example if you need to save the frame last visited by the user prior to leaving your application possibly to bring him her back to that same frame next time on StopMovie global gDB mSetProperty gDB LastVisited string the frame Typcasting to string is mandatory here Some other housekeeping tasks end StopMovie The startup handler of your movie would contain the following on StartMovie global gDB create database instance etc set LastVisit integer mGetProperty gDB LastVisited if LastVisit gt 0 then go to frame LastVisit other housekeeping tasks end StartMovie Custom properties are always read write and persistent V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlInte
212. r logs at every call to V12 DBE Months Read write persistent Valid values any 12 word string The Month property contains the names of the months used by mDataFormat to format dates the MMMM pattern in mDataFormat The Value parameter is any 12 word string Words must be separated by spaces Names of months that contain spaces themselves must be enclosed between apostrophes Example mSetProperty gDB Months Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre ShortMonths Read write persistent Valid values any 12 word string The ShortMonth property contains the short names of the months used by mDataFormat to format dates the MMM pattern in mDataFormat The Value parameter is any 12 word string Words must be separated by spaces Short names of months that contain spaces themselves must be enclosed between apostrophes Example V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 115 mSetProperty gDB ShortMonths Jan F v Mar Avr Mai Juin Juil Ao t Sep Oct Nov D c Weekdays Read write persistent Valid values any 12 word string The Weekdays property contains the names of the weekdays used by mDataFormat to format dates the DDDD pattern in mDataFormat The Value parameter is any 12 word string Words must be separated by spaces Names of weekdays that contain spaces themselves must be en
213. re cross platform compatible and others are not As a general rule everything that can be executed is not cross platform compatible Applications DLLs Xtras EXE files are all executable and include the following e Macromedia Director e Projectors generated by Macromedia Director e the V12 DBE Xtras Everything that is a static document is cross platform compatible This includes e Director movies either protected or not e VI2 DBE databases The following figure identifies which files are specific to Macintosh or Windows and which files are compatible to both Macintosh and Windows Macintosh and Windows Director for Windows a Director for Macintosh Director movies DIR DXR Shockwave movies DCR Windows only Macintosh only Projector for Windows IJ Projector for Macintosh V12 DBE Xtras for V12 DBE Xtras for Windows Macintosh V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 133 Appendix 8 Data Updating and Sort Orders Updating a field that is used in the current index can yield a potentially unwanted although consistent behavior For example imagine a database that has the following structure TABLE MyFavoriteThings FIELDS Preference integer indexed Thing string END it contains the following 10 records 50 Bright copper kettles s Warm woolen mittens 60 Round paper packages tied up
214. red to fields of type Date However date formatting is limited to the range Jan 1 1904 through Dec 31 2037 e No two fields or indexes can have the same name in the same table However two fields or two indexes might have the same name in different tables e Fields of type media can hold any type of media that can be stored in a Director member except Film Loops and QuickTime movies e Up to 32 custom string types can be defined V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 126 DBF files of type DBase HI DBase IV DBase V FoxPro 2 0 FoxPro 2 5 FoxPro 2 6 FoxPro 3 0 and FoxPro 5 0 can be imported exported and used as templates for the definition of V12 databases Fields of type DateTime are not supported The following DBF data types are ignored General Character Binary Memo Binary On Win9x NT MS Access databases MS FoxPro files MS Excel workbooks and MS SQL Server data sources can be used as templates to create new V12 database and as sources of data to import records from through ODBC drivers The exact database translation data importing rules varies among ODBC drivers and versions of ODBC drivers Identifiers names of fields tables and indexes are limited to 32 characters They must start with a low ASCII alphabetic character a z A Z and can be followed by any alphanumeric character 0 9 a z A Z a 6 Keywords such as NOT AN
215. rsion 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 158 15 96o N LSA ed vr N SE den S lr WN o dat LA a 6 OD mr cg CC dD e E fF gG hH ii i 1Iif j J k K IL mM n fi N N o ee O 0 p P q Q rR sBS tT u U v V w W x X yyvY ZZ e oO aA V12 DBE for Macromedia Director User Manual lntegration New Media Inc 1995 99 version 3 0 99 07 27 page 159 Predefined Custom String Types Along with the standard string type V12 DBE contains a number of predefined custom string types They include Swedish Spanish and Hebrew Searching and Sorting rules for Strings of Type Swedish If the tables below are not properly formatted in the HTML version of this manual please refer to the PDF version 1 yoo 2 3 tj 4 2 5 6 Te OT 8 Qu ew 0 1 2 3 4 X 5 o 6 7 s Ti 9 20 21 C 22 lt gt 23 24 25 26 27 28 29 30 5 31 32 u 33 amp 34 35 36 f 37 amp 38 0 39 1 D NS 90 JI ON tn P C2 N e E fF g G hH i i 1Ijif j J k K IL mM n fi N N o 6 e 00000 p P q Q rR sBS tT u U vV w W x X yyvY ZZ oO a
216. rsion 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 46 indexed or full indexed you would need to set it to indexed and define the full index separately under an additional tag named FULL INDEXES The FULL INDEXES tag must follow the FIELDS section and must be followed by a list of fields to be full indexed one per line Example TABLE Recipes FIELDS NameOfRecipe string indexed Calories integer indexed CookingTime integer TextOfRecipe string 5000 indexed Photo media 300000 FULL INDEXES TextOfRecipe END Alternate Syntax for Creating Indexes Database descriptors support an alternate syntax to create indexes The INDEXES tag can be used right after the fields definitions to explicitly name and define the desired indexes This alternate syntax is used by mDumpStructure for clarity see Structure of a Database L This database descriptor example is equivalent to the one above TABLE Recipes FIELDS NameOfRecipe string Calories integer CookingTime integer TextOfRecipe string 5000 Photo media 300000 INDEXES NameOfRecipeNdx duplicate NameOfRecipe ascending CaloriesNdx duplicate Calories ascending TextOfRecipeNdx duplicate TextOfRecipe ascending FULL INDEXES TextOfRecipe END Defining Compound Indexes Compound indexes are indexes defined on two or more fields see ompound Indexes Compound indexes can be defined after the INDEXES tag as in TABLE Students FIELDS L
217. rted dbf field type Unable to select records beyond end of selection 1d record s in selection Unable to select records preceding first record of selection Current record is edited by another user Data could change mEditRecord already called Call mUpdateRecord prior to calling mEditRecord again No current record Cannot generate a member beyond the size of the castLib Field s is already full indexed in table s Already in database structure addition mode Selection empty No current record Field s of type Media cannot be retrieved with mGetSelection V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 191 4 Ascending keke 96 ASCII Character Set 42 B Basics Documentation 24 Binding Automat 93 IR 91 Elle 92 CHE 93 j e N D v 92 Boolean operator U Ee 100 Butter SIZE si xiyan nihin i sene kinn 46 C Capacities A L eee eke 129 Character Set 33 42 117 163 Cloning ee nee ed 109 Closing an Xa 22 Comments in database descriptors 48 Compressing a Database file 110 Corrupted Database Files 111 Creating Database eee e 49 Xtra Instance 21 50 Current Record 75 76 D Data Formatting 79 85 Data Model 38 Data Preconditioning
218. rtition allocated to Director or for projectors generated by Director For more advanced development you may need to increase the memory partition In either cases try to establish the minimum equipment requirements of your project as conservatively as possible Windows Version Any PC running Windows 3 1 95 Windows 98 or Windows NT that is capable of running Macromedia Director plus 1 Mb of free disk space The amount of memory allocated to an application cannot be configured on Windows This means that an application can borrow as much memory as needed from the Operating System It also means that Windows shows unpredictable behaviors when it is short of memory Try to establish the minimum equipment requirements of your project as conservatively as possible Macromedia Director Macromedia Director version 5 0 or later is required V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 13 Do really need to master Lingo to use V12 DBE How comfortable do you need to be with Lingo to use V12 DBE efficiently The answer varies according to the complexity of your projects Simple projects require no knowledge of Lingo at all If your project uses a single database and shows one record at a time on Director s stage chances are that you can implement it using the V 2 DBE Behaviors Library only No Lingo required For more advanced projects V12 Database Engine s compreh
219. rty Missing apostrophe A sub String was left open ended Unable to write to database Database must be opened in ReadWrite mode Cannot delete or set the property value to blank Cannot modify the property value Cannot change verbose value Invalid verbose type Cannot set week days Invalid number of days Cannot set months Invalid number of months Cannot modify property The string type associated does not exist Cannot modify property The string type associated is already used Cannot modify MinWordLength property This property must be greater than 0 and smaller than 100 Cannot define new string type String type names cannot contains periods dots Cannot set property name Too many characters Cannot set new string type The maximum number of custom string types is reached Invalid log value Must be set to on or off Invalid maximum value Must be a number between 1 and 1000 Invalid progress indicator value Must benone with cancel without cancel or userdefined Invalid Character Set value Must beDos US Mac Standard Windows ANSI or Default Property does not exist V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 188 6110 6120 6130 6140 6150 6160 6170 6180 6190 6200 6210 6220 6410 6420 6430 6440 6450 6460 6470 6480 6490 6810 6820 6830 6840 6850 6860 6870 6880
220. s on V12Progress prog limit rotate cursor cast members limit is ignored because spinning a cursor does not need to reach an upper bound cast 27 first of series 4 cursors cast 3l1 mask empty cursor 27 prog mod 4 31 return FALSE end V12Progress on V12EndProgress cursor 1 restore pointer cursor end V12EndProgress In this example V12BeginProgress is an empty handler but it must be present V12Progress only uses the prog parameter because it indefinitely rotates among four V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 111 cursors which are one bit depth members defined in members 27 28 29 and 30 V12EndProgress is responsible of restoring the standard pointer cursor The Progress Mini Sampler available on http www integration qc ca demonstrates other uses of progress indicators including user defined ones Checking the Xtra s Version At authoring time you check the V12 DBE Xtra s version by opening its Get Info window in the MacOS Finder or by checking its Properties in Windows Explorer Both at authoring time and runtime you can call mxtraVersion to retrieve the version of the Xtra Example set v mXtraVersion xtra vi12dbe put v puts V12 3 0 0 Multi User in message window if char 1 of item 2 of v 3 then Alert not version 3 Changing a Password You can change the password assigned to a database by
221. s D 5 DDDD Thursday MM 01 DD MM 05 01 MMM DD YY Jan 05 95 On D MMMM YYYY On 5 January 1995 Weekday DDDD Month MMMM Weekday Thursday Month January In this last example apostrophes around Weekday and Month are mandatory otherwise the d in Weekday and the m in Month would interfere with the pattern itself To specify real apostrophes within date patterns use two consecutive apostrophes When a table is first opened the default format of all its Date fields is set to YYYY MM DD By default the names for the months in V12 DBE are MMMM January February March April May June July August September October November December The short names for the months are MMM Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec The names for the weekdays are DDDD Sunday Monday Tuesday Wednesday Thursday Friday Saturday The short names of the weekdays are DDD Sun Mon Tue Wed Thu Fri Sat All of these names can be replaced by custom names through the properties of the database see Properties of Databases Note If a formatting pattern is assigned to a field all values retrieved from that field become strings see ypecasting n Database Basics Reading Fields of Type Media mGetMedia retrieves data from fields of type media and stores them directly in the designated Director member Syntax mGetMedia gTable fieldName DirMember Example mGetMedia gTable photo membe
222. s is an invalid index order Valid orders are Ascending and Descending Unable to create index Call mEditDBstructure then create new tables and new fields before creating new indexes V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 187 4610 4620 4630 4640 4650 4660 4670 4680 4690 4700 4710 4910 4920 4930 4940 4950 4960 4970 5110 5120 5130 5140 5150 5160 5170 5410 5420 5430 5440 Maximum number of indexes reached The maximum is ld Empty table name Empty index name Empty field name Empty index type Valid types are Unique and Duplicate Empty index order Valid orders are Ascending and Descending Field s already used in index s of table s Unable to edit database structure Database must be opened in Create or ReadWrite mode Field s of type Media Specified in table s cannot be indexed Unable to edit structure of table s Table already built Cannot create compound index s Limited to ld field s per index Unable to delete table Database must be opened in Create or ReadWrite mode Unable to edit database str cture Call mEditDBstructure first Table s does not exist Unable to open table Empty table name Table already in use Set all instances of a table to zero before deleting it Cannot delete table Database must be ope
223. s pictures sounds palettes etc A field would then be of type string integer float date or media Fields of type Media can accommodate any media that can be stored in a cast member except for Film Loops and QuickTime movies See JAppendix 3 Capacities and Limits at the end of this manual for a formal definition of each field type For example if you wanted to organize a contest where each person listed in your address book is collecting points you would need to keep track of the number of points accumulated by each person Therefore you would update your address book to include a new field number of points Since you would want to search and sort this new field quickly you need to define an index This new field could be one of two types string or integer If you define the new field as type string you might end up with the following listing when the table is sorted by ascending order of points Jordan Ann 1 Brown Charles 12 Peppermint Patty 127 Pintado Jack 6 Van Damme Lucie 64 This order occurs because the string 12 is alphabetically lower than the string 6 given that the ASCII code for 1 is 49 which is smaller than the ASCII code for 6 54 To sort the list in the expected ascending order you must define the field number of points to be of type integer to get the following result Jordan Ann 1 Pintado Jack 6 Brown Charles 12 Van Damme Lucie 64 Peppermint Patty 127 Typecasting Typecasting or casting for
224. s Library s efficient built in error management You just need to make sure that the appropriate check boxes are checked when dragging dropping behaviors V12 DBE s Lingo interface provides methods that allow you to keep a close check on your programming Use the global functions vi2Status and V12Error to confirm each step of database creation and handling As well Director has two interesting tools to help you detect your Lingo scripting errors the Watcher and the Debugger both available in the Windows menu V12 DBE s error detecting functions the Watcher and the Debugger can be used together to efficiently debug your scripts Checking the Status of the Last Method Called Call vi2Status after each call to V12 DBE methods both V 12dbe and V12table methods to check its outcome v12Status returns 0 if no error occurred during the execution of that method Otherwise it returns a non zero error code Example set aPrice mGetField gTable price set errCode V12Status if errCode lt gt 0 then Alert Mayday Mayday mGetField returned error code amp amp errCode end if If v12Status returns a non zero result you can call Vi2Error to get the details of the error When called with no parameters as in V12Error this global function returns a plain English explanation of the outcome of the last called method If an error occurred in that last call to V12 DBE v12Error provides a detailed contextual report on i
225. s all cases where the field muffin contains chocolate mSetCriteria gTable muffin wordEquals chocolate This instruction combines a full text search in two fields with an ordinary search mSetCriteria gTable muffin wordEquals chocolate mSetCriteria gTable or donut containsWord chocolate mSetCriteria gTable and name starts Shlomo mOrderBy gTable price selection doesn t apply to full Index mSelect gTable See Also mSelect mOrderBy V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 179 mSetField V12Table Syntax mSetField gTable fieldName value Parameters fieldName name of the field who s content is modified in the current record value value to assign to the field fieldName of the current record Description Set the content of field fieldName of the current record to value If value is not of the same type as fieldName V12 DBE casts it to the appropriate type If fieldName is a date value must be a valid date in V12 DBE s raw format YY Y Y MM DD Calls to mSetField must be preceded by a call to mEditRecord or to mAddRecord and must be followed by a call to mUpdateRecord Example editing an existing record mEditRecord gTable mSetField gTable description field myDescription mSetField gTable height integer field height mUpdateRecord gTable adding a
226. s here this is a purely academic example no error trapping is performed set gDB New Xtra V12dbe the pathname amp Catalog V12 ReadWrite top secret set gTable New Xtra V12table mGetRef gDB Articles import the text data mImport gTable TEXT the pathname amp Data txt V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 70 loop on each record and import the matching image repeat with i 1 to mSelectCount gTable record i becomes the current record mGo gTable i get the photo s filename and import it in a member set catNbr mGetField gTable catalogNumber set the filename of member DummyMember to the pathname amp catNbr assign the photo to the appropriate V12 DBE field mEditRecord gTable mSetMedia gTable photo member DummyMember mUpdateRecord gTable end repeat set gTable 0 close the table instance set gDB 0 close the database instance The mAddRecord mSetField mGetField and mUpdateRecord methods are explained in greater detail Using a VI2 DBE Database V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 71 Step 5 Implementing the User Interface Steps 1 throug Step 1 Deciding on a Data Model through Btep 4 tep 4 Importing Data Data into a V12 DBE Database explain how to design build and import data into a V12
227. s is the typical multi user access configuration eg eg KE Projector Projector x DX DX Y12DBE Y12DBE N Filev12 Scenario 3 User 1 with two distinct Projectors each with its own copy of the V12 DBE Xtra share a single V12 database NOTE for the Mac version to properly run in this scenario File Sharing must be set and the V12 database must be in a shared folder EZ ez V NV Projector Projector axe axe 12DBE 12DBE Filev12 Scenario 2 User 2 accesses the same V12 database file as User 1 on User 1 s computer User 1 and User 2 use separate instances of the projector and V12 DBE Xtra USER 1 USER 2 ER Ne Projector aye V12DBE File v12 Scenario 4 User 1 and User 2 share the same projector V12 DBE Xtra and V12 DBE database file this scenario requires a locked projector file on a Windows computer V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 130 Appendix 5 Multiple Instances of a Table In some applications it is useful to create more than one Xtra instance for a given table The advantage of such a duplication is to keep several selections and several current records for the same table Example set gTablel New Xtra V1l2table mGetRef gDB articles set gTable2 New Xtra Vi2table mGetRef gDB articles mOrdreBy gTablel price mOrdreBy gTable2 name mSe
228. script table gTScores selection would contain SCORES TestlD StudentlD Score 1284 127 45 1081 127 90 2015 127 98 Resolving a Many to One Relation Resolving a Many to One relation would be something like given a score record which student does it belong to The script that answers this question is first get sID of Score record SID mGetField gTScores StudentID mSetCriteria gTStudents ID sID mSelect gTStudents At the end of this script gTStudents current record is the one gTScores s current record is related to Example if the current record in table gTScores was 1081 128 75 the corresponding record in table gStudents would be 128 Broslowsky Kyle Another more complex Many to One relation resolving question would be list the last names of all the students who scored 75 or higher at test number 1081 It can be answered by the following script first locate all Scores records that match criteria mSetCriteria gTScores TestID 1081 mSetCriteria gTScores AND Score gt 75 mSelect gTScores loop through all Student Ids and append them to member result put EMPTY into field result repeat with i 1 to mSelectCount gTScores mGo gTScores i sID mGetField gTScores StudentID V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 152 mSetCriteria gTStudents ID sID mSelect gTStudents
229. t Example set aPrice mGetField gTable price set errCode V12Status if errCode lt gt 0 then Alert V12Error end if When called with a parameter as in V12Error errCode this function returns the generic explanation of the code errCode regardless of the last called V12 DBE method Example put V12Error 600 returns V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 103 Table s does not exist As shown in this last example V12Error sometimes returns strings which contain placeholders for context specific information such as s or ld This is because the returned message is a generic explanation of the error code 600 When called without parameter V12Error returns a contextual explanation with the actual non existing table name instead of s CheckV12Error The Checkv12Error Lingo handler is often used throughout this manual and in sample projects It is a generic error handling routine that centralizes all the error management logic is a single handler That way it can more easily be adapted from one project to the other or from a debugging mode to a delivery mode e g the debugging mode would display alerts whereas the delivery mode would write an error log to an external file with the FileIO Xtra on CheckV12Error if V12Status then alert V12Error return TRUE end if return FALSE end CheckV12Error Errors
230. t see Belection and Selecting All the Records of a Table Exporting in TEXT Format The syntax for exporting all the fields of a table s selection is mExportSelection table instance TEXT FileName The above instruction exports all the fields of the selection to the file named FileName The field and record delimiters are TAB and CARRIAGE RETURN respectively To specify custom field and record delimiters use mExportSelection table instance TEXT FileName FldDelimiter RecDelimiter Example mExportSelection gTable TEXT Output txt n This example exports the selection in a text file named Output txt with the field delimiter and the record delimiter 96 mExportSelection can also export only selected fields in the following way mExportSelection table instance TEXT FileName FldDelimiter RecDelimiter Fieldl Field2 Example mExportSelection gTable TEXT Data TXT TAB RETURN ItemName catalog number price This example exports the selection in a text file named Data TXT with TAB and RETURN delimiters The only exported fields are ItemName catalog number and price in that order The first line in the exported file contains the names of the exported fields separated by the selected field delimiter The resulting text file is in the character set of the current Operating System this is relevant only if accented characters are present in the exported data V12 DBE
231. t in a safe place If you forget it you will not be able to open your database again Example set gDB New Xtra Vl12dbe Catalog V12 Create top secret For a number of reasons the creation of an Xtra instance can fail insufficient memory invalid file path etc Always make sure that your database instance is valid by checking V12Error see Errors and Defensive Programming ObjectP see Checking if New Was Successful Im before pursuing the database creation process Step 3b Defining the Database Structure The next method after successfully creating a database Xtra instance is to call mReadDBstructure to read in the database structure you designed at Deciding on a Data Model mReadDBstructure requires one the following inputs e a database descriptor as defined in Database Descriptors Such as descriptor is supplied either as a text file or as a literal 1 e a Director field or variable V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 50 e a DBF file DBase which serves as a table template e aVI2 database which serves as a database template e a directory containing one or more MS FoxPro files which serve collectively as a database template Windows 32 only requires the FoxPro ODBC driver e a MS Access database which serves as a database template Windows 32 only requires the Access ODBC driver e a MS Excel workbook which s
232. t nbUsers mGetProperty gDB SharedRWcount DBversion Read only non persistent Returns the version of the V12 DBE Xtra used to create the database Example set v mGetProperty gDB DBversion put v V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 117 The above example puts V12 3 0 0 Multi User in the message window The String Property The String property is covered in a separate section because other sub properties Delimiters StopWords and MinWordLength depend on it Properties below must be modified before fields of the corresponding string types are created in the database String Language Read write persistent Valid values any valid search sort table see Appendix 16 String and Custom String Types The String property defines or modifies custom string types i e string fields that obey to particular searching and sorting rules To define a new string type or modify an existing one you append its name to String The chosen name must be a valid identifier and cannot contain periods Example mSetProperty gDB String Klingon field CompTable In this example field CompTable contains the search sort descriptor for Klingon as defined in Appendix 16 String and Custom String Types Once this property is defined you can use the type Klingon to define new fields with mcreateField or mReadDBstructure You also need to de
233. t to be the previous record in the selection according to the present current record If for example you run the following script mSetCriteria gT Age gt 30 mOrderBy gT LastName mSelect gT and get the following selection FirstName LastName Age Marie Curie 39 Albert Einstein 75 Kurt G del 36 Mona Karp 53 Joe Karp 31 Richard Karp 62 Eric Kartman 31 Marshall McLuhan 48 John Von Neumann 51 Claude Shannon 33 Alan Turing 36 The selection s Master Field is LastName Thus a call to mFind would automatically look for values in this field For example mFind gT First Kar current rec becomes Mona Karp s mFind gT Next current rec becomes Joe Karp s mFind gT Next current rec becomes Richard Karp s mFind gT Next current rec becomes Eric Kartman s mFind gT Next current rec remains Eric Kartman s mFind gT Previous current rec becomes Richard Karp s mFind can be used to quickly locate one occurrence of a keyword in a selection where many duplicate values exist as opposed to mSetCriteria and mSelect which find all occurrences but need more time V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 77 Because mFind uses the selection s Master Field it is advised that you call morderBy with the appropriate field before calling mSelect and mFind see Searching Data
234. tBirthNdx index thus resulting in a selection sorted by YearOfBirth V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 149 Appendix 13 Resolving Relations A relational database stores data in two or more tables and establishes links between records For example if you are tracking students scores you would have two tables one to identify students and one to log tests results Following is a typical relational database structure for student tracking TABLE Students FIELDS ID integer indexed LastName string indexed FirstName string Email string Faculty string TABLE Scores FIELDS StudentID integer indexed TestID integer indexed Score integer indexed TimeSpent integer Table Students and Scores are related to each other through their respective ID and Student ID fields A shorthand notation to express this is LAN Students ID Scores StudentID 1 N means that many records in the Scores table can be related to a single record in the Students table and that to each record in the Scores table is related to exactly one record in the Students table This is called a One To Many relation Example SCORES TestID StudentID Score STUDENTS 1081 Ez 90 ID LastName FirstName ede 1284 Fc 45 Her Cartman Eric RE 2015 m 98 H28 Broslowsky Kyle 1081 75 129 McCormick Kenny 2015 128 65 Ta 1081 129 66 If you look at the relatio
235. tabase s name FileXtra a free Xtra delivered with recent versions of Director also available for download at ttp www littleplanet com kent kent html comes in handy as shown below let fName be your V12 database s name first make sure to set all table instance to O0 mPackDatabase gDB the pathname amp temp V12 if CheckV12Error then exit don t continue if pack failed DeleteFile the pathname amp fName RenameFile the pathname amp temp V12 the pathname amp fName Fixing Corrupted Database Files Databases may become corrupt if a power failure or system crash occurs while updating records Therefore V12 DBE is unable to reopen the database and returns an explicit error code when trying to create a database instance Some of these corrupt databases can be fixed with mFixDatabase The syntax for mFixDatabase is mFixDatabase Xtra V12dbe pathname new pathname pathname is the name of the database to fix and new pathname 1s the name of the fixed database which may reside on a different volume mFixDatabase is a static method its first parameter is the Xtra library itself not on an instance of V12dbe In the following example mFixDatabase Xtra V12dbe Crash V12 Recovered V12 mFixDatabase tries to read data from Crash V12 and saves the data to Recovered V 12 mFixDatabase attempts to save a corrupted file as much as possible but there is no guarantee on the result mFixDatabase essentially
236. tandard across operating systems and file formats For example the letter is the 233 on Windows whereas it is the 142 on Macintosh and the 130 on MS DOS Although all three operating systems use the ASCII characters set only low ASCII characters 1 e those below 127 are common to the many variants of the ASCII set Therefore the rest of this topic is of interest to you only if your deal with high ASCII characters such as B i o Z o S etc V12 DBE s CharacterSet property can be set to translate Windows Macintosh or MS DOS character sets when importing or exporting Text or DBF files Optionally mImport accepts the CharacterSet property to use only once to import a single file as opposed to the CharacterSet property which permanently affects mImport mImportFile and mExportSelection or until it is set to another value Importing Data into a V12 DBE Database Importing Data with mImport MS Word documents V12 databases as well as many other proprietary file formats are cross platform compatible You should not worry about this portability issue if your data contains only low ASCII characters e g English alphabet Dealing with Dates Although V12 DBE can output dates in highly customizable formats it requires that they be input in a single unambiguous format called the raw format Y Y Y YMM DD e YYYY year in 4 digits e g 901 1997 2002 e MM month in 1 or 2 digits e g 07 or for January
237. ter record_delimiter Importing from a Literal Sometimes you need to process data with Lingo before importing it in a V12 DBE table A convenient place to store such data is a Director member of type Field mImport allows to import the content of such a field through the following syntax mImport gTable LITERAL DirMemberName or variable Options where DirMemberName or variable is an expression of type Text such as Field myData the text of member yada yada Field 1 Field 2 Field 3 amp RETURN amp 12 14 16 amp RETURN amp 54 12 89 and Options is a property list identical to the one used for importing Text files see Importing from a TEXT File above Following is an example of a Director field containing data to split into V12 DBE fields and records assume the name of the field is Discounts Level 1 Level 2 Level 3 12 14 16 45 58 72 33 56 68 224 301 451 The following instruction imports the above Director field to gTable mImportFile gTable LITERAL field Discounts RETURN Importing from a DBF File Importing a DBF file is similar to importing text files except that you cannot specify a subset of fields to import all the fields in the DBF file must be imported The field names of the DBF file must match those in the destination V12 DBE table Non matching field names are ignored during the importing process and a warning is reported by V12Error see Errors and Defensive Program
238. ther or starts This technique requires some preparation at the database design step Such a preparation is sometimes called data preconditioning When designing your database you plan for additional fields that would hold the concatenated result of the lowest level queries For example in the above example you would create an additional field named OriginType that would hold the concatenation of DishOrigin and DishType That field would contain values such as Italian Asparagus al dente Italian Prociutto e melone French Soupe l oignon Italian Melanzane del re French Bouillon de merguez au miel At runtime to perform a user query such as Origin is Org AND Dish is Typel or Origin is Org2 AND Dish is Tune you run the script mSetCriteria gTable OriginType Oral amp Typel mSetCriteria gTable OR OriginType Org2 amp Type2 mSelect gTable V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 Olntegration New Media Inc 1995 99 page 138 Appendix 10 Handling Double Byte Content V12 Database Engine is 100 compliant to single byte languages It can properly index sort and search strings of any single byte language in addition to allowing for the definition of custom sort and search orders However V12 DBE contains the following limitations with respect to double byte languages Storing and Retrieving Data Double byte strings can be successfully stored and retrieved
239. ther Full or Safe binding and set with the bindingType parameter When the bindingType is not specified it is automatically set to Fullbinding Full Binding For projects that usually require simple browsing and viewing of information the binding is a Full binding This means that information is displayed and updated automatically to and from the V12 database mBindField gTable V12FieldName DirMember FullBinding Safe Binding for advanced users For large projects i e a large number of bound members many of which can be used without being on the stage or in cases where increased control over content updates or screen refreshment is required note the following syntax variation in which you specify a safe binding mBindField gTable V12FieldName DirMember SafeBinding The SafeBinding parameter instructs V12 DBE to wait for calls to mRefreshBoundFields and mUpdateBoundFields to refresh the member content or to update the field content To explicitly trigger a field member refresh call mRefreshBoundFields gTable updates the display in Director which forces the retrieval of content from V12 DBE and refreshes the display for the bound member and for all bound members simultaneously If you wish to refresh only selected bound fields use mRefreshBoundFields gTable f1 2 3 which refreshes the members associated with fields 1 2 and 3 only as long as they are already
240. this example the number of records in the selection the number of items named hat is stored in selSize V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 100 Managing Styled Text Director 5 and 6 feature cast members of type Text also called of type Rich Text RTF or richText Unlike members of type Field members of type Text keep all the formatting styles assigned to their content including fonts colors margins etc and can be anti aliased In Director 5 and 6 members of type Text cannot be edited at runtime This is because members of type Text have two components a content component the actual unformatted text and an image component the bitmap that represents the formatted content At runtime only the image component of Text members is available and therefore these members behave exactly like Bitmaps Director 7 introduced a new member of type Text or text that can by styled and edited both at authoring time and runtime V12 Database Engine manages both Director 5 6 and Director 7 Text members through fields of type String Integer Float and Date Both types of Text members are split in two parts the text of the member is stored in the V12 field itself The media component whether bitmap or binary representation of styled text is stored in a hidden field of type Media The text component is used to searching and sorting whereas the media com
241. thods are in bold Sample code is indented and printed in a courier font Note Special annotations and tips are enclosed in boxes like this one Although the sample scripts throughout this manual contain both upper and lower case characters V12 DBE is not case sensitive This applies to the methods names the parameters as well as to the actual data V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 15 Welcome to V12 Database Engine Welcome to V12 DBE the most powerful and user friendly cross platform database management Xtra for Macromedia Director version 5 x and later on Macintosh and Windows If you are familiar with other database management systems you will find V12 DBE very easy to use If you are only vaguely familiar with database management systems the next few sections will give you an overview of what you need to know to help you get started with V12 DBE Installing V12 DBE The name of this Xtra is VI2 DBE for Director XTR on the Macintosh VI2 DBE for Director X32 on Windows 9x NT and VI2DBE D x16 on Window 3 x To install the V12 DBE Xtra in your authoring environment e Make sure that Director is closed e Move the VI2 DBE Xtra to the Xtras folder located in the same folder as Director e Start Director To confirm that V12 DBE is properly installed check the Xtras menu in Director You should see V12 DBE for Director in the Xtras
242. user Invalid result Selection empty Field does not exist Invalid field name Empty field name Field s does not exist Cannot get field when Selection is empty Wrong number of parameters Invalid value Please contact tech support Parameter incompatible with type of destination field Invalid field name Unable to modify data Call mEditRecord first Media exceeds buffer size declared upon database creation Empty field name s is an invalid date Field s does not exist Wrong number of parameters Empty media field Empty field name Field s does not exist CastLib 1d does not exist Unable to find member s The parameter must be a cast member V12 DBE for Macromedia Director User Manual Olntegration New Media Inc 1995 99 version 3 0 99 07 27 page 189 10880 11010 11020 11030 11040 11050 11060 11070 11080 11710 11730 11910 11920 12130 12140 12710 12730 12731 12740 12741 12750 13010 13025 13030 13035 13045 13050 13410 13420 13610 13630 13640 13650 13660 13670 13680 14010 14020 14030 14040 14041 14050 14060 14070 14080 14410 14420 Cannot get field when selection is empty Wrong number of parameters Cast member empty Invalid field name Empty field name Empty media field Field s does not exist Unable to modify data Call mEditRecord first Unable to import this kind of medi
243. using the mSet Password method The new password can be an empty string The syntax is as follows mSetPassword gDB oldPassword newPassword Example mSetPassword gDB houdini ali baba Properties of Databases V12 DBE databases contain generic properties that provide for technical information on the current V12 DBE environment such as the number of available indexes and the state of the active debugger and allow for the control of the V12 DBE environment such as custom string types and custom weekday names mSetProperty and mGetProperty are used to assign and read these generic database properties Certain properties can only be read not written 1 e the number of available indexes while others can be read and written i e custom string types Certain properties are persistent 1 e saved to the database and recovered when the database is reopened others are not The syntax for mGet Property is set val mGetProperty gDB PropertyName V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 112 The syntax for mSetProperty is mSetProperty gDB PropertyName Value PropertyName is a valid identifier see Appendix 3 Capacities and Limits for the definition of a valid identifier Value is always a string even if PropertyName refers to a number For example the MaxLoggedErrors property accepts a number e g 35 but the parameter supplied to mSetPr
244. y gTable color mSelect gTable put mGetUnique gTable literal into field ScrollList This script retrieves unique values of the color field which is the Master Field to the field ScrollList Assuming that your selection contains 30 records 10 with Color Red 10 with Color Green and 10 with Color Blue the above script puts the string Blue Green Red in field ScrollList Running the following script mSetCriteria gTable category T shirt mSetCriteria gTable and size XXL mOrderBy gTable color mSelect gTable put mGetUnique gTable list into field ScrollList would return the list V12 DBE for Macromedia Director User Manual version 3 0 99 07 27 OlIntegration New Media Inc 1995 99 page 83 Blue Green Red Because it uses the selection s Master Field it is recommended that you call morderBy with the appropriate field before calling mSe1ect and mGetUnique If you don t call morderBy mGetUnique returns unique values from the Master Field chosen by default by V12 DBE which is either the one indexed by the default index 1f the table was just opened or the one indexed by the best index chosen by V12 DBE for the last selection See Selection and Current Record Data Formatting mDataFormat assigns a display pattern to a field so that all data read from that field are formatted according to that pattern All V12 DBE methods that read dat

Download Pdf Manuals

image

Related Search

Related Contents

スイングヤーダ スイングヤーダ装着可能車 ハーベスタ  取扱説明書PDF - ニュージャパンヨット  Zelmer 33Z013 hair dryer  MooreCo 27519  MANUEL D`UTILISATION  Quartet 838  

Copyright © All rights reserved.
Failed to retrieve file