Home

- Integration New Media

image

Contents

1. 12 6 0 087 222 27 V In the above example the punctuation characters indicated as the Val ue parameter are considered as delimiters If you need to specify the double quote as part of the delimiters place the delimiters in an Authorware variable and use that variable as a Val ue parameter as follows CallObject gDB mSetProperty String Spanish Delimiters myDelimiters All non printing characters such as TAB Space CTRL J etc 1 e characters lower than ASCII 32 are always considered as delimiters To modify the delimiters of the default string just omit the Language identifier CallObject gDB mSetProperty String Delimiters newDelimiters String Language MinWordLength ReadWrite persistent Valid values an integer 1n the range 2 8 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 CallObject gDB mSetProperty String Spanish Mi nWordLength 3 Note that the Val ue parameter 1s 3 with quotation marks This 1s because mSetProperty expects a Val ue parameter of type String only The following is also a valid formulation CallObject gDB mSetProperty String Spanish Mi nWordLength String 3 To modify the Mi nWor dLengt h of the default string j
2. 184 P 222 33 71 G 109 m 147 i 185 b 223 394 72 H 110 n 148 i 186 224 t 35 73 111 Oo 149 i 187 8 225 36 74 J 112 p 150 188 226 37 96 75 K 113 q 151 189 y 227 3 amp 76 L 114 r 152 190 228 o 39 I 77 M 115 s 153 191 229 A 40 78 N 116 t 154 6 192 230 41 79 O 117 u 155 6 193 i 231 42 x 8 P 118 v 156 194 4 232 43 4 81 Q 119 w 157 195 233 44 82 R 120 x 158 196 f 234 45 83 sS 121 y 159 197 235 46 84 T 122 z 160 f 198 D 236 47 85 U 123 161 199 lt 237 48 0 86 V 124 162 200 gt 238 49 1 87 W 125 163 201 239 50 2 88 X 126 164 202 240 51 3 89 Y 127 165 gt 203 241 52 4 9 Z 128 166 1 204 A 242 5 5 91 129 167 B 205 243 54 6 92 Y 130 C 168 6 206 E 244 U 5 7 93 131 169 207 245 56 8 94 132 N 170 TM 208 246 57 9 95 _ 133 171 209 247 7 58 96 134 172 210 248 59 97 a 135 173 014 249 60 lt 98 b 136 174 12 3 250 61 99 c 137 a 175 213 251 34 62 gt 100 d 138 176 214 252 _ 63 101 e 139 a 177 215 x 253 y 64 102 f 140 a 178 216 jy 254 3 65 A 103 g 141 179 217 Y 255 1 6 B 104 h 142 180 Y 218 67 C 105 i 143 181 H 219 n 68 OD 106 j 144 182 06 220 lt 6 E 107 k 145 183 Y 204 gt V12 DBE for Authorware User Manual 108 MS DOS character set 32 70 F 108 I 146 184 222 33 71 G 109 m 147 6 185
3. Note This is a list where each element is itself a single element list The syntax for the Property List result would be X Call Object gTable mGetSelection PROPERTYLIST 1 Call Obj ect gTable mSelectCount name and the result would be name Batteries name Floppies name Labels name Pencils name Ruler name Tags Read 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 CARRI AGE RETURNs CRs as record delimiters with fields ordered in the sequence number name and price x Call Object gTable mGetSelection LITERAL 1 Call Obj ect gTable mSelectCount TAB RETURN number name price sets the variable x to the following string 6780 TAB Batteries ZAB 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 Script List result would be x Call Object gTable mGetSelection LIST 1 Call Obj ect gTable mSelectCount number name price and the result would be 6780 Batteries 9 20 9401 Floppies 1 89 1743 Labels 1 19 5251 Pencils 5 55 I431 Ruler 1 99 7519 Tags 6 19 The syntax for the Property List result would be x Call Object gTable mGetSelection PROPERTYLIST 1 Call Obj ect gT
4. whereas the second could be written as LastName MacDonald and score lt 50 or LastName McGill Important The current version of V12 DBE does not have the ability to perform searches such as name hat or name hel met and price lt 50 note the parentheses The first two criteria are always grouped first and the third criteria is added to the result 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 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 this syntax of mSel ect Call Obj ect table instance mSelect from recs Example Call Object gTable mSetCriteria LastName Smth Call Object gTable mSelect 1 100 The above example returns up to a maximum of 100 records 1n 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 Call Object gTable mSelect 101 100 Check 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 mSel ect Coun
5. 223 _ 394 72 H 110 n 148 6 186 224 35 73 111 Oo 149 187 225 B 36 74 J 112 p 150 188 220 37 96 75 K 113 q 151 189 227 38 amp 76 L 114 r 152 y 190 Y 228 6 39 l 77 M 115 s 153 191 229 40 78 N 116 t 154 192 230 H 41 79 O 117 u 155 193 231 b 42 80 P 118 v 156 194 232 P 43 81 Q 119 w 157 195 233 44 82 R 120 x 158 x 196 234 45 8 sS 121 y 159 f 197 235 46 84 T 122 z 160 a 198 a 236 y 47 85 U 123 161 199 A 237 Y 48 0 86 V 124 162 200 238 49 1 87 W 125 163 201 239 50 2 88 X 126 164 202 240 51 3 89 Y 127 165 N 203 241 52 4 9 Z 128 166 204 242 _ 5 5 91 129 167 205 243 54 6 939 Y 130 168 amp 206 244 q 55 7 93 131 169 207 n 245 56 8 94 A 132 a 170 4 208 246 57 9 95 _ 133 a 171 209 247 58 l 96 134 172 210 248 59 9 a 135 173 i 211 249 60 lt 98 b 136 174 lt 212 250 61 99 c 137 175 gt 213 i 251 1 6 gt 100 d 138 176 214 252 3 63 101 e 139 i 177 _ 215 253 2 6 102 f 140 178 _ 216 254 _ 65 A 103 g 141 i 179 217 255 6 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 221 V12 DBE for Authorware User Manual 109 Note The SJIS field does not support full text indexing The following operators are not supported wordStarts and wordEq
6. Another reason is that wordStarts can only search for words that match or begin with a given string For example if the description field of a certain record contains the text Dark chocolate with hazelnuts CallObject gTable mSetCriteria descr contains cola would locate that record chocolate contains the sub string cola whereas Call Object gTable mSetCriteria descr wordStarts cola would not This 1s because no word in the description field starts with the string cola Complex search criteria mSet Criteria 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 mSet Criteria and inserted before the field to be searched Example Call Object gTable mSetCriteria LastName starts Mac Call Object gTable mSetCriteria and score lt 50 Call Object gTable mSelect The above example selects the records of all students whose last name starts with Mac and whose score is lower or equal to 50 The first call to mSet Criteria should use three parameters and it can be chained with as many four parameter calls as needed to specify your query Using mSet Criteria with three parameters will reset and ignore the preceding search criteria Another example using the Boolean OR operator 1s CallObject gTable mSetCriteria LastName starts Mac Call Object gTable mSetCriteria or Las
7. 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 Last Name and St ate 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 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 This is where you need to define a full text index or full index for short on that field A full index 1s 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 32 767 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 i
8. DBF Database Format 87 Microsoft FoxPro 91 Microsoft Access 92 Microsoft Excel 94 Microsoft SQL Server 96 Appendix 3 mGetSelection examples 99 Read an entire selection 99 Read a range of records in a string variable 99 Read a range of records in a list 99 Read a range of records in a property list 99 Read the entire contents of the current record 100 Read a record without making it the current record 100 Read the entire selection with special delimiters 100 Read selected fields in a selection 100 Read records with a determined order of fields 101 Appendix 4 String and custom string types 102 The default string 103 Predefined custom string types 104 Appendix 5 Character sets 107 Windows ANSI character set 107 Mac Standard character set 108 V12 DBE for Authorware User Manual 5 MS DOS character set 109 Appendix 6 J apanese support 110 New field types 110 Field of type SJ IS 110 Field of type Yomi Yomigana 110 Data importation 117 Index 118 Apple Mac and Macintosh are trademarks or registered trademarks of Apple Computer Inc FileMaker is a trademark of FileMaker Inc registered in the U S and other countries Macromedia Authorware Director and Xtra are trademarks or registered trademarks of Macromedia Inc in the United States and or other countries Microsoft Windows and Windows NT are trademarks or registered trademarks of Microsoft Corporation registered 1n the U S and or other countries Other trademarks
9. FlushToDisk Write to fields of type integer float and string In this example student 666 s first name 1s modified for Bill and his average score for 2 72 The Authorware scripts 1s as follows first make sure the current record is properly set CallObject gTable mEditRecord CallObject gTable mSetField FirstName Bill CallObject gTable mSetField AverageScore 2 72 CallObject gTable mUpdateRecord Like mAddRecord every call to mEdi t Record must be balanced with a call to mUpdateRecord Calls to mSet Fi el d will result in an error if not preceded by mEdi t Record If an error occurs when updating a record e g Duplicate Key error in a given field none of the preceding calls to mSet Fi el d 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 Typecasting Example CallObject gTable mSetField score 2 72 stores 2 72 Call Object gTable mSetField score xyz Stores 0 00 CallObject gTable mSetField score 12 34 stores 12 34 Write 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 VI2 DBE requires the date to be supplied 1n raw format YYYY MM DD Example CallObject gTable mSetField theDate 1993 02 22 is v
10. See Dealing with delimiter ambiguity below 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 This is an example of such a file Name Price CatNumber Ruler 1 99 1431 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 See Exporting a FileMaker Pro database to text or Exporting a MS Access database to text V12 DBE for Authorware User Manual 32 Note Since V12 DBE always ignores Line Feed characters ASCII Character 10 those cannot be used as field or record delimiters Dealing with delimiter 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 1n the list below Virtual carriage returns Some database management systems e g FileMaker Pro export a special character other than ASCII 13 instead of the CRs that appear in your fields For example FileMaker Pro expor
11. To sort the list 1n the expected ascending order you must define the field number of points to be of type integer to get this result Jordan Ann 1 Pintado Jack 6 Brown Charles 12 Van Damme Lucie 64 Peppermint Patty 127 Typecasting Typecasting or casting for short 1s the process of converting a piece of data from one type to another This is a common mechanism to most programming languages including Authorware scripting language For example the integer 234 can be casted to the string 234 Conversely the string 3 1416 can be casted to the float 3 7416 Typecasting can be performed explicitly in Authorware s scripting language using thel nteger String andFl oat functions i e String 234 returns the string 234 or automatically 1 e 126834 returns the string 1234 V12 DBE has the same ability as Authorware s scripting language to typecast data when it 1s 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 nt eger 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
12. Windows Creating an Xtra instance A mandatory first step before using a Script Xtra is to create an instance of it This is how a Script Xtra comes to life and from then on you can use tts methods Call NewObj ect to create an instance of an Xtra Generally you store a newly created Xtra instance into a global variable for future use It uses the NewObj ect method of the database Xtra Example gDB NewObject Vl12dbe myBase V12 Create myPassword V12 DBE for Authorware User Manual 17 Note This is a generic approach and works with all Xtras In V12 DBE the preferred way to check for errors is the V12Status method See Errors and defensive programming in this manual Note In order to learn which methods are supported by an Xtra use the Xtra s built in documentation See Basic documentation below Note If a VI2 DBE Xtra instance is not properly deleted DeleteObject the file it refers to remains open and cannot be re opened unless the computer is restarted In some cases the database could be corrupted Checking if NewObject was successful You should always ensure that the Xtra was created successfully immediately after calling NewObj ect NewObj ect can fail for many reasons such as a lack of free memory or as a result of misplaced files Example gDB NewObject Vl12dbe myBase V12 Create myPassword if Vi2Status lt gt 0 then GoTo Q NotifyUser Using the Xtra ins
13. because the words in these records don t start with the sub string ham V12 DBE for Authorware User Manual 61 Note Words shorter than the minimum word length set for full indexing cannot be looked for with the wordEquals or wordsStarts operators In such cases you must use the contains operator instead Note Complex searches that use the OR operator are always slower than those that use the AND operator This 1s true with V12 Database Engine as well as with most other database management systems Since wordStarts operates on full indexes searching is performed very quickly WordEquals The wordEquals operator can be used only with fields of type stri ng with defined full indexes It locates records that contain words that fully match the value specified to mSet Criteria Example CallObject gTable mSetCriteria fid wordEquals ham sets records for selection containing descriptions such as green eggs and ham Records containing words such as hams or hamburger would not be selected Since wordEquals operates on full indexes searching is performed very quickly Difference between Contains and WordStarts Why should you bother using the slow contains operator if 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
14. color Call Object gTable mSelect ScrolllList Call Object gTable mGetUnique LI TERAL V12 DBE for Authorware User Manual 53 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 the variable ScrollList Running this script CallObject gTable mSetCriteria category T shirt Call Object gTable mSetCriteria and size XXL Call Object gTable mOrderBy color Call Object gTable mSelect ScrolllList Call Object gTable mGetUnique LIST returns the list Blue Green Red 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 data from a formatted field are affected These include mGet Fi el d and mGet Selection Syntax Call Object table instance mDataFormat FieldName Pattern The following example forces all data retrieved from the field Aver ageScore to be formatted with 2 integral digits and 2 decimal places Example Call Object gTable mDataFormat AverageScore 99 99 mDataFormat can be applied to fields oftypefloat i nteger anddate String fields cannot be formatted To reset
15. 0 then GoTo Q NotifyUser CallObject gDB mBuild if Vl2Status lt gt 0 then GoTo Q NotifyUser Del eteObj ect gDB gDB 0 where e FileName is the full pathname of the V12 database to create e Password is the password to protect Fi eNa me V12 DBE for Authorware User Manual 41 Note 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 or ObjectP see Checking 1f NewObject was successful in Using Xtras before pursuing the database creation process Note mReadDBStructure reads the structure of a DBF file not its content Use ml mport to import the content of a DBF file e nputType is one of Text Literal DBF V12 FoxPro Access Excel or SOL Server e other params are one or more parameters depending on the selected InputType e The resulting V12 DBE database can be immediately verified with mDumpStructure see View the structure of a database 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 Step 3a Create a database Xtra instance Use the NewObj ect method to create a database Xtra instance Syntax gDB NewObject Vl2dbe Name create Password The parameters you provide are e Name the nam
16. 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 9 Indemnity By using the Software you agree to indemnify hold harmless and defend INM and its licensors from and against any claims or lawsuits including attorney s fees that arise or result from the use or distribution of your Product with the Software V12 DBE for Authorware User Manual 8 10 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 11 Language 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 V12 DBE for Authorware User Manual 9 The V12 DBE Knowledge Object library features only the basic essential features of V12 DBE s functionality Before you commit yourself to using the V12 DBE Knowledge Object in your project you may first want to ask Support IntegrationNewMedia com or other V12 DBE use
17. If you want a clearer understanding of what a database is and does we recommend that you read this section The following topics introduce you to database basics e What is a database e Records fields and tables e Indexes Compound indexes and Full text indexing e Flat and relational databases e Field types e 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 a telephone directory where you can look up data that 1s sorted in alphabetical order only database management programs allow you to change the way you sort and view 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 Note Some database Each record consists of pieces of information called fields management systems refer to fields as columns and to records All records are stored in a table as lines or rows In V12 DBE the For example data entry in an address book typically consists of seven pieces of terms remain f i el ds and I ice information called f i el ds last name first name street address city state zip code and phone number
18. 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 Import 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 1n this format Field Al 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 Al Field A2 etc represent the actual data in those fields TAB is the ASCII character 9 indicating the end of a field On the Mac CR 1s the ASCII character 13 indicating the end of a record On Windows CR 1s the ASCII character 13 followed by the ASCII character 10 Line Feed Since V12 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 ml mport 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
19. Message CallObject gDB mSetProperty Progressindicator Message Exporting records Please be patient This property sets the text that is 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 Progress indicators VirtualCR ReadWrite persistent Valid values any ASCII character When importing or exporting data convert Carriage Returns ASCII 13 to this ASCII character This 1s 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 ml mport V12 DBE for Authorware User Manual 75 Warning If you put calls to set the verbose property on in your script you must remember to remove them before distributing your application Example c Call Object gDB mGetProperty Virtual CR Call Object gDB mSetProperty Virtual CR Char 10 define ASCII character 10 as virtual CR See Step 2 Prepare the Data Virtual carriage returns CharacterSet ReadWrite persistent Valid values Windows ANSI Mac Standard and 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 a paramete
20. NOT ALTER OR CHANGE THE COPYRIGHT NOTICES AS CONTAINED IN THE SOFTWARE e THE SOFTWARE IS NOT INTENDED FOR USE IN THE OPERATION ENVIRONMENTS IN WHICH THE FAILURE OF THE SOFTWARE COULD LEAD TO DEATH PERSONAL INJURY OR PHYSICAL OR ENVIRONMENTAL DAMAGE 4 Copyright notices You may not alter or change INM s and its licensors copyright notices as contained in the Software As well you must include a acopyright notice in direct proximity to your own copyright notice in substantially the following form Portions of code are Copyright 1995 2003 used under license by Integration New Media Inc and b the Powered by V12 logo on the packaging of your Product or place the Powered by V12 logo within your Product in the credits section 5 Acceptance The Software shall be deemed accepted by you upon delivery unless you provide INM within two 2 weeks therein with a written description of any bona fide defects in material or workmanship 6 Termination This Agreement is effective until terminated This Agreement will terminate immediately without notice from INM 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 8 9 and 10 will survive any termination 7 Limited Warranty INM warrants for a period of ninety 90 days from your date of purchase as evidenced by a copy of yo
21. Not Equal lt gt The lt gt operator has the opposite effect of the operator It is used to locate data that are different than the specified value Example Call Object gTable mSetCriteria Score lt gt 9 99 specifies a search for all records except those that contain a score of 9 99 Less than lt The lt operator is used to locate data that are strictly smaller that the specified value Example Call Object gTable mSetCriteria score lt 10 specifies a search for scores lower then 10 Scores equal to or higher then 10 are not selected Example Call Object gTable mSetCriteria LastName lt M specifies an alphabetical search for records with last names that precede the letter M This includes all last names from A to L and excludes last names that begin with an M Less or equal lt The lt operator is used to locate data that are smaller or equal to the specified value Example Call Object gTable mSetCriteria score lt 10 specifies a search for scores no higher than 10 including scores of 10 Example CallObject gTable mSetCriteria LastName lt Mad specifies a search for records with last names that alphabetically precede the word Mad This includes all last names from A to M including names such as Macaroni and MacDonald but excluding McGill and Mobutu Greater than gt The gt operator
22. Professional Format Rules The following rules apply to the translation of FoxPro databases to V12 databases FoxPro Translated to field type V12 field type Dots Chae Suing Butter size 1s 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 DateTime Dat eh pnr is imported Logical Integer Memo String Buffer size 32K General wine 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 Microsoft Access mReadDBstructure from MS Access Windows only MS Access databases can be used as templates to V12 databases Like V12 DBE MS Access can store multiple tables per database meadDBstructure imports the structure of 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 V12 DBE identifiers see Defining identifiers in Step 1 Decide on a Data Model Syntax CallObject gDB mReadDBStructure Access FileName Username Password where V12 DBE for Authorware User Manual 92 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 1s not protected e Password is Username s matching password or EMPTY if the MDB file is not protected Once the correspon
23. The Database basics gives an overview of databases e In Using V12 DBE we lead you through the basic steps on how to use V12 DBE in detail You will learn how to prepare data create the database and import data e Subsequent sections show you how to use the methods available to you in V12 DBE e The remaining sections cover the integration of V12 DBE with Macromedia Authorware Here you can get a sense of how V12 DBE can be helpful to your projects e The Appendices deal with very specific issues such as capacities and limitations errors end user delivery portability etc Typographic conventions in this manual Important terms such as the names of methods are in bold Sample code is indented and printed in this font 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 They are described using mixed case in order to improve readability and facilitate debugging and we recommend you adopt a similar strategy in your Script programming It really does help to improve the readability of your Scripts V12 DBE for Authorware User Manual 13 Tip INM recommends that you always thoroughly test your final project using the minimum standard equipment you have determined for your application on all supported operating system platforms This process will also help you confirm t
24. V12 DBE step by step Overview V12 DBE components The main steps Step 1 Decide on a Data Model Defining identifiers Step 2 Prepare the Data TEXT file formats Field descriptors Dealing with delimiter ambiguity Character sets Dealing with dates Exporting a FileMaker Pro database to text Exporting a MS Access database to text DBF file formats Field buffer size Step 3 Create a database Database descriptors Defining both an index and a full index on a field Alternate syntax for creating indexes Compound indexes Adding comments to database descriptors Multiple tables in a descriptor Using the V12 DBE Tool Loading a descriptor from a source file Script the database creation Step 3a Create a database Xtra instance Step 3b Define the database structure Step 3c Build the database View the structure of a database Step 4 Import data into a V12 DBE database V12 DBE for Authorware User Manual 21 22 22 23 24 24 25 26 26 27 29 29 29 29 31 31 32 32 32 33 34 35 35 35 35 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 45 Import data with the V12 DBE Tool Script the data importing Import data with mlmport Step 5 Implementing the user interface Using the V12 DBE Knowledge Objects library Using scripts Open and close a database a table Selection and current record Selection at startup Select all the records of a table Browse a selection Read data from a database Add records to a database Update da
25. V12 field type Float Float Integer Integer Ignored Ignored Float Float Float String Float Float Notes Convert to text first 1f importing to V12 DBE 1s needed Convert to text first 1f importing to V12 DBE 1s needed Buffer size 255 bytes MS Excel cannot define indexes on its fields when reading an Excel workbook V12 DBE automatically indexes the leftmost field of each worksheet Microsoft SQL Server mReadDBstructure from MS SQL Server Windows 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 Access 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 Syntax Call Obj ect gDB Password where mReadDBStructure SQLServer DSN Username e 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 V12 DBE for Authorware User Manual 96 e Password is Username s matching password Importing from MS SQL Windows 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 Pane
26. all its external files on a web server See the TechNote named How to rename V12 DBE Xtra for web packaged pieces for special instructions for web packaging pieces that use V12 DBE for Authorware 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 Authorware or an Authorware packaged piece 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 trashcan or the recycle bin e Open your project either with a packaged piece or Macromedia Authorware and perform the tests e Once the tests are completed close the packaged piece or Macromedia Authorware and put the license file back in its original folder V12 DBE for Authorware User Manual 70 Note If a user opens a database in Shared ReadWrite mode any attempt to open it in ReadWrite ReadOnly or Shared ReadOnly mode will fail If a database 1s open in Shared ReadWrite other users can also open it in Shared Read Write mode If a database 1s open in an exclusive mode ReadWrite
27. any 12 word string The Weekdays property contains the names of the weekdays used by mDat aFor mat to format dates the DDDD pattern in mDat aFor mat The Val ue parameter is any 12 word string Words must be separated by spaces Names of weekdays that contain spaces themselves must be enclosed between apostrophes Example CallObject gDB mSetProperty Weekdays Montag Dienstag Mittwoch Donnerstag Freitag Samstag Sonntag ShortWeekdays ReadWrite 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 mDat aFor mat The Val ue 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 Call Object gDB mSetProperty ShortWeekdays Lun Mar Mie Jue Vie Sab Dom V12 DBE for Authorware User Manual 77 Tip A common use for the FlushToDisk property is in a kiosk situation where you store information into a database and you want to increase the odds that a power failure will not affect the database Power failures may still cause problems with the operating system and or database but this command will ensure that the data has been written to the hard drive or storage device SharedRWcount ReadOnly non persistent Returns the number of users currently using the database in Shared Re
28. given by the following table V12 DBE for Authorware User Manual 110 Note requires a Japanese font such as Phonetic characters hiragana and Pronunciation each sounds MS Mincho katakana corresponds to 2 characters in the left column DT OT WAWA DOU ZS a a i i u u e e o o Aa A DPARBHBEEREBLSC TOT ka ga ki gi ku gu ke ge ko go iy a s cJ LYO TATA TE sa za shi ji su zu se ze so ZO Roe uU EX MD ta da chi dzi tsu tsu dzu te de to a7 C7 oper do cma Pas 13 2513 2SsO E E O E ST ha ba pa hi bi pi fu bu pu he be pe ST BP ANSRAANIERIER ho bo po EAN Dash symbol The dash symbol has a special meaning in Yomigana This special treatment breaks the uniformity of the comparison method of the sorting procedure To remove this problem the dash symbol should be replaced by its respective vowel in the input data In other words the compare method does not take into account the semantic of the dash symbol The mSetCriteria method translates the dash symbol to the correct preceding vowel The translation is defined in the following table V12 DBE for Authorware User Manual 111 V12 DBE for Authorware User Manual 112 OK Av OF g A V12 DBE for Authorware User Manual 113 Pf EY CN 4 CN V12 DBE for Authorware User Manual 114 SE MATT OF X gt V12 DBE for Authorware User Manual 115 D IY 9 N S oy LINE NEN V12 DBE for Authorware User Manu
29. instance mGetSelection LIST From recs FieldNames 11 The syntax for mGet Sel ecti on to return a Script property list 1s CallObject table instance mGetSelection PROPERTYLIST From recs FieldNames where e gTable is the instance of the table from which records must be retrieved mandatory parameter e Fromis 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 Fromand the end of the selection plus 1 convenient to retrieve all the records of a selection starting from record number F r o m e FieldDelimiter is the character to use as the field delimiter It 1s 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 CARRI AGE RETURN e FieldNames are the names of the fields to retrieve in the specified order If the field names are omitted mGet Sel ection returns the contents of all the fields of gTabl e in their order of creation e BesidesgTabl e 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 resul t format and From must also be present Note Because mOr der By E uses the selection s Mas
30. interface 19 mAddRecord 56 mBuild 43 mCloneDatabase 65 mDataFormat 54 64 mDeleteRecord 58 mDumpStructure 43 mEditRecord 57 mExportSelection 64 mFind 51 mFixDatabase 66 mGetField 52 mGetPosition 50 mGetProperty 74 DBversion 78 ProgressIndicator 74 75 ProgressIndicator Message 75 SharedRWcount 78 Verbose 76 mGetPropertyNames 75 mGetRef 48 mGetSelection 52 mGetSelection examples 99 mGetUnique 53 mGo 50 V12 DBE for Authorware User Manual 119 mGoFirst 50 mGoLast 50 mGoNext 50 mGoPrevious 50 mImport 84 85 86 87 88 91 93 95 97 99 100 101 mPackDatabase 65 mReadDBstructure 42 83 85 86 87 mSelDelete 58 mSelect 58 mSelectAll 49 mSelectCount 63 mSetCriteria 58 mSetField 56 57 mSetPassword 66 mSetProperty 74 CharacterSet 76 ProgressIndicator 74 75 ProgressIndicator Message 75 Verbose 69 76 VirtualCR 76 mUpdateRecord 57 mxXtraVersion 66 new 42 47 48 NewObject 19 NewObject 17 V12Error 68 V12Status 68 Microsoft Access 92 Microsoft Excel 94 Microsoft SOL 83 96 Mode 42 Months 77 Multi user Access 71 O Online Resources 11 Opening a Table 48 Opening an Existing Database 47 Operators Greater than gt 60 Operators 59 Contains 61 Equal 59 Greater or equal gt 61 Less or Equal lt 60 Less Than lt 60 Not Equal lt gt 60 Starts 61 WordEquals 62 WordStarts 61 Operators searching 59
31. named FULL NDEXES The FULL NDEXES tag must follow the FI ELDS section and must be followed by a list of fields to be full indexed one per line Example TABLE Reci pes FI ELDS NameOf Recipe string indexed Calories integer indexed Cooki ngTi me i nteger TextOf Recipe string 5000 indexed FULL I NDEXES TextOf Reci pe END Alternate syntax for creating indexes Database descriptors support an alternate syntax for the creation of indexes The NDEXES tag can be used right after the field definitions to explicitly name and define the desired indexes This alternate syntax is used by mDumpSt r uct ure for clarity see View the structure of a database It also allows the definition of unique valued indexes and V12 DBE for Authorware User Manual 38 descending indexes which are used only In exceptional cases in summary if you don t know what they mean you probably don t need them This database descriptor example is equivalent to the one above TABLE Recipes FIELDS NameOf Recipe string Calories integer CookingTime integer Text Of Recipe string 5000 I NDEXES NameOf Reci peNdx duplicate NameOf Recipe ascending CaloriesNdx duplicate Calories ascending TextOfRecipeNdx duplicate TextOf Recipe ascending FULL NDEXES TextOf Reci pe END Compound indexes Compound indexes are indexes defined on two or more fields see Database basics Compound indexes Compound inde
32. see Defining identifiers e FieldType string integer float date ora 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 oftypestring If omitted fields of type string are created with a default buffer size of 255 Characters are created with a default buffer size of 64K See Field buffer size in Step 2 Prepare the Data e ndexType the word indexed if the field must be indexed or the word full indexed if the field must be full indexed or nothing if no indexing is required If you need to both index and full index a field see Defining both an index and a full index on a field The END tag indicates the end of the descriptor It is a mandatory tag In each line of the descriptor file tokens 1 e field name index name value etc must be separated by one or multiple Tabs and or Space characters Example TABLE Reci pes FI ELDS NameOf Recipe string indexed Calories integer indexed Cooki ngTi me i nteger TextOf Recipe string 5000 full indexed END 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 ndexType parameter defined above can represent only one of indexed or full indexed you would need to set it to indexed and define the full index separately under an additional tag
33. table see Appendix 4 String and custom string types The String property defines or modifies custom string types 1 e string fields that obey specific 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 CallObject gDB mSetProperty String Klingon CompTabl e In this example the variable CompTable contains the search sort descriptor for Klingon as defined in Appendix 4 String and custom string types Once this property is defined you can use the type Klingon to define new fields with mCreateField ormReadDBstructure You also need to define this property first V12 DBE for Authorware User Manual 78 before modifying other string properties such as Del i mi ters StopWords and Mi nWor dLength To modify the sort order of the default string just omit the Language identifier CallObject gDB mSetProperty String CompTabl e String Language Delimiters ReadWrite 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 Call Obj ect gDB mSetProperty String Spanish Delimiters
34. the formatting of a pattern to its original value call mDat aFor mat with an empty string Example CallObject gTable mDataFormat AverageScore Format integers and floats Valid patterns for fields of type i nteger andfloat contain e 9 designates a digit at that position possibly 0 e designates a digit or a space at that position e period designates the decimal point e any other character is interpreted literally This example forces the output of the field r ati o to 2 integral digits 2 decimal places and a trailing sign CallObject gTable mDataFormat ratio 99 99 TheRatio CallObject gTable mGetField ratio If the value in field r at i o 1s 34 567 the displayed string is 34 57 The pattern 9999 forces the output of an integer field to be formatted with no less than four digits and with three leading spaces if necessary Thus V12 DBE for Authorware User Manual 54 Note If a formatting pattern is assigned to a field all values retrieved from that field become strings see Typecasting in Database basics 4 is formatted as 0004 123 is formatted as 0123 314159 is formatted as 314159 3141592 is formatted as 3141592 31415926 is formatted as PHEEEHH 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 i
35. which is being replaced to a third party g Allintellectual property rights 1n and to the assets which may be accessed through the use of the Software are the property of the respective asset owners and may be protected by applicable copyright or other intellectual property laws and treaties This Agreement grants you no rights to use such content 2 V12 Tracker waiver V12 Tracker is a fully functional version of V12 Database Engine and a fully licensed V12 database file named V12 Tracker V12 You are waived from section 1 c 11 provided that a Your Product uses V12 Tracker b Your Product does not use a V12 database other than V12 Tracker c The V12 Tracker V12 database file has the exact same structure as the one delivered to you by INM V12 DBE for Authorware User Manual 7 3 Restrictions a The Software contains a license file LIC that may not be distributed by you in any way b You may not sublease rent loan or lease the Software c You may not transfer or assign your rights under this License to another party without INM s prior written consent Assignment application forms can be obtained from INM s sales department d The Software contains trade secrets and to protect them YOU MAY NOT MODIFY ADAPT TRANSLATE OR CREATE DERIVATIVE WORKS BASED UPON THE SOFTWARE OR ANY PART THEREOF YOU MAY NOT REVERSE ENGINEER DECOMPILE DISASSEMBLE OR OTHERWISE REDUCE THE SOFTWARE TO ANY HUMAN PERCEIVABLE FORM YOU MAY
36. www Textpad com For Windows e UltraEdit from IDM Computer Solutions http www Ultraedit com For Windows e Microsoft Excel from Microsoft Corp http www Microsoft com For MacOS and Windows BBEdit TextPad and UltraEdit feature GREPs General Regular Expression Parsers which are very convenient to reorganize unstructured data Character sets Character sets are not standard across operating systems and file formats For example the letter is the 2334 on Windows whereas it is the 1424 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 you deal with high ASCII characters such as B i 0 2 Y 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 ml mport accepts the CharacterSet property to use only once to import a single file as opposed to the CharacterSet property which permanently affects ml mpor t and mExportSelection oruntil it is set to another value See Step 4 Import data into a V12 DBE database and Import data with mImport MS Word documents V12 databases as well as many other proprietary file formats are cross platform compatible You should not worry ab
37. your V12 database s name first make sure to set all table instances to 0 Del eteObj ect gTabl e gTable 0 Call Object gDB mPackDatabase FileLocation temp V12 if Vl2Status lt gt 0 then GoTo Q NotifyUser DeleteFile FileLocation f Name RenameFile FileLocation temp VI2 FileLocation f Name Fixing corrupted database files Databases may become corrupt if a power failure or system crash occurs while updating records Therefore V12 DBE 1s 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 mFi xDat abase The syntax for mFi xDatabase 1s CallParentObject Vl12dbe mFixDatabase pathname new pathname pathname is the name of the database to fix and new pathname is the name of the fixed database which may reside on a different volume mFi xDatabase is a static method its first parameter is the Xtra library itself not on an instance of V12dbe In this example Call ParentObject Vl2dbe mFixDatabase2 Crash V12 Recovered V12 mFix Database tries to read data from Crash V12 and saves the data to Recovered V12 Checking the Vversion of the Xtra 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 mXt r aVersi on to retrieve the ve
38. 2 only requires the Access ODBC driver e a MS Excel workbook which serves as a database template Windows 32 only requires the Excel ODBC driver e aMS SQL Server data source which serves as a database template Windows 32 only requires the MS SOL Server ODBC driver V12 DBE for Authorware User Manual 42 Note A valid database needs at least one table and each table must contain at least one field and at least one index Note For mBui d to create a licensed database that is one that does not display an UnRegistered splash screen 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 mBui d cannot be used to create new databases at runtime If your application needs to create new databases at runtime use mCl oneDatabase see Cloning a database See Appendix 2 Database Creation and Data Importing Rules for complete examples of each of the above variations of mReadDBStructure It is always a good practice to check the value returned by V12Error or V12Status after calling mReadDBstruct ure see Errors and defensive programming 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 mBui d is called Database structure translation rules from the above ODBC compliant databases to V12 Databases var
39. 20 3 59 IL 21 60 mM 22 lt gt 61 nN 23 62 aN 24 63 0066662 OOO000OE 25 64 pP 26 65 qQ 205 3 66 rR 28 67 s amp S 29 68 tT 30 69 uuuttiUUUUU 31 70 v V 32 u 71 w W 33 amp 72 xX 34 73 yy Y Y 35 74 zZ 36 f 75 37 76 oO 38 0 77 aA 39 1 V12 DBE for Authorware User Manual 105 Searching and sorting rules for strings of type Hebrew requires a Hebrew font such as Web Hebrew i 50 i mem 2 51 16 nun 3 li 52 f samech 4 24 53 0 ain a 54 60 phe 6 55 60 sadi J 3 56 koph 8 1 57 resch 9 58 sin 10 59 tau 11 60 0 12 61 1 13 62 2 14 63 3 15 o 64 4 16 65 5 17 66 6 18 t 67 7 19 68 8 20 69 9 21 70 aAAAAAA 22 lt gt 71 bB 23 72 cC C 24 73 dD 25 74 eEEEEE 26 75 fF 27 76 gG 28 77 hH 29 78 illiti 30 7 79 jJ 31 80 kK 32 U 81 IL 33 amp 82 mM 34 83 nNN 35 84 00000600 36 f 85 pP 37 86 qQ 38 aleph 87 rR 39 a beth 88 SRS 40 a ghimel 89 tT 41 a daleth 90 udUUUUUU 42 he 91 vV 43 a vau 92 w W 44 ge zain 93 xX 45 heth 94 yy Y Y 46 teth 95 zZ 47 iod 96 48 caph 97 49 i lamed 98 V12 DBE for Authorware User Manual 106 Appendix 5 Character se
40. 5 DBF File Formats 35 87 DBversion 78 Debugger 68 Defensive Programming 68 Deleting a Record 58 Delimiter Ambiguity 33 delimiters 33 Delimiters Full Text 24 Delivering to the End User 70 Descending 59 Descriptors 37 Documentation 19 Downloading Databases via the Internet 66 Error Codes 69 Error detection 18 Errors 68 Exporting Data 64 DBF Format 64 Text Format 64 Exporting Data 64 F Field Buffer Size 36 Field Delimiter 52 V12 DBE for Authorware User Manual 118 Field Descriptor 84 Field Descriptors 32 Field Types 25 Files Needed 16 Fixing a Database file 66 Flat Databases 24 Float 65 FlushToDisk 78 Formatting Dates 55 Integers and Floats 54 Freeing up Disk Space 65 Full index 38 Full text Indexing 23 Delimiters 79 Shortest words 79 Stop words 79 G Global functions 20 Identifiers 31 Importation Examples and Rules 83 Importing A text File 84 Data into a V12 DBE Database 47 DBF files 87 FoxPro 91 From a DBF File 88 From a Literal 85 Lists 86 Literals 85 Microsoft Access 92 Microsoft Excel 94 Property Lists 86 SQL 83 96 Text Files 83 V12 DBE files 86 Importing Data 29 32 33 34 37 45 46 47 Index 38 Indexes 22 Installing V12 DBE 15 Integer 65 International 102 Character Sets 26 L Languages 26 102 License Agreement 7 Limits 81 M Mailing List 11 Master Field 49 memory partition 14 Methods 18
41. 6251 CR Read a range of records in a list This is identical to the previous example except that the result is returned in an Authorware Script list X CallObject gTable mGetSelection LIST 2 3 sets the variablex to the following list L Floppies 1 99 9401 labels 1 19 1743 T Pe ncils 5 55 6251 Read a range of records in a property list Same as the two previous examples except that the result is returned in an Authorware Script property list x Call Object gTable mGetSelection PROPERTYLIST 2 3 sets the variable x to the following list name Floppies price 1 89 number 9401 name Labels price 1 19 number 1743 name Pencils price 5 55 number 6251 V12 DBE for Authorware User Manual 99 Read the entire contents of the current record This example retrieves the entire contents of the current record in a single call to V12 DBE X Call Object gTable mGetSelection LITERAL Call Obj ect gTable mGet Position 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 Read a record without making it the current record This example retrieves the content of record 4 without making it the current record x Call Object gTable mGetSelection LITERAL 4 1 sets the var
42. AII the information relevant to one person makes up one record The collected records make up thet abl e and are contained ina dat abase file Entries below are typical of those found in an address book This is an example of a table Last Name First Name Address City State Zip Phone These are fields Jordan Ann 6772 Toyon Court San Mateo CA 94403 349 5353 This is the 1 record Brown Charles 30 Saxony Ave San Francisco CA 94115 421 9963 the 2 record Pintado Jack 22 Hoover Ave Bowie MD 20712 731 5134 the 3 record Van Damme Lucie 87 Main St Richmond VA 23233 315 3545 the 4 record Peppermint Patty 127 Big St Lebanon MO 92023 462 6267 etc V12 DBE for Authorware User Manual 21 Indexes In a telephone directory information 1s indexed by last name a typical way to search for a telephone number There are directories that index information by order of phone number or address but such static directories sort information in only one specific predetermined order V12 DBE by contrast 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 o
43. AMETERS tableName name of table to create DESCRIPTION Creates a new table named tabl eName V12 DBE for Authorware User Manual 19 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 examples Call Object object mFlushToDi sk means that the mFl ushToDi sk method requires exactly one parameter the database instance CallObject object mSetProperty property value means that mSet Property requires three parameters the database instance the property a string and the value of the property a string CallObject object mDumpStructure means that mDumpSt r uct ur e 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 CallParentObject Vl12dbe mxtraVersion the mXtraVersion isa static method a method that can be used with a database instance 1 e mXt raVersi on gDB and a database library instance i e mXtraVersion Xtra V12dbe Static methods are seldom used in V12 DBE V12Status V12status 1s a global method a method that can be used at any time regardless of Xtra instances It 1s only required that the Xtra be present when that function 1s called V12 DBE for Authorware User Manual 20 Database basics Overview
44. DBF files make sure to assign the right Character Set See CharacterSet in Properties of databases DATE_ARRIV Date 8 AVAILABLE Logical 1 TIMES_RENT Numeric 5 NUM_SOLD Numeric 5 Two index files named TITLE IDX and TYPE IDX are available in the same folder as VIDEO DBF The Script is as follows gDB NewObject Vl12dbe FileLocation VideoStore V12 create 11 CallObject gDB mReadDBStructure DBF FileLocation Video DBF Call Object gDB mBuild Del et eObj ect gDB gDB 0 The resulting V12 DBE database can be verified immediately with mDumpStructure see View the structure of a database The following is a sample output from mDumpStructure TABLE Vi deo FI ELDS TITLE String 30 DESCRI PT String 30000 RATING String 4 TYPE String 10 DATE ARRIV Date AVAILABLE Integer TI MES RENT Integer NUM SOLD Integer I NDEXES TitleNdx duplicate TITLE ascending Default Index TypeNdx duplicate TYPE ascending END Importing from a DBF File Importing a DBF file 1s 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 programming Syntax CallObject gTable m mport DB
45. F FileName Options where Fi eName is the pathname of the DBF file to import and Opt i ons isan optional Property list containing the CharacterSet property CharacterSet is one of Mac Standard Windows ANSI or MS DOS It determines which character set the DBF file 1s encoded in Most systems automatically encode DBF file in the MS DOS character set See Character sets in Step 2 Prepare the Data The default character set the one defined by the CharacterSet property see CharacterSet in Properties of databases It is normally Windows ANSI on the Windows version of V12 DBE and Mac Standard on the Macintosh version of V12 DBE V12 DBE for Authorware User Manual 88 Example Call Object gTable ml mport DBF FileLocation Pierl Import DBF CharacterSet 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 ml mpor t 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 See Dealing with dates and DBF Database Format Rules below for more details on DBF files and data importing rules V12 DBE for Authorware User Manual 89 DBF Database Format Rules The following rules apply to the translation of DBF file structures DBF Translated to field type V12 field type Notes Charac
46. FileLocation TEXT FileName FldDelimiter RecDelimiter Fieldl Field2 Example Call Object gTable mExportSelection 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 temName catalog number and pri ce 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 mExportSel ection takes the format patterns specified in mDat aFor mat into account The sorting order of the exported records is identical to the one set on the selection Exporting in DBF format The parameters for exporting DBF files are identical to those of exporting text without the field and record delimiters Example Call Object gTable mExportSelection DBF Goliath DBF exports all fields of gTable Or V12 DBE for Authorware User Manual 64 Call Object gTable mExportSelection DBF Goliath DBF ItemName catalog number price exports only fields ItemName catalog number and price These rules apply when exporting to a DBF file format e String fields are exported to fields of type Character 1f the buffer size of the string field 1s dec
47. For example the letter 4 sorts as a regular a in German whereas it sorts after z in Swedish Likewise in Spanish ch sorts after cz and 1l sorts after Iz V12 DBE s default st ri ng was designed to satisfy as many languages as possible It can sort and search texts 1n English French Italian Dutch German Norwegian V12 DBE for Authorware User Manual 26 Note Everything that applies to the typestring also applies to custom string types Throughout this manual the term stri ng is used to designate both the default V12 DBE string and custom string types Note Database Management Systems that use SOL 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 alternating uses of ANDs and ORs See technical notes on http www IntegrationNewMedi a com support v12director techn otes for possible workarounds etc See Appendix 4 String and custom string types in the appendices of this manual for a detailed description of st ri ng 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 See Appendix 4 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 you to create cus
48. M 01 DD MM 05 01 MMM DD YY Jan 05 95 On D MMMM YYYY On 5 January 1995 Weekday DDDD Month Weekday Thursday Month January MMMM 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 Add records to a database To add a new record to a V12 DBE table use mAddRecord then call mSet Fi el d as many times as needed typically once for each field of your table and finally call mUpdateRecord In this example a new record is created for the item goggles and its price is set to 158 99 Call Obj ect gTable mAddRecord Call Object gTable mSetField ItemName Goggles Call Ob
49. P Packing a Database file 65 Parameters 19 Partial Selections 63 Password 42 66 Pathnames 19 Progress Indicator 74 75 ProgressIndicator 74 75 ProgressIndicator Message 75 Properties Custom 80 of Databases 74 Predefined 75 String 78 Properties Custom 80 Q Queries Boolean 27 Complex 27 simple 27 R RAM buffer 38 Reading a record 52 Reading an entire selection 52 Reading fields of type date 52 of type float 52 of type integer 52 V12 DBE for Authorware User Manual 120 of type string 52 Record Delimiter 52 Relational Databases 24 Resources 76 S Search Criteria 27 Complex 27 62 Contains 61 Simple 27 58 Starts 61 WordEquals 62 WordStarts 61 Selection 27 49 Records 49 Size 63 Shared Read Write Mode 71 SharedRWcount 78 Shortest word Full Index 79 ShortMonths 77 ShortWeekdays 77 SQL 83 96 Standalone Packaged Pieces 70 Stop Words 24 String 65 102 104 String Property 78 String Types Custom 102 104 String Language 78 String Language Delimiters 79 String Language MinWordLength 79 String Language StopWords 79 Strings Hebrew 106 Japanese 110 Spanish 105 Swedish 104 Structure Database 42 System Requirements 14 T TAB delimited file 32 Testing 70 Text files 32 Text Qualifiers 33 Tool 40 45 Typecasting 26 U Using Xtra Instances 18 V V12 DBE Tool 40 45 Vi2Download 66 V12Downlo
50. V12 Database Engine 3 For Macromedia Authorware User Manual integration new media Integration New Media Inc 1995 2003 Version 3 2003 06 12 Contents Contents License agreement Introduction V12 Database Engine for Authorware Where to start Do really need to master scripting to use V12 DBE Free tools You re not alone V12 L discussion list Other online resources Customer support Developer assistance About this manual Typographic conventions in this manual Welcome to V12 Database Engine System requirements for running V12 DBE Macintosh versions Windows version Macromedia Authorware Installing V12 DBE What s new in version 3 3 Release history How to register your V12 DBE license Files needed to use V12 DBE Using Xtras What is an Xtra Making an Xtra available to Authorware Creating an Xtra instance Checking if NewObject was successful Using the Xtra instance Closing an Xtra Checking for available Xtras Dealing with pathnames Passing parameters to Xtras Basic documentation Database basics Overview What is a database V12 DBE for Authorware User Manual 10 10 10 10 11 11 11 11 12 12 13 13 14 14 14 14 14 15 15 15 16 16 17 17 17 17 18 18 18 18 18 19 19 21 21 21 Records fields and tables Indexes Compound indexes Full text indexing Database Flat and relational databases Field types Typecasting International support Selection current record search criteria Using
51. abase 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 1s create a V12dbe instance gDB NewObject Vi2dbe database filename mode password if V12Status lt gt 0 then GoTo Q NotifyUser create a Vl2table instance gTable NewObject V1l2table Call Object gDB mGet Ref Tabl eName if Vl2Status lt gt 0 then GoTo Q NotifyUser import data Call Object gTable ml mport InputType InputSource other params if Vi2Status lt gt 0 then GoTo Q NotifyUser free the Vl2table and Vi2dbe instances Del eteObj ect gTabl e Del eteObj ect gDB gTable 0 gDB 0 As for any V12table method valid instances of V12dbe and V12table must exist before the method is invoked This 1s explained in details in Creating Instances ml mpor t s syntax varies significantly according to the selected input source This is explained in details in Import data with mImport below Deleting Xtra instances when they are no longer needed is mandatory as explained in Closing an Xtra to make sure that the imported data is secured on hard disk Import data with mlmport The general sy
52. abases V12 DBE for Authorware User Manual 29 Step 5 Implementing the user interface In this step you develop the means by which users will search for retrieve and modify data at runtime This interaction with the database can be developed either using V12 DBE Knowledge Objects attached to Authorware sprites or as functions in Authorware Script Download the Knowledge Objects from the Free Tools section on Integration New Media s web site http www IntegrationNewMedia com products v12authorware tools Sample Authorware pieces are provided on the Demos page http www IntegrationNewMedia com products v12authorware demos Each of the aforementioned steps is discussed more in depth 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 Authorware User Manual 30 Step 1 Decide 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 product that database s model 1s 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 th
53. able mSelectCount 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 V12 DBE for Authorware User Manual 101 Appendix 4 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 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 k K L means that e K sorts after and before L e j and J are equivalent li
54. ad Write mode Example nbUsers Call Object gDB mGetProperty SharedRWcount DBversion ReadOnly non persistent Returns the version of the V12 DBE Xtra used to create the database Example dbversion Call Obj ect gDB mGet Property DBversion The above example puts V12 3 3 0 Multi User in the variable dbversion FlushToDisk If set to true this property will set the database to automatically flush the data to disk after every write operation V12 uses a disk cache system In order to speed up write operations and normally flushes to disk on an irregular basis as needed This method is useful when you have an application running on a user s machine that may be prone to power failures or when you want to be absolutely sure that you have stored a write operation to the hard drive When a database is opened in Shared Read Write mode the FlushToDisk property is automatically set to true to ensure that modified records are immediately available to all users If you prefer to manually control when the database is flushed to disk use the mFlushToDisk method The String property The String property is covered in a separate section because other sub properties Del i mi ters StopWords and Mi nWor dLengt h depend on it Properties below must be modified before fields of the corresponding string types are created in the database String Language ReadWrite persistent Valid values any valid search sort
55. adInfo 67 V12Error method 68 V12Status 68 V12Status method 68 Verbose 76 Version Determining 66 Virtual Carriage Returns 33 Virtual CR 33 76 VirtualCR 75 W Warnings 68 Web Package 70 Weekdays 77 What is A database 21 A field 21 A record 21 A search criterion 27 A selection 27 A table 21 The current record 27 Writing Data 57 of type Date 57 V12 DBE for Authorware User Manual 121 of type Float 57 of type Integer 57 of type String 57 X Xtra Instance 17 V12 DBE for Authorware User Manual 122
56. al 116 G SL x H Ay df lt A Note The last 3 entries n n dash wouldn t be followed by a dash in Japanese text so those can be ignored for the purposes of dash ing Searching The Yomi field has exactly the same search characteristics as the SJIS field See the details under Fields of Type SJIS Searching Data importation V12 J import Japanese text through the mImport method No validation is done on the incoming data It is up to the user to ensure that the text is valid Fields and record delimiters remain 1 byte characters V12 DBE for Authorware User Manual 117 Index A Adding Records to a Database 56 Alternate Syntax for Creating Indexes 38 Ascending 59 ASCII Character Set 34 Behaviors Library 47 Boolean operator 62 Buffer size 38 Build the Database 43 C Calculated Fields 34 Capacities 25 75 81 Character Set 26 34 76 102 CharacterSet 76 Cloning 65 Closing a Database 49 Closing a Table 49 Closing an Xtra 18 Comments in database descriptors 39 Compound Indexes 39 Compressing a Database file 65 Corrupted Database Files 66 Creating Database 41 Xtra Instance 17 42 Creating a Database 37 Current Record 27 49 50 CurrentDate 76 Custom Delimiters 33 Customer Support 12 D Data Formatting 52 54 Data Model 31 Database 24 database descriptor 37 Database Descriptors 37 Date 65 raw format 35 57 59 Dates 3
57. alid Call Object gTable mSetField theDate 02 22 1993 is not valid Storing the current date in Raw format may be difficult as Authorware s Dat e function returns the current date as formatted in the Control Panel settings of the computer it is running on In this case use mGet Property gDB CurrentDate to retrieve the current date in raw format see CurrentDate in Properties of databases V12 DBE for Authorware User Manual 57 Note 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 Delete a record Call mDel et eRecord to delete the current record Syntax CallObject table instance mDeleteRecord Example CallObject gTable mDeleteRecord After calling mDel et eRecor d the record that 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 1s not defined Delete all the records of a selection Call mSel Del ete to delete all the records of a selection at once Syntax CallObject table instance mSel Delete After mSel Del ete has been completed the selection is empty and the current record is undefined Search data with mSetCriteria When searching data you often ne
58. ally used to determine when to open the database and start working with 1t If a local V12 database of the same name already exists the downloaded file replaces it The Xtra automatically ensures that it 1s a valid V12 database and its password 1s supplied and correct For an example of its use see the V12 Methods Reference V12Download V12Down oad nf o isa method that you can use to determine the size of the database to be downloaded This can be useful in determining whether or not the database has changed since the last time 1t was downloaded Due to the fact that not all HTTP servers support time and date stamps on files this method helps you diagnose the status of the database files V12 DBE for Authorware User Manual 67 Note Usually you call V12Status to get an error or warning code then V12Error to geta full explanation of that error or warning Alternatively your application can choose to handle specific error codes uniquely Errors and defensive programming Error management in applications Effective error management is key to any reliable script or program If you choose to implement your project with the V12 DBE Knowledge Objects Library you automatically take advantage of this Library s efficient built in error management You just need to make sure that the Show Alert on Error check box is checked when dragging dropping a Knowledge Object V12 DBE s Script interface provides methods that allow
59. andard st ring type VI2 DBE contains a number of predefined custom string types They include Swedi sh Spani sh and Hebrew Searching and sorting rules for strings of type Swedish If the tables below are not properly formatted in this version of this manual please refer to the PDF version ph we 40 2 2 Cg 41 3 3 j 42 4 4 2 43 5 5 44 6 6 45 7 yj 46 8 8 47 9 9 48 aadaaaAAAAA 10 49 bB 11 50 ecCC 12 51 dD 13 52 ee EEEEE 14 53 fF 15 o 54 gG 16 55 hH 17 56 iiiiilllilf 18 tt 57 jJ 19 58 kK 20 3 59 IL 21 60 mM 22 s gt 61 n N 23 62 o OOO OO G 24 63 pP 25 64 q Q 26 65 rR 24 x 66 sS 20 67 tT 29 68 utuitiUUUUU 30 em 69 v V 31 70 wW 32 Hu 71 xX 33 amp 72 yy Y Y 34 73 zZ 35 74 36 f 75 e 37 amp 76 38 0 77 39 1 78 60 V12 DBE for Authorware User Manual 104 Searching and sorting rules for strings of type Spanish If the tables below are not properly formatted 1n this version of this manual please refer to the PDF version ne 40 2 2 lt Q 41 3 De du 42 4 4 2 43 5 5 44 6 6 45 7 Z 46 8 8 3 47 9 9 48 aaaaaaAAAAAA 10 49 bB 11 50 c C 12 51 dD 13 52 ee EEEEE 14 X 53 fF 15 o 54 gG 16 55 hH 17 56 iiiiillllif 18 tt 57 jJ 19 58 kK
60. as MS SOL Server field size Buffer size 1s same as MS SOL Server field size Note that V12 does not support unicode SOL data type such as nchar nvarchar and ntext V12 DBE for Authorware User Manual 98 Appendix 3 mGetSelection examples The examples below show various ways of using mGet Sel ection All examples assume that the table gTabl e contains 3 fields name price and number declared 1n that order when creating the table and that the selection contains 6 records Read an entire selection This example retrieves the entire content of each record of the selection with TABs as field delimiters and CARRI AGE RETURNs CRs as record delimiters Fields are sorted in their order of creation The records sort order is the one defined by the selection X Call Object gTable mGetSelection 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 Dos TAB 6251 CR Ruler TAB 1 99 TAB 1431 CR Tags TAB 6 19 TAB 7519 CR Read 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 CARRI AGE RETURNs CRs as record delimiters X CallObject gTable mGetSelection 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 0190 TAB
61. astUser currentUser currentUser contains the name of the current user Next time the application 1s opened you can check for the name of the last user and possibly take an appropriate action 1f it matches doesn t match the current user LastUser CallObject gDB mGetProperty LastUser if lastUser currentUser then take appropriate action end if Custom properties are always read write and persistent V12 DBE for Authorware User Manual 80 Appendix 1 Capacities and Limits Database The size of a V12 DBE database file 1s limited by disk space The number of database instances and table instances 1s limited by RAM Up to 128 instances of a single database can be opened by 128 different executables Authorware pieces or packaged piece 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 Note however that you may run into significant performance issues as the number of instances increases A valid V12 DBE database contains at least one table and each table requires at least one field and one index For multi user databases the maximum number of Read Write users 1s 128 The Maximum number of ReadOnly users is unlimited Creation In order to create licensed V12 database structures at runtime
62. at Step 1 Decide on a Data Model 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 V12 DBE s mReadDBstructure method if you decided to script the database creation process The V12 DBE Tool is a convenient point and click environment for small projects Scripting the database creation process requires a little more effort upfront but may end up saving you a lot of time 1f 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 If you use the V12 DBE Tool just read the next two sections Database descriptor and Using the V12 DBE Tool and skip toStep 4 Import data into a V12 DBE database If you wish to script the database creation process read Script the database creation as well 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 Using the V12 DBE Tool or Script the database creation The desired V12 DBE database structure 1s stored in a text file or Authorware variable called the database descriptor in this format TABLE NameOf Table FIELDS FieldNamel FieldTypel IndexTypel Fi
63. bles named tbl flds 1dx and fidx which don t start with the mandatory tags the following example creates a valid database structure gDB NewObject Vl2dbe Evaluations V12 create top secret Call Obj ect gDB mReadDBStructure LITERAL TABLE tbl TFIELDS fid INDEXED idx FULL I NDEXES fidx CallObject gDB mBuild Del eteObj ect gDB gDB 0 Import from a Literal Sometimes you need to process data with Scripting before importing it into a V12 DBE table A convenient place to store such data Is an Authorware variable ml mport allows you to import the content of such a variable through this syntax Call Object gTable m mport LITERAL variable Options where variable is an expression of type Text and Opt i ons is a property list identical to the one used for importing Text files see Importing a Text File above Following is an example of an Authorware variable containing data to split into V12 DBE fields and records assume the name of the variable is Discounts Level 1 Level 2 Level 3 12 14 16 45 58 72 33 56 68 224 301 451 V12 DBE for Authorware User Manual 85 This instruction imports the above Authorware variable discounts to gTabl e CallObject gTable m mport LITERAL discounts RETURN Lists or Property Lists Importing from a List or Property List Lists or a Property Lists can easily be imported to V12 tables throug
64. cking the content of the Category menu The available Xtras are listed right after the Xtra s All item If V12 DBE 1s installed you should see V12dbe and V12table listed in the Category menu as well as all other available Scripting Xtras Note that this technique applies to Scripting Xtras only Dealing with pathnames The NewObject 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 1s specified the file 1s V12 DBE for Authorware User Manual 18 assumed to be located in the same folder as Authorware or the Authorware runtime Example gDB NewObject Vl2dbe myBase V12 Create myPassword assumes that myBase V12 1s in the same folder as Authorware or the Authorware runtime Most of the time however placing the database file in the same folder as the piece that uses it is more convenient Use the Fi eLocation variable to get the current piece s folder Example gDB NewObject Vl12dbe FileLocation myBase V12 Create myPassword Passing parameters to Xtras As in any programming language including Authorware s scripting language functions commands and methods require a certain number of parameters For example in Script the Trace function expects one parameter the string to output in the Control Panel window example Trace Database successfully created Likewise the Resi zeWi ndow function expects two
65. com or other V12 DBE users on V12 L lt http www IntegrationNewMedia com support list gt for advice Step 5 Implementing the user interface Steps 1 through 4 Step 1 Decide on a Data Model through Step 4 Import data into a V12 DBE database explain how to design build and import data into a V12 DBE database This section discusses the elements needed to manage your V12 DBE database at runtime There are two basic strategies you can follow when creating your Macromedia Authorware front end to your data 1 Using the V12 Knowledge Objects Library 2 Using Scripting Using the V12 DBE Knowledge Objects library The fastest and easiest way to implement V12 DBE into your project s user interface is to use the V12 DBE Knowledge Objects Download them from the V12 for Authorware product page on our web site http www IntegrationNewMedia com products v12authorware tools Using scripts As with any V12 DBE method a valid V12dbe or V12table Xtra 1nstance depending on which Xtra the method belongs to must exist before the method is invoked Generally you create instances of V12dbe and V 12table at the beginning of your movie store their references in variables and use those instances throughout your project Likewise at the end of the execution of your movie you delete those variables thus disposing of the Xtra instances and closing the V12 database file The creation of such Xtra instances is often referred to as Op
66. ct gDB mGetProperty PropertyName The syntax for mSet Property 1s CallObject gDB mSetProperty PropertyName Value PropertyName is a valid identifier see Appendix 1 Capacities and Limits for the definition of a valid 1dentifier Val ue is always a string even if Propert yName refers to a number mSetProperty can be used to define a new property or to change an existing one Using mSet Property with a value of EMPTY deletes that property Properties pertaining to Strings see The String property below cannot be deleted Valid PropertyNames and Val ues are listed below Both parameters must be of type String Both are case insensitive hence resources Resources and RESOURCES are all equivalent You can retrieve the list of all the properties of a database by calling mGet PropertyNames asin set props mGetPropertyNames gDB Predefined properties Progressindicator ReadWrite persistent Valid values are None With Cancel Without Cancel UserDefined Default value 1s None X CallObject gDB mGetProperty Progressindi cator CallObject gDB mSetProperty Progressindicator With Cancel Enables V12 DBE to show a progress indicator while performing time consuming tasks or calls back Scripting handlers to enable custom progress indicator implementations See Progress indicators Progressindicator Message ReadWrite persistent msg CallObject gDB mGetProperty ProgressIndicator
67. d Example CallObject gTable mSetCriteria LastName starts Mac Call Object gTable mOrderBy score descendi ng Call Obj ect gTable mSelect The above example selects all hats in gTabl e and returns a selection sorted by a descending order of prices most expensive to least expensive If mOr der By is not called before calling mS el ect 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 mOrderBy in the V12 DBE Methods Reference manual Operators Following is a list of valid operators and their meanings Although comparisons of integers floatsanddatesare straightforward comparing strings and custom string types depends on how those comparison rules are defined see Appendix 4 String and custom string types Equal The operator is used to locate data that exactly match the specified value Example CallObject gTable mSetCriteria score 3 14 specifies a search for records that contain exactly the score 3 14 Example CallObject gTable mSetCriteria FirstName John specifies a search for records that contain exactly the first name John Other first names such as Johnny or John Paul will not be selected Since V12 DBE does not V12 DBE for Authorware User Manual 59 differentiate upper case and lower case characters john and John will also be selected
68. d however it tends to consume valuable disk space The flat model also introduces the risk of data discrepancies due to the duplication of data 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 dates pictures sounds palettes etc A field would then be of type string integer float or date See Appendix 1 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 were collecting points you would need to keep track of the number of V12 DBE for Authorware User Manual 25 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 would 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 1s alphabetically lower than the string 6 given that the ASCII code for 1 1s 49 which is smaller than the ASCII code for 6 54
69. d no callbacks are performed to Script handlers None is the default value of the property See also Properties of databases and ProgressIndicator 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 1 e custom string types V12 DBE for Authorware User Manual 74 Note Val ue is limited to 4096 characters Note mSet Property isa very powerful tool If you are unsure about what you re doing always work on a copy of your original database Note V12 DBE properties can only be accessed by the mSet Property and mGet Property methods They are totally unrelated to Win32 file properties Note The VirtualCR property requires an ASCII character as a parameter not an ASCII number To convert an ASCII number to a character use the example provided here Certain properties are persistent 1 e saved to the database and recovered when the database 1s reopened others are not The syntax for mGet Property is val CallObje
70. database file named Catalog V12 and structures it as described in Def txt gDB NewObject Vl12dbe Evaluations V12 create top secret Call Object gDB mReadDBStructure TEXT FileLocation Definition txt Call Obj ect gDB mBuild V12 DBE for Authorware User Manual 83 Del et eObj ect gDB gDB 0 Importing a Text File The imported text file must begin with a field descriptor line A field descriptor 1s a sample record that contains the names of the fields in which subsequent rows of data must be formatted see Field descriptors in Step 2 Prepare the Data The field names used in the field descriptor line must match those supplied to the mReadStructure method However these fields can be listed in any order Some of them can even be omitted Syntax Call Object gTable m mport TEXT FileName Options where Fi eName is the pathname of the text file to import and Options is an optional Property list such as FieldDelimiter TAB RecordDelimiter RETURN CharacterSet Wi ndows ANSI Virtual CR Char 11 TextQualifier QUOTE Options may contain some or all of the properties below or can even be empty e FieldDelimiter determines which character is used to delimit fields in the text file The default character is TAB ASCII 9 e RecordDelimiter determines which character is used to delimit records in the text file The default character is RETURN ASCII 13 If th
71. ding V 12 database structure is created the data from your MS Access tables can be imported Import from Microsoft Access Windows only MS Access MDD 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 CallObject gTable m mport Access FileName UserName Password Tabl eName 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 Windows only Then import data to each of its tables with ml mpor t as explained above Generally MS Access databases are encoded in the Windows ANSI character set Thus you must make sure that the CharacterSet Property 1s properly set to Windows ANSI before importing the data Windows ANSI is the default setting for the Character Set property See CharacterSet in Properties of databases V12 DBE for Authorware User Manual 93 Microsoft Access Rules The following rules apply to the translation of MS Access file structures to V12 databases MS Access Translated to field type V12 field type pices Text T B
72. e mSelect In this example the application reminds the user to fill in his name before doing the search operation For a complete listing of all V12 error codes consult the V12 DBE Methods Reference and Error Codes manual or V12 Help Both are available for download from http www integrationnewmedia com support v12authorware manuals Using the verbose property The ver bose property offers a convenient way to monitor and debug your application s interactions with a V12 database during the testing phase When verbose is turned on both successful v12 method calls and errors are reported to Authorware s Control Panel window Turn ver bose on at the beginning of a script segment that includes several V12 DBE method calls then turn it off at the end of that section of code Although verbose allows you to monitor database activity while in authoring and testing mode it should not substitute for checking V12Status and handling runtime errors Make sure all calls to Cal Obj ect gDB mSetProperty verbose on are deleted or commented out before distributing your application For more information on the ver bose property see Verbose in Properties of databases V12 DBE for Authorware User Manual 69 Note DO NOT attempt to rename or tamper with the license file If you do you may need to re register V12 DBE Delivering to the end user V12 DBE 1s designed In a way that minimizes any last minute c
73. e Text file contains Carriage Returns ASCII 13 followed by Line Feeds ASCII 10 as records delimiters Line Feeds are automatically ignored e CharacterSet 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 in Step 2 Prepare the Data The default character set is the one defined by the CharacterSet property see CharacterSet in Properties of databases e Virtual CR determines which character is used as a Virtual Carriage Return and thus must be converted to ASCII 13 after importing see Virtual carriage returns In Step 2 Prepare the Data The default character 1s the one defined by the Vi rt ual CR property which is usually ASCII 11 see VirtualCR in Properties of databases e Text 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 are removed after importing the file See Text qualifiers in Step 2 Prepare the Data The default text qualifier is For example this instruction imports the Text file myTextData txt located in the same folder as the current movie into gTabl e with all the default options f
74. e configurations Scenario 1 User 1 and User 2 access the same V12 database on a Remote Server This is the typical multi user access configuration 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 Scenario 3 User 1 with two distinct Projectors each with its own copy of the V12 DBE Xtra that 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 1n a shared folder 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 Authorware User Manual amp ER gt B T Projector Projector NV X D D V12DBE REMOTE V12DBE SERVER III Projector b d JA JA 12DBE 12DBE any Filevle USER 1 USER 2 a b d Projector KL D Y12DBE File 12 13 Note mSel ect preceded by mSet Criteria with simple or complex criteria enables the display of a single progress indicator for the selection task except if the criteria contain wordStarts orwordEquals operators In that case as many progress indicators as criteria are displayed Customizing the V12 database engine Progress indicators V12 Database Engine can display a progress indicator to the user when performi
75. e fields e arethere any relationships between the various tables In the stationary catalog example below only one table 1s needed It 1s called Articles The seven fields you need are e Field ItemName of type String e Field Category of type String e Field Description of type String e Field Price of type Float e Field CatalogNumber of type Integer e Field Date of type Date Since only the fields ItemName Price and CatalogNumber will be searchable only they are indexed Defining identifiers Tables fields 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 6 The maximum length for an identifier 1s 32 characters No two fields or indexes of a table can have the same name V12 DBE 1s not case sensitive That is upper cases and lower cases are identical These identifiers are considered identical in V12 DBE articles ARTICLES Articles aRtICleS V12 DBE for Authorware User Manual 31 Step 2 Prepare 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
76. e 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 Cr eat e create a new database file Other possible modes are ReadOnl y ReadWrite andShared ReadWrite See Open 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 it in a safe place If you forget it you will not be able to open your database again Example gDB NewObject Vl12dbe Catalog V12 Create top secret Step 3b Define the database structure The next method after successfully creating a database Xtra instance 1s to call mReadDBstructure to read in the database structure you designed at Step 1 Decide on a Data Model mReadDBstructure requires one the following inputs e a database descriptor as defined in Database descriptor above Such as descriptor is supplied either as a text file or as a literal 1 e a Authorware field or variable e a DBF file DBase which serves as a table template e aV12 database which serves as a database template e aduirectory 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 3
77. e that Authorware s preference for Use Temporary Memory setting 1s set before creating your packaged piece this will ensure that if the packaged piece does run out of memory it will start using free System memory and dynamically increase the memory allocated to the application Windows version e Windows 95 98 ME NT4 2000 XP Windows uses a Virtual Memory scheme which dynamically allocates memory to applications 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 Always test your project thoroughly on the minimum required equipment you have determined for your application For Windows 3 1 and Mac68K versions please contact us Macromedia Authorware Macromedia Authorware version 4 5 2 6 6 5 or 7 1s required V12 DBE for Authorware User Manual 14 Installing V12 DBE The name of this Xtra is V12 DBE for Authorware XTR on the Macintosh and V12 DBE for Authorware X32 on Windows To install the V12 DBE Xtra in your authoring environment e Make sure that Authorware is closed e Move the V12 DBE Xtra to the Xtras folder located 1n the same folder as Authorware e Start Authorware To confirm that V12 DBE 1s properly installed check the Xtras menu in Authorware You should see V12 DBE
78. eName is the name of the table to import Example Call Object gTable m mport V12 FileLocation 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 ml mport tries to typecast the data fields DBF Database Format 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 1s identical to the DBF filename without the DBF extension The syntax 1s Call Object gDB mReadDBStructure 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 DBF file mReadDBstructure detects its presence and automatically defines an index for that field in the current table This 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 DBF is as follows Field Type Width TITLE Character 30 DESCRIPT Memo 10 RATING Character 4 TYPE Character 10 V12 DBE for Authorware User Manual 87 Note DBF is an antiquated file format It is always assumed to be encoded in the MS DOS character set When importing
79. eadWrite top secret Always make sure that the NewObj ect method succeeded by checking the validity of the returned reference with V12Status Example gDB NewObject Vl2dbe FileLocation Catalog V12 ReadWrite top secret if Vi2Status lt gt 0 then GoTo Q NotifyUser Open 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 gTable NewObject Vl2table Call Obj ect gDB mGet Ref Tabl eName To create a table Xtra instance use the NewObj ect method with the following parameters e DB the database Xtrai nstance to which the current table belongs e TableName the name ofthetabl e to open Example gTable NewObject Vl2table CallObject gDB mGetRef Articles mGet Ref 1s a standard Xtra method that returns the exact reference of an Xtra instance Always make sure that the NewObj ect method succeeded by checking the validity of the returned reference with V12Status Example gTable NewObject Vl2table CallObject gDB mGetRef Articles if Vl2Status lt gt 0 then GoTo Q NotifyUser This is a complete example of a script that open a database and one of his table gDB NewObject Vl12dbe FileLocation Catalog V12 ReadWrite pwd if Vl2Status lt g
80. ection Example CallObject gTable mGo 11 V12 DBE for Authorware User Manual 50 Note Because mF i nd uses the selection s Master Field it 1s advised that you call mOr der By with the appropriate field before calling MSel ect and mFi nd see Search data with mSetCriteria If you don t call mOr der By mF i nd 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 This example sets the current record to the eleventh record of the selection If no such record exists mGo signals a warning mFind mFind sets the current record to one in the selection whose Master Field equals or starts with the keyword provided as a parameter see definition of Master Field in Selection and current record mFi nd is a great complement to mGo which can set the current record only based on its position in the selection The syntax is CallObject gTable mFind First Keyword Call Object gTable mFind Next Call Object gTable mFind Previous where Key word is 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 Key word If it is of type Integer Float or Date it must equa Keyword Use the first form with the First parameter if you want the n
81. ed 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 mSet Criteria 1s the method used to specify search criteria followed by mSel ect to trigger the search process Syntax Call Object table_ instance mSetCriteria FieldName operator Value Call Object table_ instance mSelect 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 andwordEquals e value this is the value to which the field contents must be compared in order to be selected This example selects all records with scores lower than 12 Call Obj ect gTable mSetCriteria score lt 12 Call Obj ect gTable mSelect Upon completion of mSel ect the resulting selection contains the set of records that satisfy the defined criteria In the above example all records that contain ascore field with a value that is strictly smaller than 2are selected In addition the selection 1s 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 t
82. efore delving into V12 DBE you need to know the following basic scripting concepts e Variables e Control structures i f statements f or loops repeat loops etc e Object instances this is covered in detail later in the Using Xtras section of this manual Free tools If you are looking for a fast and easy way to integrate V12 DBE into your multimedia projects you will want to check out the V12 DBE Tool and V12 DBE Knowledge Objects library The V12 DBE Tool helps you perform V12 database management tasks such as database creation viewing editing importing exporting and more The V12 DBE Knowledge Objects library includes a set of Authorware Knowledge Objects that allow you to quickly implement the most common of V12 DBE s functionalities Both of these products are available for download from the Free Tools section of Integration New Media s web site at http www IntegrationNewMedia com products v12authorware tools You re not alone Whether you are looking for a quick answer or in depth information there are many resources available online and offline to help you There are many many registered owners of V12 that are sharing concepts and strategies online daily And you can always call or e mail INM s customer support team to help you with any specific problems you may have The following resources may be very helpful V12 L discussion list On the V12 L discussion list you will find developers at every level of ex
83. eldName2 FieldType2 IndexType2 FieldName3 FieldType3 BufferSize3 IndexType3 if there are more than one table their descriptors follow each other Tabl e NameOf Tabl e2 FI ELDS FieldNamel FieldTypel IndexTypel FieldName2 FieldType2 I ndexType2 ere END The TABLE tag 1s followed by one parameter the name of the table This is an identifier see Defining identifiers The Fl ELDS tag 1s followed by as many lines as you need to define fields in the above defined table The syntax of each line 1s as follows see Database basics for a thorough explanation of these concepts V12 DBE for Authorware User Manual 37 Note If you try to store text longer than the size of the buffer allocated for the field type string V12 DBE signals a warning and stores the truncated text into the field Medi a that are larger than the maximum buffer size of a field are not stored at all Note A convenient way to build a Descriptor File for a database containing a large number of tables fields or indexes is to type it into a spreadsheet thus taking advantage of advanced editing functions The results can then be saved into a TAB delimited file or Copied and Pasted into a Director field for processing by mReadDBStructure Note A valid database needs at least one table and each table requires at least one field and at least one index e FieldName the name given to the field to be created This is an identifier
84. ening a Database and Opening a Table Disposing the Xtra instances 1s often referred to as Closing the Database and Closing the Table instances Open and close a database a table Open an existing database Use the NewObj ect Vl12dbe method to open an existing V12 database If your V12 database 1s not created yet see Step 3 Create a database to learn how to create it Syntax gDB NewObject Vi2dbe database filename mode password Opening a database means creating a V12dbe Xtra instance with the following parameters e database Filename thename if the database file This is usually a filename preceded by the Scripting function Fi eLocation to indicate that the file is located in the same folder as the current Authorware piece see Dealing with pathnames in Using Xtras V12 DBE for Authorware User Manual 47 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 Multi user 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 cannot be opened Example gDB NewObject Vl2dbe FileLocation Catalog V12 R
85. ent that includes several V12 V12 DBE for Authorware User Manual 76 DBE method calls then turn it off at the end of that section of code Although verbose is convenient for authoring and testing purposes you should not use it in place ofV12Status and Vl2Error to trap potential runtime errors and to display feedback appropriate for your application s end users See Errors and defensive programming Months ReadWrite persistent Valid values any 12 word string The Month property contains the names of the months used by mDat aFor mat to format dates the MMMM pattern in mDat aFor mat The Val ue 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 CallObject gDB mSetProperty Months Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Di cembre ShortMonths ReadWrite 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 mDat aFor mat The Val ue parameter 1s any 12 word string Words must be separated by spaces Short names of months that contain spaces themselves must be enclosed between apostrophes Example CallObject gDB mSetProperty ShortMonths Jan F v Mar Avr Mai Juin Juil Ao t Sep Oct Nov D c Weekdays ReadWrite persistent Valid values
86. er can call mUpdat eRecord until that user 1s finished Any other call to mEdi t Record fails because the record is locked Both V12Error and V12Status report such failures so your application can alert the user with an appropriate message when this occurs e Any attempt to retrieve the content of a locked record using mExport File mGet Selection etc returns a warning and cancels the action If many users proceed to make 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 mSel ect To detect whether a table has been modified by another user call mNeedSel ect atany time mNeedSel ect returns TRUE if records have been added deleted or modified since the current instance last called mSel ect Insome cases it is a good idea to check for mNeedSel ect on idle and refresh the displayed records when signaled to do so Example If CallObject gTable mNeedSelect then CallObject gTable mSelect do whatever necessary to refresh the display end if Counting the number of users ThesharedRWcount property is ReadOnly and non persistent It returns the number of users currently sharing the V12 DBE database file in Shared ReadWrite mode Syntax CallObject gDB mGetProperty sharedRMcount V12 DBE for Authorware User Manual 72 Possibl
87. es to the V12 DBE Tool as well as to V12 DBE s Script methods that accept dates as input parameters e g ml mport mSet Field and mSet Criteria Exporting a FileMaker Pro database to text 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 see Text qualifiers and commas as field delimiters see Custom delimiters Exporting a MS Access database to text In MS Access choose File Export to an external file or database Then select Text Files in the Save as Type menu Click Export or Save Make sure that Delimited is selected and click Next Choose an appropriate field delimiter for your data see Dealing with delimiter ambiguity choose a Text Qualifier from the list see Text qualifiers and check Include Field Names in First Row then click Next DBF file formats V12 Database Engine can import DBF files two ways 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 Win32 only DBF files can be imported using the FoxPro ODBC driver You may want to export your data as DBF files if that format is supported by your database management sy
88. ew current record to be the first one of the selection that matches Key wor d Use the second form with the Next parameter if you want it to be the next record in the selection relative to the present current record Use the third form Previous if you want it to be the previous record in the selection relative to the present current record If for example you run this script CallObject gTable mSetCriteria Age gt 30 Call Object gTable mOrderBy LastName Call Object gTable mSelect and get this selection FirstName Marie Al bert LastName Age Curie Einstein G del Mona Karp J oe Karp Karp Eric Kart man Marshal McLuhan Claude Shannon Alan Turing 3 G The selection s Master Field 1s LastName Thus a call to mFi nd would automatically look for values in this field For example Call Obj ect gTable mrind First Kar Mona Karp s Call Object gTable mFind Next Current rec becomes current rec becomes Joe Karp s CallObject gTable mFind Next current rec becomes Richard Karp s CallObject gTable mFind Next current rec becomes Eric Kartman s CallObject gTable mFind Next Current rec remains Eric Kartman s CallObject gTable mFind Previous Current rec becomes Richard Karp s V12 DBE for Authorware User Manual 51 Note mGet Fi el d retrieves only unformatted text If you store styled text In a V12 record you can retrieve
89. ewmedia com support v12authorware manuals You may also benefit from browsing through the Authorware pieces available in the Demos section of our website As with the First Steps tutorial these sample Authorware pieces are designed to help you understand V12 DBE s various features but in more depth Download them at http www IntegrationNewMedia com products v12Authorware Demos Please make sure you understand V12 Database Engine s license agreement before proceeding The full license agreement is at the beginning of this user manual see License agreement Do really need to master scripting to use V12 DBE How comfortable do you need to be with scripting to use V12 DBE efficiently The answer varies according to the complexity of your projects Simple projects require no knowledge of scripting at all If your project uses a single database and shows one record at a time on Authorware s stage chances are you can implement it using the V 2 DBE Knowledge Objects Library only If you don t need any more functionality than the Knowledge Objects library provides then no script programming will be required See Free tools below V12 DBE for Authorware User Manual 10 For more advanced projects V12 Database Engine s comprehensive scripted interface requires knowledge of scripts but 1t provides as much guidance as possible when programming such as checking the number of parameters the types of the parameters etc In a nutshell b
90. for Authorware 1n the Xtras menu What s new in version 3 3 New Features e Now supports two Japanese sort orders Yomigana and Shift JIS Japanese Bug fixes e Searching in some cases problems occurred when using multiple operators ex lt and gt e Record deletion some data was incorrectly deleted when deleting indexed string fields that contained over 251 characters Release history For details on what changed in previous releases of V12 DBE please visit the support section of Integration New Media s web site http www IntegrationNewMedia com support V12 DBE for Authorware User Manual 15 Note Existing V12 databases must be opened once in ReadWrite or Shared Read Write mode to be licensed If you open them in ReadOnly mode or from a CD ROM they cannot be licensed and the splash screen will continue to appear on computers that do not have the license file V12 DBE returns a warning when opening unlicensed databases in such circumstances How to register your V12 DBE license Evaluation copies of V12 Database Engine are available on Integration New Media s web site http www IntegrationNewMedia com along with full documentation and sample pieces You can download those files and start developing your project without purchasing a V12 DBE license The evaluation copy of V12 DBE 1s not limited in any way it only displays a splash screen upon startup To get rid of the splash screen you must
91. h ml mport This 1s very convenient for the conversion of projects that use Scripting lists to manage data and that have become difficult to debug and maintain It is also convenient to import XML documents into V12 tables Syntax CallObject gTable m mport LIST theList CallObject gTable m mport PROPERTYLIST thePropertyList where e thelist isa 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 isa 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 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 Al bert CatalogNumber 8724 Catal ogNumber 9825 CatalogNumber 1745 V12 DBE files 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 sy
92. hanges 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 Standalone packaged pieces You deliver the Xtra file V72 DBE for Authorware XTR on Mac and or V12 DBE for Authorware X32 on Windows For an Xtra to be available to an Authorware packaged piece you must to place it in a folder named Xtras located in the same folder as the packaged piece itself V12 DBE databases are cross platform compatible As stated in the licensing agreement you DO NOT deliver the license file V12 30a LIC which 1s in the System Preferences folder of your Macintosh or the Windows System folder of your PC It is not needed nor is it recommended that you distribute this file to end users because it contains your personal licensing information Web packaged pieces Authorware can automatically download Xtras via the Internet If you are using V12 In your project you need to ensure that all end users have the Xtras properly installed and running before executing any V12 functions After the completion of a piece you can package it for the web by using the Web Packager tool from Macromedia In Authorware 6 and higher the one button publishing function creates a web package as well as a regular packaged piece You can embed the web packaged piece in an HTML page and put the web packaged piece and
93. haracter 0 9 a z A Z a 6 Keywords such as NOT AND OR Stri ng I nteger Float orDate are not suitable for use as identifiers Field 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 All records are of variable length Fields of type string are limited to 64K e The range of the type nt eger is 2 to 2 1 2147483648 to 2147483647 e The range of the type Fl oat is 1 79769313486232E 308 to 2 22507385850720E 308 e Any date later than January 1 1600 can be compared retrieved and stored to fields of type Dat e However date formatting is limited to the range Jan 1 1904 through Dec 31 2037 Index e A maximum of 128 indexes can be defined on a V12 DBE database Each index can operate on up to 12 fields e Up to 32 custom string types can be defined e When indexing fields of type String up to the 251 first characters of each string are actually entered in the index The remaining characters are ignored e 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 Media Fields of type media are not supported in V12 DBE for Authorware V12 DBE for Authorware User Manual 82 Appendix 2 Database Creation and Data Importing Rules Following are examples of how
94. hat selection In our example it would be the record with the lowest score V12 DBE for Authorware User Manual 58 If you want the selection sorted in an order other than the one proposed by mSel ect you can do so by calling mOr der By right before calling mSel ect However keep in mind that this may cost some additional processing time Values provided to mSet Criteri a need to be in the same type as Fi el dName As discussed in Database basics Typecasting V12 DBE tries to automatically typecast val ue to the proper type Borderline conditions such as criteria containing extra spaces carriage returns or other unwanted characters must be avoided Example Call Object gTable mSetCriteria score lt 100 is strictly equivalent to CallObject gTable mSetCriteria score lt 100 00 but beware of the unpredictable results of CallObject gTable mSetCriteria score lt 100 00 Operations on fields of type Dat e require that Value be supplied In raw format see Step 2 Prepare the Data Dealing with dates This example locates all records where field t he Dat e contains a date occurring before May 21 1997 mSetCriteria gTable theDate lt 1997 05 21 Sort a selection mOrderBy You can define a sort order on a selection by calling the mOr der By method prior to calling mSel ect Specify the sorting order whether ascendi ng ordescendi ng and the field upon which the sort is performe
95. hat your product functions correctly within the minimum memory requirement you have recommended to your users Welcome to V12 Database Engine Welcome to V12 DBE the most powerful and user friendly cross platform database management Xtra for Macromedia Authorware version 4 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 System requirements for running V12 DBE Macintosh versions e PowerMac with System 7 1 e Mac OS X On the Macintosh V12 DBE and any other Xtra will share the same memory partition as Macromedia Authorware For simple database applications you probably do not need to change the memory partition allocated to Authorware or to packaged pieces generated by Authorware For more advanced development you may need to increase the memory partition In general we recommend that your Authorware application s memory partition be set at the maximum you can afford to give to it with enough RAM memory reserved for any other applications you may need to run at the same time as Authorware We also recommend that you allocate an absolute minimum of 8 megabytes of RAM to the packaged piece s minimum RAM requirements You may also want to ensur
96. iable x to the following string Pencils TAB 9 929 TAB 6251 CR The List and ProperyList would respectively return Pencils 5 55 9231 and name Pencils price 5 55 number 6251 Read the entire selection with special delimiters This example retrieves the entire content of each record of the selection with W commas as field delimiters and slashes as record delimiters x Call Object gTable mGetSelection LITERAL 1 Call Obj ect gTable mSelectCount J 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 Read 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 X Call Object gTable mGetSelection LITERAL 1 Call Obj ect gTable mSelectCount 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 Script List result would be X Call Object gTable mGetSelection LIST 1 Call Obj ect gTable mSelectCount name V12 DBE for Authorware User Manual 100 and the result would be Batteries Floppies Labels Pencils Ruler Tags
97. ield delimiter TAB records delimiter RETURN Character set the current operating system s virtual CR ASCII 11 Text Qualifier N Call Object gTable ml mport TEXT FileLocation myTextData txt This example imports the Text file myFile txt where is used as a field delimiter and N as a record delimiter V12 DBE for Authorware User Manual 84 e ec Tabl el limi ble ml mport TEXT the MoviePath amp myTextData txt mi t t g dDe er 9X RecordDelimiter Literals mReadDBstructure from a Literal A literal is a Script variable that actually contains the database descriptor as opposed to containing the pathname of the descriptor Text file Building a database from a literal description 1s very similar to the building it from a text file The literal must contain the database descriptor as defined in Database descriptor The Script to build the database 1s CallObject gDB mReadDBStructure LITERAL variable For example assume that the Authorware variable named Dbdescriptor contains a database descriptor the following example creates a V12 DBE database compliant to that description gDB NewObject Vl2dbe Evaluations V12 create top secret Call Object gDB mReadDBStructure LITERAL Dbdescriptor Call Obj ect gDB mBuild Del et eObj ect gDB gDB 0 If your tables fields index and full indexes definitions are stored in four Authorware varia
98. in the ShowMe pieces named V12Glossary and V12Quiz These pieces are available for download from our website at http www IntegrationNewMedia com products v12authorware demos Step 1 Decide on a Data Model Before you create your database decide which fields are needed the data type of each field how the fields should be grouped in the tables and which fields should be indexed This design effort 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 1s probably the best starting point for your V12 database model Step 2 Prepare 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 is properly entered and that it is in a format readable by V12 Database Engine Text file DBF file or one of V12 DBE s ODBC compliant formats Step 3 Create a database Use the V12 DBE Tool to create the V12 database you designed at Step 1 Alternatively you can use the database Xtra s 1 e Xtra Vi2dbes methods to write an automated database creation script in Script Step 4 Import 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 Scripts to automate the process of importing data into your V12 DBE dat
99. ing them e 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 e Media either Binary or Text are stored in external DBT files pointed to by Memo fields in the DBF file DBF fields of type Media are not supported by V12 DBE 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 Appendix 2 Database Creation and Data Importing Rules for more details In summary the exact structure and limitations of your DBF files largely depend on how your database management system deals with them 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 typestring 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 you do not need to worry about the buffer size Default buffers are set to 256 bytes forstri ngs V12 DBE for Authorware User Manual 36 Step 3 Create a database At Step 3 you formalize the database you designed
100. is used to locate data that are strictly larger than the specified value Example Call Object gTable mSetCriteria studenti D gt 950 specifies a search for students who s ID 1s larger than 950 Sudent ID 950 will not be selected Example CallObject gTable mSetCriteria 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 Authorware User Manual 60 Note Although words such as hamburger and hammer can be quickly found by the example query uing wordStarts the word ham will never be found because it is shorter than the minimum word length set for full indexing and therefore is not stored in the index Greater or equal gt The gt operator is used to locate data that are larger or equal to the specified value Example Call Object gTable mSetCriteria studenti D gt 950 specifies a search for student s who s ID is larger or equal to 950 Student ID 950 willbe selected Example Call Object gTable mSetCriteria 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 st ri ng
101. ject gTable mSetField Price 158 99 Call Object gTable mUpdateRecord IfmUpdat eRecord is not called the record created with mAddRecord is not saved to the database After calling mUpdat eRecord 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 ensure that the newly added records are saved onto the hard disk Flush the database to the disk see Flush ToDisk V12 DBE for Authorware User Manual 56 Note Updating the contents of fields that have a full index may take more time to write to the database than equivalent fields without full indexes New records are always added to the end of the selection regardless of the criteria used to form the selection Update data in a database Writing data is very similar to reading data Writing data is accomplished with mSet Field Prior to updating a field you must set the current record and your intentions must be indicated in V12 DBE with mEdi t Record Once this is completed V12 DBE will update your database with mUpdat eRecord After calling mUpdat eRecord the modified record is 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 ensure that the newly added records are saved onto the hard disk Flush the database to the disk see
102. kewise k and K are equivalent and andl 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 1n the table V12 DBE for Authorware User Manual 102 The default string The default st ri ng 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 Sorting and searching rules table for the default string type e 39 1 2 ay 7 40 2 3 lj 41 3 4 23 42 4 5 43 5 6 44 6 7 45 7 8 46 8 9 47 9 10 48 aaaaaaAAAAAA 11 49 bB 12 50 ce C C 13 51 dD 14 52 ee EEEEE 15 o 53 fF 16 54 g G 17 55 hH 18 t 56 iiiiilllil 19 57 jJ 20 58 kK 21 59 IL 22 lt gt 60 mM 23 61 n NN 24 62 0066662 OO0O000E 25 5 63 pP 26 64 qQ 27 65 rR 28 66 sS 29 67 tT 30 ee 68 uuuttiUUUUU 31 69 v V 32 u 70 wW 33 amp 71 xX 34 72 yy Y Y 35 73 zZ 36 f 74 2 37 75 eO 38 0 76 V12 DBE for Authorware User Manual 103 Predefined custom string types Along with the st
103. l menu Syntax Call Object gTable ml mport SQLserver DSN Username Password Tabl eName where e DSN is a valid Data Source Name e Username is a valid user name to access the SOL Server e Password 1s Username s matching password e TableName is the name of the table to import Example CallObject gTable mmport SQLServer InventoryDSN Admin XBF48 Products 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 Windows only Then import data to each of its tables with ml mpor t as explained above V12 DBE for Authorware User Manual 97 Microsoft SQL format Rules The following rules apply to the translation of MS SQL Server data sources to V12 databases MS SQL Server field type Binary Bit Char DateTime Decimal Float Image Int Money Numeric Real SmallDateSize Smalllnt SmallMoney SysName Text TimeStamp TinyInt VarBinary VarChar Translated to V12 field type Ignored Integer String Ignored Float Float String Integer Float Integer Float Ignored Integer Float String String Ignored Integer String String Notes Buffer size 1s same as MS SOL Server field size Buffer size 32K Data cannot be imported from Image fields Buffer size 1s same as MS SOL Server field size Buffer size 32K Buffer size 1s same
104. lared to be no larger than 255 characters Otherwise they are exported to field of type Memo e nteger 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 Cloning 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 CallObject db instance mCloneDatabase new pathname Example CallObject gDB mCloneDatabase FileLocation myClone V12 if Vl2Status lt gt 0 then GoTo Q NotifyUser gDB cloned NewObject Vl2dbe FileLocation myClone V12 ReadWrite secret password In this example a new database file named myclone V 12 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 gDB This implies that the original database file designated by g DB must be opened with the appropriate password before cloning After the new database has been cloned you need to create an instance of it using NewObj ect before you can use it Freei
105. liminating the maintenance of duplicate information Linking is important if there are relationships between the various pieces of information 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 Address City State Zip Phone Company Phone 6772 Toyon Court San Mateo CA 94403 349 5353 Rocco amp Co 526 2342 30 Saxony Ave San Francisco CA 94115 421 9963 National Laundry 982 9400 22 Hoover Ave Bowie MD 20712 731 5134 Rocco amp Co 526 2342 87 Main St Richmond VA 23233 315 3545 Presto Cleaning 751 5290 127 Big St Lebanon MO 92023 462 6267 Presto Cleaning 751 5290 V12 DBE for Authorware User Manual 24 Last Name First Name Jordan Ann Brown Charles Pintado Jack Van Damme Lucie Peppermint Patty Note Relational Database Management Systems RDBMS are usually programmed with SOL System Query Language statements which have 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 resolve such relations However adding this information might lead to duplication 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 t
106. log V12 Shared ReadWrite password At most 128 users can open a V12 DBE file inShared ReadWrite mode Shared access rules and exceptions V12 Database Engine relies on Windows and MacOS file and network managers to access shared files on a LAN Thus the following exceptions apply e Ifa V12 database is open in Shared ReadWrite mode by one or more V12 DBE clients new clients can open it only in Shared ReadWrite mode Shared ReadOnly opening is refused until the last client has dismissed its V12 DBE Xtra instances If a V12 database 1s open by one or more V12 DBE clients in Shared ReadWrite mode any Mac client will also be able to open it in Shared ReadOnly mode e Ifa V12 database is open in Shared ReadOnly mode by one or more V12 DBE clients both Shared ReadOnly and Shared ReadWrite access are permitted However if a client opens the database in Shared ReadWrite mode all Shared ReadOnly operations are suspended until the Shared ReadWirite instances are dismissed As before only Microsoft and Apple networking protocols are supported Third party networking software such as Dave CopsTalks etc are not supported Shared databases and record locking If you want to allow users to modify the content of your shared database note the following rules V12 DBE for Authorware User Manual 71 e VI2 DBE uses a record locking technique which means that if a user 1s editing the current record after a mE di t Record no other us
107. n a table and returns an integer between one and the total number of records in the selection Example currRec CallObject gTable mGetPosition the current record s position is assigned to the variable currRec mGoNext mGoNext sets the current record to the record following the current record Example Call Object gTable mGoNext Suppose that the current record is the tenth item in the selection After calling mGo Next the current record becomes the eleventh If the selection contains only ten records the current record does not change and a warning 1s reported by V12 DBE see Errors and defensive programming mGoPrevious mGoPrevi ous sets the current record to the record preceding the current record Example CallObject gTable mGoPrevi ous 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 1s the first record of the selection upon calling mGoPr evi ous 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 CallObject gTable mGoFirst mGoLast mGoLast sets the current record to the last record of the selection Example CallObject gTable mGoLast mGo mGo takes an integer parameter call it z and sets the current record to the n item of the sel
108. ndex is defined on the Publication Title field the same result can be achieved but with a slower performance Ifa 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 somewhere in the middle of the field require more time Full indexes apply only to fields oftype stri ng including those that contain styled text see Field types and International support Note 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 most likely to be searched and or sorted Defining full text indexing options For optimal full text search efficiency some level of control 1s 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 V12 DBE for Authorware User Manual 23 Note There is a practical limit to the number of tables you can have in a V12 database See Appendix 1 Capacities and Limits for specific limitations Last Name Fir
109. ned by mGet Fi el d Note that the result of a formatted value is always a string Data formatting applies to mGet Fi el d the same way it does to mDat aFor mat If two distinct formatting patterns are applied to a field with the mGet Fi el d option and mDat aFor mat the mGet Fi el d option overrides mDat aFor mat See Data formatting for a complete explanation on formatting patterns Read one or more entire records mGet Sel ecti on allows for the retrieval of one or more fields 1n one or more records of the selection The result 1s one of the followings e astring where fields are delimited by TAB s and records by CARRI AGE RETURNSs the default delimiters or by any other custom delimiters you specify e alitoflists wher e each sub list represents a record and each item of each sub list is the data contained in the corresponding field e alist 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 e mGetSel ection is powerful and flexible Its behavior depends on the syntax used to call it The syntax for mGet Sel ection to return a result of type String 1s V12 DBE for Authorware User Manual 52 CallObject table 1nstance mGetSelection LITERAL From recs FieldDelimiter RecordDelimiter Field Names The syntax for mGet Sel ection to return a Script list is CallObject table
110. nes to the success of your project A well designed project will yield high quality results on time on budget Similarly failing to lay solid foundations at steps 1 and 2 will lead to an unmanageable project with fragile results If you don t feel comfortable with steps 1 and 2 we recommend that you seek advice or hire professional help See You re not alone Using V12 DBE step by step Overview This section covers the main steps In using V12 DBE If you have looked at the First Steps manual recommended you should already be familiar with some of these steps Here we will explain in detail how to prepare the data design a data model and create a V12 DBE database A script review and a detailed explanation of table and database Xtra methods will follow V12 DBE components V12 DBE is a powerful database management engine composed of two Xtras libraries 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 ina 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 If you have read the First Steps manual and followed the accompanying ShowMe you have seen a typical step by step use of V12 DBE The individual steps to using V12 DBE are explored in greater detail in this section Other useful examples that cover these steps are illustrated
111. ng time consuming tasks such as ml mport mExportFile mGetSelection mSelect mSel Del ete mFi xDatabase and mPackDatabase Such a progress indicator can optionally feature a Cancel button to enable users to interrupt the current task You can also replace the standard V12 DBE progress bar by any custom progress indicator you provide via Authorware and Scripting To activate the progress indicator set the Progressi ndi cator property to With Cancel Without Cancel orUserDefi ned 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 theProgressindi cator Message property to whatever message you wish to display In the upper part of the progress window If you set the Progressi ndi cator Message property to an empty string V12 DBE displays its own context dependant message Without Cancel Without Cancel V12 DBE displays its own progress bar when performing one of the above mentioned tasks No Cancel button 1s shown and the current task cannot be interrupted You can set theProgressindi cator Message property to whatever message you wish to display in the upper part of the progress window If you set the Progressindi cator Message property to an empty string V12 DBE displays its own context dependant message None No Progress Indicator is shown an
112. ng 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 CallObject database instance mPackDatabase NewFilePathName Example CallObject gDB mPackDatabase FileLocation Packed DB V12 CallObject gDB mPackDatabase LAN Shared Projects Barney Ki dsStuf f V12 This example compresses g DB into a new file named Packed DB V12 located in the same folder as the current Authorware piece At the end of the operation database instance stays valid referring to the non packed database and NewFi ePat hName is a new file that can be opened with V12 DBE V12 DBE for Authorware User Manual 65 Note mi xDatabase attempts to save a corrupted file as much as possible but there is no guarantee on the result mF xDatabase essentially 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 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 database s name let fName be
113. ntax 1s as follows Call Object database instance mReadDBStructure V12 FileName Password This example uses the database Catalog V12 as a template for a new database named Specials V12 V12 DBE for Authorware User Manual 86 Tip V12 DBE does not check the validity of the content of the index file therefore you can fool it into creating an index for a field named MyField by creating an empty file named MyField IDX in the same folder as your DBF file gDB NewObject Vl2dbe FileLocation Specials V12 create MyNewPassword Call Object gDB mReadDBStructure V12 FileLocation Catalog V12 top secret Call Obj ect gDB mBuild Del et eObj ect gDB gDB 0 mReadDBStructure reads the structure of a V12 DBE file not its content To import the content of a V12 DBE file see Importing from another V12 DBE and Add records to a database Importing from another V12 DBE file 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 Call Object gTable ml mport V12 FileName Password Tabl eName where Fi eName is the pathname of the V12 database to import from password is the password to unlock it and Tabl
114. ntax for ml mport is CallObject table instance ml mport InputType InputSource other params where e nputType is one of Text DBF Literal List PropertyList V12 Access FoxPro Excel or SOLserver e nputSource is the data to import or a reference to the data to import It varies according to the selected nputType e other params are parameters that depend upon the selected nput Type For example if nput Type is text other params is an optional property list that specifies the source text file s field delimiter record delimiter etc If nput Type is Access other params are the user name password and table to import The details are explained below See Appendix 2 Database Creation and Data Importing Rules for complete examples of each of the above variations of ml mpor t V12 DBE for Authorware User Manual 46 Tip If you chose to script the database creation and importing processes once the database file is ready you do not need those scripts any longer Moreover they do not necessarily need to be delivered to the end user At this point you may want to consider removing those scripts or storing them in an appropriate place You may also want to keep all the scripts related to project creation in a single Authorware piece Tip Before you commit yourself to using the V12 DBE Knowledge Objects Library in your project you may first want to ask support IntegrationNewMedia
115. ntegers For example Call Object gtable mDataFormat phone 999 999 9999 thePhone Call Object gTable mGetField phone returns something formatted as 514 871 1333 Format dates Valid patterns for fields of type dat e are combinations of e D for days e M for months e Y for years e any other character 1s interpreted literally This example formats the date in the Year Month Day numerical format CallObject gTable mDataFormat TheDate YY MM DD MyDate CallObject gTable mGetField TheDate Assume the content of field TheDat e for the current record 1s April 30 1945 the returned string is 45 04 30 Ds Ms and Y s can be combined in the following way To format Use this sequence Days as 1 31 D Days as 01 31 DD Weekdays as Sun Sat DDD Weekdays as Sunday Saturday DDDD Months as 1 12 M Months as 01 12 MM Months as Jan Dec MMM Months as January December MMMM Years as 00 99 Y or YY Years as 1900 9999 YYY or YYYY V12 DBE for Authorware User Manual 55 Note Only mSet Fi el d can be called after m d dRecor d and before mUpdat eRecord 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 mGet Fi el d instead of calling mUpdateRecord Examples The pattern Formats 5 January 1995 as D 5 DDDD Thursday M
116. o 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 which would also be stored 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 each person Address City State Zip Phone Company Ref 6772 Toyon Court San Mateo CA 94403 349 5353 RO 30 Saxony Ave San Francisco CA 94115 421 9963 NA 22 Hoover Ave Bowie MD 20712 731 5134 RO 87 Main St Richmond VA 23233 315 3545 PR 127 Big St Lebanon MO 92023 462 6267 PR Table 2 containing information about the companies Company ref Company Phone 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 L 1 t F P pm Table with 9 Helds Table 1 with B 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 require
117. only including custom string types It locates records that start with a given sub string in the specified field Example Call Object gTable mSetCriteria LastName starts Mac sets records with last names beginning with Mac such as MacIntosh MacDonald and Mac for selection If an index is defined on the field descri pti on 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 st ring only including custom string types It locates records that contain a given sub string 1n the specified field Example CallObject gTable mSetCriteria Resume contains DOS sets records with resumes containing the string DOS for selection Searches using the contains operator are inherently sequential They cannot take advantage of any index definition and can be very slow WordStarts 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 mSet Criteria Example Call Object gTable mSetCriteria fid 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
118. or ReadOnly it cannot be opened by any other user Note Although up to 128 users can share the same V12 database over a network performance degrades rapidly 1f records must be read or written concurrently If such situations occur in your project we recommend using a client server architecture such as our GoldenGate Database Connector http www GGdbc com Advanced feature Multi user access 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 1s 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 from the Apple menu On Windows a mounted volume is either a volume that is mapped to a drive letter or a volume or partition accessible in the Network Neighborhood Opening a file in Shared ReadWrite mode To open a V12 database In a multi user environment create a V12dbe Xtra instance in Shared ReadWrite mode Syntax gDB NewObject Vi2dbe File Pathname Shared ReadWrite MyPassword Mac OS example NewObj ect Vl2dbe MyNetworkDrive Data Catalog V12 Shared ReadWrite password Windows example F is a mapped volume NewObject Vl12dbe F Data Catalog V12 Shared ReadWrite password Windows example NewObj ect Vl2dbe BigServer Data Cata
119. out this portability issue if your data contains only low ASCII characters e g English alphabet V12 DBE for Authorware User Manual 34 Note If you fail 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 1st 1900 Note MS Access databases can be imported directly to V12 databases either by using the V12 DBE Tool or through Lingo See Loading a descriptor from a source file Note Years ago DBF files were convenient given that they contained fewer variants than TEXT files However since the introduction of Windows and the popularization of DBF to other Operating Systems DBF files now contain many categories and have become difficult to manage V12 DBE s preferred file importing format is Text 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 YYYY MM DD e YYYY year in 4 digits e g 1901 1997 2002 e MM month in 1 or 2 digits e g 01 or 1 for January e DD day in 1 or 2 digits e g 040r 4for 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 field of type dat e needs to be in this raw format This rule appli
120. parameters width and height 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 Authorware the Capi tali ze function requires at least one parameter the string to capitalize However an additional parameter can be specified to modify its behaviour In this case assign the parameter 1 would capitalize only the first word in the string 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 variable number of parameters Each of these methods can be easily identified in the Xtras built in documentation explained below see Basic documentation Basic documentation In Authorware Xtras contain a built in mechanism that provides documentation for developers Open the Functions window from the Window menu or type Ctrl Shift F and select the name of the Xtra you need documentation for in the Category pop up menu Then select the method for which you need documentation The lower part of the Functions window will display a description of that function along with its calling syntax For example selecting mCreateTable inthe Xtra V12dbe category of the Functions window will display the following text in the Description area Call Object gDB mCreateTable tabl eName PAR
121. pertise and in a wide variety of expertises in the multimedia arena This friendly group is the perfect place to bounce ideas around with other V12 developers Sign up at http www IntegrationNewMedia com support list Other online resources Macromedia s web site at http www macromedia com support 1s also a possible source of information It contains among other things directions on how to subscribe to Macromedia s support Newsgroups the NNTP server ts forums macromedia com You may want to check alternate Internet resources such as Aware L join http listserv cc kuleuven ac be cgi bin wa SUBED1 aware amp A 1 Dazzle Technologies Corp Joseph Ganci site http www authorware com AWHome htm Stefan van As s website site http www xs4all nl svanas V12 DBE for Authorware User Manual 11 Macromedia http www macromedia com software authorware Customer support 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 IntegrationNewMedia com or by phone at 1514 871 1333 Option 6 Priority will be given to registered V12 DBE users Customer support covers Helping you to understand V12 DBE clarifying specifications gt Supplying you with sample scripts for generic concepts gt Providing useful tips Developer assistance Where Customer Support stops Developer As
122. purchase a V12 DBE license or as many as required by the V12 DBE license agreement As a licensed user you are given a registration number that you must enter in Authorware s Xtras gt V12 DBE for Authorware gt Register menu item Era Window Help Library Links ipei leon Size Hepat Other WIADBE for 4uthonvare amp About Register Once your copy of V12 DBE is licensed all new databases you create are automatically registered and do not show a splash screen Existing databases are also registered as soon as they are opened by the registered V12 DBE 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 V12 DBE for Authorware XTR on Mac V12 DBE for Authorware X32 on Windows and V12DBE A X16 on Win16 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 many copies as you wish you cannot distribute your license file V12 DBE for Authorware User Manual 16 Note In the rest of this document the term Xtra refers to Scripting Xtras unless otherwise specified Using Xtras This section deals with Xtras and ho
123. r to ml mport Translates imported and exported files whether Text or DBF with the Windows ANSI Mac Standard or MS DOS character set tables Call Obj ect gDB mSetProperty CharacterSet Mac Standard See Step 2 Prepare the Data Character sets Resources ReadOnly non persistent Call Object gDB mGetProperty resources Returns information on the number of available indexes and the index used by the last call to mSel ect Example Number of indexes used 6 Current index in table students Student DNdx using field Student I D V12 DBE resources should not be confused with the MacOS resources those normally edited with ResEdit they are completely unrelated CurrentDate ReadOnly non persistent mGet Property 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 aDate Call Object gDB mGetProperty Current Date 2002 05 09 is assigned to the variable aDate Verbose ReadWrite 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 Authorware s Control Panel window Example Call Object gDB mSetProperty verbose on Call Object gDB mGetProperty verbose This property is extremely useful for debugging database errors during testing Turn verbose on at the beginning of a script segm
124. rder 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 this example three records share the same last names Cartman Indexing the field Last Name alone would certainly force Last Names to be properly ordered But this would not determine the order in which the Cartman s are sorted Last Name First Name City State Zip Brown Charles San Francisco CA 94115 Cartman Wendy San Mateo CA 94403 Cartman Lucy Richmond VA 23233 Cartman Eric Lebanon MO 92023 Pintado Jack Bowie MD 20712 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 Last Name and FirstName The sorted result would then be V12 DBE for Authorware User Manual 22 Last Name First Name City State Zip Brown Charles San Francisco CA 94115
125. re 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 b 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 or included with the original copy supplied by INM c Reproduce and distribute the files named V12 DBE for Authorware XTR V12 DBE for Authorware X32 and V12DBE A X16 collectively Runtime Kit provided that 1 you distribute the Runtime Kit only in conjunction with and as part of your own Product and 11 own a license for the Software that contains the Runtime Kit d Any third party who may distribute or otherwise make available a product containing the Runtime Kit must purchase its own license of the Software e Any third party who will use the Runtime Kit in an authoring environment must purchase its own license of the Software f Ifthe Software is licensed as an upgrade or update then you may only use the Software to replace previously validly licensed versions of the same software You agree that the upgrade or update does not constitute the granting of a second license to the Software 1 e you may not use the upgrade or update in addition to the software it is replacing nor may you transfer the software
126. rs on V12 L http www IntegrationNewMedia co m support list for advice Introduction Welcome to V12 Database Engine V12 DBE the most versatile and user friendly cross platform database management Xtra for Macromedia Authorware and Director V12 Database Engine for Authorware V12 Database Engine DBE was originally designed In 1996 to be used specifically with Director and Authorware It extends Director and Authorware s features and helps you speed up the development of your multimedia titles You will discover many benefits in using V12 DBE to create multimedia applications such as electronic storybooks training material games and more Used as a back end to your multimedia projects V12 DBE allows you to store and manage content separately from the Authorware development platform V12 Database Engine helps you provide advanced functionality to your end users while bringing down your development and maintenance costs V12 DBE 1s very flexible and scalable and can be used In a wide range of applications from simple projects where Script Lists and FileIO have become difficult to manage to true database driven applications Where to start Before browsing through this User Manual we recommend that you look at the First Steps manual which includes a tutorial designed to help you get up and running with V12 DBE in a few short steps The First Steps tutorial is available for download at http www integrationn
127. rsion of the Xtra Example xtraversion Call ParentObject Vl2dbe mxtraVersion Changing a password You can change the password assigned to a database by using the mSet Password method The new password can be an empty string The syntax 1s as follows CallObject database instance mSetPassword oldPassword newPassword Example CallObject gDB mSetPassword houdini ali baba Dynamically downloading databases via the Internet V12 has the ability to dynamically download an updated database via the Internet to a local storage device V12Downl oad is the method that you use to replace a database on a user s local drive The syntax 1s as follows V12 DBE for Authorware User Manual 66 Tip You may also want to consider having an associated text file or a separate database with a time stamp or other important information within it which you can use to determine whether or not the database has changed or needs to be downloaded The syntax is as follows V12Download url local file password completion callback variable status callback variable V12download resumes and returns control to Authorware immediately after initiating the download query It updates the variable status callback variable as frequently as possible during download generally used to display the download status in the user interface and updates the variable compl eti on callback variable when the download is complete gener
128. sistance 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 gt Project design data structure analysis planning Technical guidance throughout the various steps of your project gt gt Troubleshooting and debugging your scripts gt Optimization how to obtain superior performance gt Assistance with other Xtras custom development of Xtras You can think of Developer Assistance as an additional team member or members that you can add on to your project team They can fulfill a small or large role on your team depending on your needs V12 DBE for Authorware User Manual 12 Note Special annotations and tips are enclosed in the sidebar like this one 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 tutorial which includes a manual and sample Authorware piece will guide you step by step through the basics required to implement simple database management in your multimedia projects This manual is organized to help you get the information you need efficiently e The Using Xtras section deals with basics concerning Xtras e
129. sive examples on how to import databases from a variety of sources including Microsoft Access Microsoft Excel FoxPro Import data with 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 Inthe File menu you will see the following options for importing data Import Text File Import DBF File Import from V12 Import from FoxPro Import from Excel Import from Access Import from SQL Server Choose the appropriate option for the format for your data 3 Browse through your disk to locate the file containing the data to import and fill in any other information necessary to open the file For some formats you may also need to specify a table name Click Import If the source data is in more than one file you can successively import them by repeating the above steps Script the data importing ml mport imports data to a V12 DBE table both at authoring time 1 e in Authorware s development environment and at runtime 1 e from a packaged piece ml mport 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 variable etc V12 DBE for Authorware User Manual 45 a DBF file a V12 database a Script list a MS Access dat
130. splay the message to the user For an example of how to implement this type of feedback download the V12 DBE Quiz on the Demos section of our webiste at http www integrationnewmedia com products v12authorware demos Errors 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 V12 DBE for Authorware User Manual 68 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 V12Status returns negative codes for errors and positive codes for warnings Often the term erroris used to designate faults of both types i e errors and warnings Based on the value returned from V12Status you can display specific messages to your end users Example Call Object gTable mSetCriteria UserName EnteredName errCode Vl12Status if errCode 8690 then ErrorMessage Please fill in your username GoTo Show Message and Retry end if Call Obj ect gTabl
131. st Name Jordan Ann Brown Charles Pintado Jack Van Damme Lucie Peppermint Patty of the full indexes by allowing for the definition of Stop Words words that must be ignored Delimiters characters that delimit word boundaries and MinWordLength the size of the shortest word that must be considered for full indexing Database A table its fields and the indexes defined are stored 1n a database A database can contain one or more such tables Database Address 5772 Toyon Court 30 Saxony Ave 22 Hoower Ave BY Mam St 127 Big St Last Name First name Record 1 jordan Ann Record 29 Brown Charles Record 3 Fintada Jack Van Damme Lucie 349 5353 421 9963 731 5134 315 3545 462 6267 San Mateo San Francisco Bowne Richmond Lebanon Peppermint Patty Table Blablabla Alo Blabla Table Flat and relational databases A flat databaseusually 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 need 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 e
132. stem 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 e Field names are limited to ten characters all in upper case e The number of fields per DBF file 1s limited to 128 e Records are of fixed length determined upon the creation of the DBF file V12 DBE for Authorware User Manual 35 Note Database management systems that use a fixed length record format such as the DBF file format use the maximum record length 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 refers to the RAM buffer used while transferring data between Director and the V12 database files e 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 e Indexes are saved in separate files with extensions such as IDX MDX NDX or CDX depends on the managing application e DBF files cannot be password protected However some applications protect DBF files by encrypting decrypt
133. t iri Buffer size size of field in m Um DBF file Integer Integer Numeric with no digit after fixed Integer point Numeric with one or more sama T s point Float Float Double Float On Windows 3 1 and Mac68K acceptable values are Currency Float in the range 2 to 2 1 where k 31 minus the number of decimal places Date Date Data cannot be converted from fields of type DateTime Only elena Pale the default date 1900 01 01 is imported FALSE values are translated to Logical into 05 TRUE values to Zs and undefined values represented by in the DBF file to Zs 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 can also store binary data of arbitrary formats Binary formatted memo fields cannot be imported directly into V12 DBE databases When importing standard ASCII data from a DBF file that contains Memo fields the corresponding DBT files are automatically processed by V12 DBE V12 DBE for Authorware User Manual 90 Microsoft FoxPro 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 template for a V12 database The FoxPro ODBC driver is required to perform this operation The names of yo
134. t 0 then GoTo Q NotifyUser gTable NewObject V1l2table CallObject gDB mGetRef Articles if Vl2Status lt gt 0 then GoTo NotifyUser other init instructions V12 DBE for Authorware User Manual 48 Note If you want the results of your query to be sorted always call mOr der By before calling mSel ect All SeeSorta selection mOrderBy Close a table To close a table call the DeleteObject method and set the variable that refers to it to 0 Example Del eteObj ect gTabl e gTable 0 Close a database To close a V12 Database call the DeleteObject method and set the variable that refers to it to 0 Example Del et eObj ect gDB gDB 0 Always make sure to dispose of all V12table instances before you dispose of the V12dbe instance that contains them 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 earlier in this manual for more details At any time the selection 1s sorted according to one of its fields You can enforce that sorting order with m0r der By see Sort a selection mOrderBy Otherwise the selection s sorting order would be defined by the index chosen by V12 DBE for its last search The field that determines the selection s sorting order is called the master field Selection at star
135. t method Example V12 DBE for Authorware User Manual 63 Call Object gTable mSetCriteria FirstName El mo Call Object gTable mSelect selSize Call Object gTable mSelectCount In this example the number of records in the selection the number of 1tems named Elmo is stored in s el Si ze Exporting data mExportSel ection allows exporting of data from a V12 DBE table to TEXT or DBF files DBase III Only the selected records are exported 1 e those in the selection To export a complete table make sure it 1s entirely selected first see Selection and Select all the records of a table Exporting in TEXT format The syntax for exporting all the fields of a table s selection 1s CallObject table instance mExportSelection TEXT FileName The above instruction exports all the fields of the selection to the file named Fil eName The field and record delimiters are TAB and CARRI AGE RETURN respectively To specify custom field and record delimiters use CallObject table instance mExportSelection TEXT FileName FidDelimiter RecDelimiter Example CallObject gTable mExportSelection TEXT FileLocation Output txt 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 CallObject table instance mExportSelection
136. t the first row contains the field names This way V12 DBE can associate an Excel column to a V12 DBE field force MS Excel to commit to the new column s format depends on version of Excel Syntax Call Object gDB mReadDBStructure Excel FileName where Fi eName is the path to the XLS file Importing from Microsoft Excel Windows 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 1s required Syntax Call Object gTable ml mport Excel FileName Tabl eName 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 Tab eName is the name of the table to import Example Call Object gTable m mport Excel FileLocation Results XLS Protected MS Excel workbooks cannot be imported Converting a MS Excel workbook into a V12 database 1s a two step process First create the V12 database see Importing from Microsoft Excel Windows only Then import data to each of its tables with ml mpor t as explained above V12 DBE for Authorware User Manual 95 Microsoft Excel Rules The following rules apply to the translation of MS Excel file structures to V12 databases MS Excel field type General Number Currency Accounting Date Time Percentage Fraction Scientific Text Special Custom Translated to
137. t the type of the file that contains the descriptor information File types that are supported by the V12 DBE Tool include Text DBF file V12 file Template FoxPro file Access file Excel file SQL Server Database If your data 1s already in one of the database file formats listed here you can simply use that database to retrieve the descriptor information Click the Load button and browse to the file that contains the descriptor information Once the descriptor information appears in the Descriptor box you may edit it For instance your source database may contain several tables and you may only want to include a subset of these in your V12 database For more information see the V12 DBE Tool s User Manual The V12 DBE Tool and User Manual are available for download from the Free Tools section of Integration New Media s web site http www integrationnewmedia com products v12authorware tools Script the database creation Automating the creation a V12 database through Scripts with V12 DBE consists 1n three steps a Create an Xtra instance of the database with NewObject b Define its structure with mReadDBstructure C Build the database with mBui d The general form of a database creation Script 1s gDB NewObject Vl2dbe FileLocation filename v12 create Password if V12Status lt gt 0 then GoTo Q NotifyUser mReadDBStructure gDB InputType other params if V12Status lt gt
138. tName starts Mc Call Object gTable mSetCriteria or LastName Mobutu Call Obj ect gTable mSelect It selects all records whose LastName field starts either with Mac or starts with Mc or matches exactly Mobutu V12 DBE for Authorware User Manual 62 Note Partial selections also work with complex searches but not a of them They are only accepted for complex searches that do notuse full text indexes i e WrdStarts or WordEqual s Complex criteria are very powerful but can be tricky to use This example illustrates complex criteria CallObject gTable mSetCriteria LastName MacDonal d CallObject gTable or mSetCriteria LastName McGill J CallObject gTable and mSetCriteria score lt 50 Call Object gTable mSelect This section of script selects all MacDonalds and all McGills who s scores are lower than 50 This is very different from Call Object gTable mSetCriteria LastName MacDonald Call Object gTable and mSetCriteria score lt 50 Call Object gTable or mSetCriteria LastName McGill Call Object gTable mSelect where the selection consists of all MacDonalds with scores lower that 50 and all McGills regardless of their scores To illustrate the semantic difference between the two requests we could express the first as LastName MacDonald or LastName McGill and score lt 50
139. ta in a database Delete a record Delete all the records of a selection Search data with mSetCriteria Exporting data Cloning a database Freeing up disk space packing Fixing corrupted database files Checking the Vversion of the Xtra Changing a password Dynamically downloading databases via the Internet Errors and defensive programming Error management in applications Checking the status of the last method called Errors and warnings Using the verbose property Delivering to the end user Standalone packaged pieces Web packaged pieces Testing for end users Advanced feature Multi user access Multi user access Opening a file in Shared ReadWrite mode Shared access rules and exceptions Shared databases and record locking Counting the number of users Possible configurations Customizing the V12 database engine V12 DBE for Authorware User Manual 45 45 46 47 47 47 47 49 49 49 50 52 56 57 58 58 58 64 65 65 66 66 66 66 68 68 68 68 69 70 70 70 70 71 71 71 71 71 72 73 74 Progress indicators 74 Options of the progressindicator property 74 Properties of databases 74 Predefined properties 75 The String property 78 Custom properties advanced users 80 Appendix 1 Capacities and Limits 81 Database 81 Creation 81 Selection 81 Importing 81 Table 81 Field 82 Index 82 Media 82 Appendix 2 Database Creation and Data Importing Rules 83 Text Files 83 Literals 85 Lists or Property Lists 86 V12 DBE files 86
140. tance 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 andmSel ect except for NewObj ect NewObj ect isa compulsory method and scripting Xtra s support it This example creates a table called Tabl eName in the database referred to by g DB CallObject gDB mCreateTable TableName Closing an Xtra When the Xtra instance has completed its function and 1s no longer required close it by calling Del eteObj ect 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 NewObj ect must be ultimately closed with Del eteObj ect once they are no longer needed Example Del eteObj ect gDB Although Del et eObj ect does exactly what it is intended for it is always a good practice to systematically set the deleted objects reference to 0 This makes it simpler to know whether a database is open or closed you only need to check wheter the variable used to refer to 1t 1s zero or not Example Del et eObj ect gDB gDB 0 Checking for available Xtras You can learn which Xtras are available to Authorware by opening the Functions window from the Window menu and che
141. ter Field e mGet Field requires that you set the current record to the record you need it is recommended that you call to retrieve data from mGet Sel ecti on does not mOr der By with the appropriate field before calling mSel ect and See Appendix 3 mGetSelection examples for complete examples of each of the mGet Uni que above variations of mGet Sel ection If you don t call mOr der By mGet Uni que returns unique values from the Master Field Read unique values of a field chosen by default by V12 DBE i ah e ae cU mGet Uni que returns unique values of the Master Field in a string or a list See the default index if the table was Selection and current record for a definition of Master Field just opened or the one indexed Syntax by the best index chosen by V12 DBE for the last selection See a CallObject gTable mGetUnique LITERAL Selection and current record b Call Object gTable mGetUnique LIST mGet Uni que 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 this script CallObject gTable mSetCriteria category T shirt CallObject gTable mSetCriteria and size XXL Call Object gTable mOrderBy
142. the text without the style formatting using mGet Field mFi nd can be used to quickly locate one occurrence of a keyword in a selection where many duplicate values exist as opposed tomSet Criteria and mSel ect which find all occurrences but need more time Read 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 1s accomplished by use of the mGoNext mGoPrevious mGoFirst mGoLast mGo and mFind methods see Browse a selection Read fields of type string integer float and date Once the current record 1s properly set mGet Fi el d retrieves the data from a specific field Syntax var CallObject table instance mGetField fieldName dataFormat Example slD CallObject gTable mGetField Student D This example stores the content of the St udent D field from the current record in the variable s D You do not need to specify the type of field you are reading The Script variable is automatically set to the appropriate type after a successful call to mGet Fi el d see Typecasting in Database basics Example Avg CallObject gTable mGetField AverageScore 99 99 This example retrieves the formatted content of the Aver ageScore field to the Avg variable The formatting is according to the pattern 99 99 That is if the field AverageScore contains the value 1245 5 the string 1 245 50 is retur
143. tion becomes the current record e fno 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 This figure illustrates the 1dea of searching a table for records satisfying a certain criteria The result 1s placed in a selection the first record of which becomes the current record V12 DBE for Authorware User Manual 27 Table containing all records nny ae b Current Search Record Criteria vi T Yy d Selection 1 z 3 4 5 6 a g Lo 11 1z 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 mGoFi rst mGoLast mGoNext mGoPrevi ous and mGo You can read the contents of a field in the current record modify its contents or delete the entire record When you move from one record to then next in the selection the current record pointer changes Note that if you modify the fields of the current record you must call mUpdat eRecord to save your changes to the database before moving to another record otherwise your changes will be lost V12 DBE for Authorware User Manual 28 Note Although steps 1 and 2 do not involve any production work or programming they are the most critical o
144. to work with existing databases from a variety of vendors In order to use them In V12 DBE As well we have outlined standard Rules that can be referenced when you are trying to import the structures or the data from a specific database format The basic steps for converting a database from another database format into V12 are as follows 1 Determine and or Import the structure of the original database s into a readable format using mReadDBStructure 2 Create the V12 database and indexes based on the structure of the original database s 3 Import the data from the original database s into the V12 databases you created in Step 2 using mImport Below are examples of how to read the database structure and import files from the following text or database formats as well as rules for each Database Format Page TO IN esc 2 AAN AA N 25 5 83 i S nn ss E ss 85 List OP FPO Pett dh 86 YE DBI 5 ss E 86 DBF Database Format uu u lusauaaqaakasaanasaashiyawqyakakassa 87 Microsol PO UO snr 91 Microsoft ACCESS ONERE 92 MESON I o a E EA N E 94 Microsoft SOL DOEVEE emat Isto NI aan NE 96 Text Files mReadDBstructure from a Text File To read a database descriptor into V12 DBE use the following Script statement CallObject database instance mReadDBStructure TEXT File Pat hname Assuming that the name of the database descriptor s filename is Def txt the following Script creates a new V12 DBE
145. tom string types where you define a sort search description table for each Therefore you can define your own string type for any language supported by single byte characters including Klingon Selection current record search criteria 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 1s Jack e State is California Number of points 1s less than 30 e ast 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 1s less than 30 and Last name contains pe The selection is a 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 e Ifexactly one record satisfies the search criteria the selection contains only that record which automatically becomes the current record e Iftwo or more records satisfy the search criteria the selection is the set of those records and the first record of the selec
146. trade names and product names contained in this manual may be the trademarks or registered trademarks of their respective owners and are hereby acknowledged V12 DBE for Authorware User Manual 6 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 manuals sample files and data collectively Software are licensed not sold to you by Integration New Media Inc INM for the purpose of using it for the development of your own product Product only under the terms of this Agreement INM and its licensors reserve any rights not expressly granted to you INM and its licensors grant you no right title or interest in or to the Software The Software is owned by INM and its licensors and is protected by International copyright laws and treaties If you are using V12 Tracker Section 2 applies to you 1 License INM grants you a non exclusive non transferable perpetual unless terminated in accordance with this Agreement royalty free worldwide license to a Install one 1 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 1 e hard disk This installed copy of the Software may be accessible by multiple computers however the Softwa
147. tring indexed END The comment opening tag for database descriptors must be followed by a blank character such as a space tab or CARRI AGE 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 Multiple tables in a descriptor If your database has more than one table each new table follows the description for the previous table before the END tag Example TABLE NameOf Tabl el FIELDS FieldNamel FieldTypel IndexTypel FieldName2 FieldType2 IndexType2 FieldName3 FieldType3 BufferSize3 Full I NDEXES FieldName3Ndx duplicate ascendi ng TABLE NameOf Tabl e2 FI ELDS FieldNamel FieldTypel IndexTypel FieldName2 FieldType2 IndexType2 etc END Using the V12 DBE Tool To create a V12 database using the V12 DBE Tool 1 Choose File gt New 2 Fill out the Database Descriptor field according to the syntax described in Database descriptors or load a descriptor from an external file see Loading a descriptor from a source file 3 Provide a name and optionally a password for your new V12 database 4 Click the Create button V12 DBE for Authorware User Manual 40 Loading a descriptor from a source file Instead of filling out the Database Descriptor field manually in the V12 DBE Tool you can load one from an external file Click the Source list to selec
148. ts Windows ANSI character set 32 70 F 108 146 184 222 b 33 71 G 109 m 147 185 223 B 34 72 H 110 n 148 186 224 35 73 111 0 149 187 225 36 74 J 112 p 150 188 226 37 96 75 K 113 q 151 189 227 a 38 amp 76 L 114 r 152 190 34 228 39 77 M 115 s 153 TM 191 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 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 i 50 2 88 X 126 164 n 202 240 6 51 3 89 Y 127 165 Y 203 241 52 4 90 Z 128 166 204 242 6 53 5 91 129 167 205 243 54 6 92 130 168 206 244 6 55 7 93 131 f 169 207 245 6 56 8 94 A 132 170 208 D 246 6 57 9 95 _ 133 171 209 N 247 58 96 134 t 172 4 210 248 59 97 a 135 t 173 211 249 60 98 b 136 174 212 250 61 99 c 137 o 175 213 251 62 gt 100 d 138 176 214 252 63 101 e 139 177 215 x 253 y 64 102 f 140 178 216 254 b 65 A 103 g 141 179 3 217 U 255 y 66 B 104 h 142 180 218 U 67 C 105 i 143 181 H 219 68 D 106 j 144 182 q 220 U 69 E 107 k 145 183 221 Y V12 DBE for Authorware User Manual 107 Mac Standard character set 32 70 F 108 I 146
149. ts 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 Import data with mImport in Step 4 Import data into a V12 DBE database and VirtualCR in Properties of databases Text qualifiers A text qualifier is a special character used to begin and end each Text field In most database management systems the quotation mark is the default text qualifier Its main purpose 1s to group a field s content between two identical marks so as 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 CRRed CRGreen CRBlue Shoe this description field contains commas and Carriage Returns 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 ml mport method s Text Qualifier property to the right character See Import data with mImport In Step 4 Import data into a V12 DBE database Custom delimiters Another way to avoid delimiter ambiguity 1s to choose delimiters other than TAB and CR Some database management systems allow yo
150. tup 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 zs 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 indexes is the default index see View the structure of a database You never need to explicitly manage indexes in V12 DBE The best index 1s always chosen by V12 DBE to perform a search Select all the records of a table Call mSe ect Al at any time to set the selection to the whole table Syntax Call Object table instance mSelectAll Example Call Object gTable mOrderBy Studenti D ascendi ng Call Obj ect gTable mSelectAll This example sets the selection to the whole table as referred by gTabl e in ascending order of StudentID s lowest to highest The field StudentID must be indexed for mSel ect Al to work efficiently Otherwise it would be very slow V12 DBE for Authorware User Manual 49 Browse 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 record to various values related to a given selection mGetPosition mGetPosition checks the position of the current record i
151. u to select appropriate delimiters before exporting to a TEXT file e g 4 Dimension Some others allow only the selection of a custom field delimiter and always use CRs as record delimiters e g MS Access FileMaker Pro and MS Excel do not allow for any customization V12 DBE s ml mport method assumes by default that the field and record delimiters are TAB and CR However other delimiters can be specified See Import data with mImport in Step 4 Import data into a V12 DBE database V12 DBE for Authorware User Manual 33 Note Most applications import export DBF files using the MS DOS character set 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 ina text file Processing the exported text file If the database management system used to store your data 1s 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 1s a non exhaustive list of helpful tools e BBEdit from Bare Bones Software http www BareBones com For MacOS e TextPad from Helios Software Solutions http
152. ual 43 FULL I NDEXES description END 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 mReadDBst ructure V12 DBE for Authorware User Manual 44 Note ml mport was introduced with V12 DBE version 3 0 It replaces the former ml mport File method and is more comprehensive Although ml mport File is still supported in V12 DBE version 3 2 it will be phased out in future versions Step 4 Import data into a V12 DBE database In Step 3 Create a database you created a properly structured although empty V12 database Step 4 explains how to import the data prepared at Step 2 Prepare the Data into your V12 database You can import data into a V12 database through one of the two following methods e using the V12 DBE Tool This is a convenient point and click environment for small projects e using V12 DBE s mImport method in a Script handler This approach 1s 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 Script handlers than simply using the V12 DBE Tool For exten
153. uals Appendix 6 J apanese support New field types V12 Database Engine supports Japanese text by adding two new field types String SJIS and String YOMI The mReadDBStructure method must be used to create those two new fields Example TABLE NameOf Table FIELDS sjisfield string SJ1IS yomifield string YOMI NDEXES sjisfieldndx duplicate sjisfield ascending yomifieldndx duplicate yomifield ascending END Field of type SJ IS SJIS fields can hold Japanese text in the Shift JIS format Katakana Hiragana English alphabets punctuation numerals and Kanji are available in this representation Sorting A SJIS sort will order the fields thus the records according to the Shift JIS numerical code of the characters 1 or 2 bytes in it There is no strict equivalence of characters 1n this sort order This means that each character has a distinct location in the table and will always sort the same way in a similar sort operation Searching All operators are supported and Boolean set operators AND and OR are also supported Field of type Yomi Yomigana This field can hold a subset of Shift JIS character This subset is restricted to the full range of Katakana hiragana including those with voiced diacritic marks nigori maru and small characters contracted sounds It can also contain punctuation characters This field doesn t contain kanji Sorting The exact sorting order of the syllabaries 1s
154. uffer size is same as Access field size Number byte Integer Number integer Integer ae Integer long integer Number single Float Number double Float PIDE Ignored replication ID Currency Integer Date Time Ignored Autonumber Integer Yes No Integer OLE Object Ignored HyperLink String URL imported as text Memo String Buffer size is 32K MS Access unique and duplicate indexes are properly converted to unique and duplicate V12 DBE indexes with ascending field values Microsoft Excel mReadDBstructure from MS Excel Windows 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 1n 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 Decide 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 gt Cells and select the Number tab It may be necessary to Save As your workbook with a new name to V12 DBE for Authorware User Manual 94 Note It is important tha
155. ur FoxPro files and their field names must be valid V2 DBE identifiers see Defining identifiers in Step 1 Decide on a Data Model Syntax Call Obj ect gDB mReadDBStructure FoxPro DirectoryPath where Di rectoryPath is the path to a directory not a file Thus it must necessarily end with a N Example gDB NewObject Vl12dbe FileLocation myDB V12 create secret CallObject gDB mReadDBStructure FoxPro FileLocation FoxDB CalloBject gDB mBuild Del eteObj ect gDB gDB 0 Once the corresponding V12 database structure 1s created with mReadDBStructure the data from your FoxPro tables can be imported Importing from Microsoft FoxPro Win 32 only Fox Pro DBF files can be imported to V12 tables provided a MS FoxPro ODBC driver is present on your PC No DSN Data Source Name is required Syntax Call Object gTable ml mport FoxPro FileName where Fi eName 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 Properties of databases Example Call Object gTable m mport FoxPro FileLocation Results XLS Tabl eName Converting a FoxPro database into a V12 database is a two step process First create the V12 database and then import data to each of its tables with ml mpor t as explained above V12 DBE for Authorware User Manual 91 FoxPro Microsoft Fox
156. ur receipt that the media on which the Software is recorded will be free from defects in materials and workmanship under normal use and the Software will perform substantially in accordance with the user manual INM s entire liability and your sole and exclusive remedy for any breach of the foregoing limited warranty will be at INM s option replacement of the disk refund of the purchase price or repair or replacement of the Software 8 Limitation of Remedies and Damages In no event will INM or its licensors 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 loss of expected savings loss of confidential information presence of viruses 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 materials regardless of the basis of the claim and even if INM or an INM representative has been advised of the possibility of such damage INM s liability to you for direct damages for any cause whatsoever and regardless of the form of the action will be limited at INM s option to refund of the purchase price or repair or replacement of the Software THIS LIMITATION WILL NOT APPLY IN CASE OF PERSONAL INJURY ONLY WHERE AND TO THE EXTENT THAT APPLICABLE LAW REQUIRES SUCH LIABILITY
157. ust omit the Language identifier CallObject gDB mSetProperty String MinWordLength 2 The default value for MinWordLength is 4 String Language StopWords ReadWrite persistent Valid values a string no longer than 32K Stop Words allows for the definition of a list of words that must be ignored in the full indexing process The Val ue parameter is a string containing the stop words in any order separated by spaces TABs or Carriage Returns V12 DBE for Authorware User Manual 79 Note Remember that at most 4096 characters can be stored in individual properties Example Call Object gDB mSetProperty String Spanish StopWords elest en la de To modify the stop words list of the default string just omit the Language identifier rr E mSetProperty String StopWords a the on for 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 fromit to are had not was as have of with at he on which be her or you but his that Custom properties advanced users Advanced users may want to define their own properties and make them persistent to a database This 1s 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 name of the user who last accessed your application Call Object gDB mSetProperty L
158. w they are used in Macromedia Authorware 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 section covers e What is an Xtra e Making an Xtra available to Authorware e Creating a Script Xtra instance e Verifying whether the instance was successfully created e Using the Script Xtra instance e Freeing the Script Xtra instance e Where to get additional Documentation What is an Xtra Xtras are components alternatively know as add ons or plug ins that add new features to Macromedia Authorware Many of Authorware s own functions are implemented as Xtras A few complex tasks can be performed using Authorware s scripting language However very complex and time critical tasks are normally implemented as Xtras Xtras are a new add on standard introduced with Macromedia Authorware 4 0 that add functionality to your multimedia applications Four types of Xtras are supported by Authorware Scripting Xtras Tool Xtras Transition Xtras and Sprite Xtras Making an Xtra available to Authorware Xtras are designed to be opened automatically by Authorware in authoring mode by its runtime packages in runtime mode also called playback mode The Xtras must be placed in the Xtras folder located either in Authorware s folder or Authorware s runtime folder This feature is supported on both Macintosh and
159. xes can be defined after the NDEXES tag as in TABLE Students FIELDS LastName string FirstName string Age integer I NDEXES CompoundNdx duplicate LastName ascending FirstName ascending END The general syntax of a compound index definition 1s NDEXES Indx1 UniqueOrDup FieldName AscOrDesc 9 where e ndx1 is the name of the compound index e Uni queOr Dup is either unique or duplicate depending upon whether or not you allow duplicate entries for that index e FieldName is the name ofa field defined under the FI ELDS 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 Authorware Scripts do In Script comments are preceded by double hyphens and must be followed by a CARRI AGE RETURN In database descriptors comments must be preceded by and be followed by They can include any sequences of characters including CARRI AGE RETURNS V12 DBE for Authorware User Manual 39 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 2 TABLE Reci pes this is also a valid comment FI ELDS NameOf Recipe s
160. y according to the specific ODBC driver installed on your computer Step 3c Build 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 mBui d mBui d checks if the database 1s well defined and creates the file on your disk Syntax CallObject database instance mBuild Once the database file 1s built the database 1nstance remains valid and data can be immediately imported into the file It is as if the database was opened In ReadWrite mode View the structure of a database You can view the structure of a database with mDumpSt ructure Syntax CallObject database instance mDumpStructure Example DBdump CallObject gDB mDumpStructure The above example sets the Authorware variable Dbdump to the structure of the database referred to by g DB Structure of file HardDisk myDatabase V12 created on Thu Apr 25 15 55 07 2002 last modified on Tue May 14 15 31 53 2002 file format version V12 3 3 Multi User m TABLE Articles FI ELDS name string 256 category string 256 price Float catalognumber Integer description string 600 NDEXES 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 V12 DBE for Authorware User Man
161. you must have a registered V12 DBE license file on your workstation If you do not have a licensed V12 DBE on the workstation your databases will be unlicensed and will display a splash screen each time they are opened The best approach is often to clone new databases from existing databases Selection Up to 100 criteria can be chained with sequences of mSet Criteria separated by Boolean operators Importing 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 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 Win32 MS Access databases MS FoxPro files MS Excel workbooks and MS SQL Server data sources can be used as templates for creating new V12 databases and as sources of data for importing records through ODBC drivers The exact database translation data importing rules varies among ODBC drivers and versions of ODBC drivers Table Because a maximum of 128 indexes is permitted and since each table requires at least one index the maximum number of tables in a V12 DBE database is 128 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 which can V12 DBE for Authorware User Manual 81 be followed by any alphanumeric c
162. you to keep a close check on your programming Use the global functions V12Status andV12Error to confirm each step of database creation and handling As well Authorware has an interesting tool to help you detect your script errors the Control Panel by putting traces available in the Windows menu Also a good tool to take advantage of in database projects that write data to a storage device 1s FlushToDisk It will help you ensure that all of your data is written to the storage device at important intervals flushing the disk cache Checking the status of the last method called Call V12Status after each call to VI2 DBE methods both V12dbe and V12table methods to check its outcome V12Status returns 0if no error occurred during the execution of that method Otherwise it returns a non zero error code Example thelD Call Object gTable mGetField Studenti D if Vl2Status lt gt 0 then GoTo Q NotifyUser V12Status returns a non zero result you can callV12Error to get the details of the error When called with no parameter 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 VI2 DBE V12Error provides a detailed contextual report on it Example aPrice CallObject gTable mGetField price if Vl2Status lt gt 0 then GoTo Q NotifyUser end if NotifyUser would then call VI2Error and di

Download Pdf Manuals

image

Related Search

Related Contents

GJD OPAL XL 35 METRE EXTERNAL PIR INSTALLATION MANUAL  y step - Oster  ディスプレイ分配器 VSP-A2/VSP-A4/VSP-A8 ユーザーズ  Eaton ePDU Managed 0U, 10A, 20x C13  Bostitch BTE140K User's Manual  PomPes à Chaleur air/eau  Manual de Usuario  Delta Electronics SMT Power Inductor S 523 User's Manual  M-850V  Samsung ME55B Benutzerhandbuch  

Copyright © All rights reserved.
Failed to retrieve file