资源简介 FileIO XtraVersion 1.0.4 - 09dec97 CHFileIO Xtra for Macromedia Director 6.0=======================================FileIO provides a set of methods allowing users of Macromedia Director 6.0 toprogrammatically access files using the Lingo scripting language. The FileIOXtra is a scripting Xtra. The scripting Xtra interface is portable acrossall Macromedia products. Hence the FileIO Xtra may be used with Authorware 4.Using FileIO============If automatic opening is desired, place a copy of the FileIO Xtra for your platforminto Application Xtra's folder. If automatic opening is not desired, the Xtra can beplaced anywhere and opened using Lingo's 'openXLib' command. This applies toprojector's as well, the Xtra must be placed in an Xtra's folder in the same folderas the projector.Each instance of FileIO can reference a single open file. If multiple files are tobe opened simultaneously, a new instance of FileIO is required for each opened file.A single instance can be used to open multiple files, as long as the file is closedbefore a new file is opened. To create a new instance, use the new() method, definedbelow. To dispose of an instance, set the instance variable to 0. All methods thatread from or write to the file must be called after the file has been opened usingthe openFile() method. If a new file is to be opened using the same instance, thefile must be closed using closeFile(). Files can be opened in three different modes:Read, Write and Read/Write. When writing to a file, the contents of the file afterthe current position are overwritten.Example Lingoset myFile = new(xtra "fileio") -- Create an instance of FileIOset fileName = displayOpen(myFile) -- Display Open Dialog and return the fileNameopenFile(myFile, fileName, 1) -- Open the fileset theFile = readFile(myFile) -- Read the file and return a string to LingocloseFile(myFile) -- Close the fileset myFile = 0 -- Dispose of the instanceIn this example, we created a new instance and stored it in the variable myFile.Next, the displayOpen() method is used to display an open dialog to allow a file tobe chosen. The file is returned as a fully-qualified path string to Lingo. The fileis then opened in read only mode, the contents of the file are read, and the file isclosed. Lastly, the instance is disposed of.Known Problems==============The createFile() method does not support relative filenames, or the Lingo '@'operator in pathnames. This will be fixed in a later version.The displaySave() method does not directly inform Lingo whether a user isreplacing an existing file. The workaround is to attempt to create the file usingcreateFile() and check the error code for a "File Already Exists" error.History=======09dec97 (v1.0.4)Fixed a problem leading to garbage characters appearing at the ends of lines,or possibly crash.18apr97 (v1.0.2)Fixed parenting problem with displaySave() and displayOpen() methods.Added support for Authorware.27may96 (v1.0.1)Added support for double-byte character sets.Added version() method to report FileIO Xtra version information.Added getOSDir() to return a full path to the Windows Directory/System Folder.15mar96 (v1.0.0 Beta)First public release.Method Reference================The first line of each definition contains the method name, a list of parameters andthier value types. The internal name of the FileIO Xtra is "fileio". This name isused whenever referencing the xtra using the form 'xtra "fileio"'.Note that while Director and projector's can use net-based files by supplying a URLfor a filename, the FileIO Xtra cannot. It is limited to accessesing files availablevia filesystems mounted on the local system.New methods will appear at the bottom of this list.---mMessageList( xtra reference )Returns a list of methods and parameters, as well as a brief explanation of each.---new( xtra reference )This is called to create a new instance of FileIO. The Xtra can be referenced by nameor number. It returns an instance variable used to reference the instance.---fileName( instance )Returns the fileName string of the current open file. The file must be open use thismethod.---status( instance )Returns the error code returned by the last method called. The value is returned asan integer.---error( instance, int error )Returns a readable error string. A numeric error code is passed in as thesecond argument. The errors returned can be any of the following:"OK""Memory allocation failure""File directory full""Volume full""Volume not found""I/O Error""Bad file name""File not open""Too many files open""File not found""No such drive""No disk in drive""Directory not found""Instance has an open file""File already exists""File is opened read-only""File is opened write-only""Unknown error"---setFilterMask( instance, string mask )Sets the filter mask used by calls to displayOpen() and displaySave(). The filtermask determines what files to show when displaying an Open or Save dialog. The secondparameter is a string representing the filter mask to set. On Windows, this is acomma seperated string of file types and associated extensions (e.g. "AllFiles,*.*,Text Files,*.TXT"), and a string of types on the Macintosh (e.g."TEXTPICT"). On Windows, the filter mask string is limited to 256 characters. On theMacintosh, you are limited to four four-character types. When a new instance ofFileIO is created, the filter masks defaults to all files. To reset the filter mask todisplay all files after it has been set, just pass in an empty string (e.g.setFilterMask(me, "")).---openFile( instance, string fileName, int openMode )Opens the named file. This call must be used before any read/write operations cantake place. The filename can be either a fully-qualified path and filename, or arelative filename. The Lingo '@' pathname operator is supported. The openModeparameter specifies whether to open the file in Read, Write or ReadWrite mode. ValidFlags are: 0 Read/Write, 1 Read, 2 Write.---closeFile( instance )Closes a file that has been previously opened using the openFile() method.---displayOpen( instance )Displays a platform specific Open dialog allowing a user to specify a file. Returns afully-qualified path and fileName to Lingo. The setFilterMask() method can be used tocontrol what file types are displayed in the dialog.---displaySave( instance, string title, string defaultFileName )Displays a platform specific Save dialog allowing a user to specify a file. Returns afully-qualified path and fileName to Lingo. The setFilterMask() method can be used tocontrol what file types are displayed in the dialog. The string and defaultFileNameparameters allow you to specifiy a default filename to be displayed, as well as titletext for the save dialog.---createFile( instance, string fileName )Creates a file. The fileName must be either a fileName to be created in the currentdirectory, or a fully-qualified path and fileName. The Lingo '@' pathname operatorand relative paths are not supported. After creating the new file, the file must beopened before it can be written to.---setPosition( instance, position )Sets the file position of the current open file. The file must be open to use thismethod.---getPosition( instance )Gets the file position of the current open file. Returned as an integer. The filemust be open to use this method.---getLength( instance )Gets the length of the currently opened file. Returned as an integer. The file mustbe open use this method. The value returned is the length of the file in bytes.---writeChar( instance, string theChar )Writes a single character to the file at the current position. The file must be openin write or read/write mode to use this method.---writeString( instance, string theString )Writes a string to the file at the current position. The file must be open in writeor read/write mode to use this method.---readChar( instance )Reads the character (either single or double-byte) at the current position and thenincrements the position. The character is returned to Lingo as a string. The file mustbe open in read or read/write mode to use this method.---readLine( instance )Reads from the current position up to and including the next CR, increments theposition, and returns the string to Lingo. The file must be open in read orread/write mode to use this method.---readFile( instance )Reads from the current position to the end of the file and returns the file to Lingoas a string. The file must be open in read or read/write mode to use this method.---readWord( instance )Reads the next word starting at the current position. The file must be open in reador read/write mode to use this method.---readToken( instance, string skipChar, string breakChar )Reads the next 'token' starting at the current position. Characters matching theskipChar parameter are "skipped" and the file is read until breakChar is encountered.The file must be open in read or read/write mode to use this method. This method willread double-byte tokens as long as the skip and break are single-byte characters. Itwill not detect double-byte skip or break characters.---getFinderInfo( instance )Returns the Type and Creator of the current file as a string. This method doesnothing when used under Windows. The file must be open to use this method.---setFinderInfo( instance, string typeAndCreator )Sets the Type and Creator of the current file. The string takes the form of a spaceseperated set of TYPE and CREATOR codes (e.g. "TEXT TTXT"). This method does nothingwhen used under Windows. The file must be open to use this method.---delete( instance )Deletes the currently opened file. The file must be open use this method.---version( xtraRef )Returns FileIO version and build information. Useful when filingbug reports, determining installed version while authoring, etc. No practical use beyond this.---getOSDir( )Global method that returns the full path to either the Windows directory, or the System Folderdepending on which OS is currently being used. Does not require a child instance orXtra reference to call.---(共24张PPT)第一课国土与人民辽阔的疆域世界各大国面积比较俄罗斯1700多万km2加拿大997万km2中国960万km2美国937万km2巴西855万km2澳大利亚768万km2中国疆域四最点最北端在漠河县以北黑龙江主航道中心线上。最东端在黑龙江与乌苏里江主航道中心线相交处。最南端在南海的南沙群岛的曾母暗沙。最西端在帕米尔高原上。中国最北端(53°N)黑龙江的漠河气象站测出零下60℃的低温,漠河又被定为中国第一冷。神州北极中国最西端在帕米尔高原(73°E)。中国最南端在南海南沙群岛曾母暗沙(4°N附近)。祖国的南疆南沙群岛中国最东端在黑龙江和乌苏里江主航道交界处(135°E)。中华人民共和国请说出我国最东端和最西端的经度。最东端:135°E最西端:73°E当夏季北京时间6点时,东部乌苏里江上和西部帕米尔高原上各是什么景象,为什么?中华人民共和国在地图册中的“中国的疆域图”上,量算我国领土最东端到最西端的距离约为_______千米。15.2CM实际距离=图上距离比例尺中国的邻国俄罗斯蒙古印度缅甸朝鲜哈萨克斯坦吉尔吉斯斯坦塔吉克斯坦阿富汗巴基斯坦尼泊尔锡金越南老挝韩国日本菲律宾马来西亚文莱印度尼西亚不丹ABCDA 渤海B 黄海C 东海D 南海太平洋abcda 台湾岛b 海南岛c 崇明岛d 舟山群岛中国位于亚洲东部太平洋西岸美国英国蒙古思考:从海陆疆域方面看,中国同英国、蒙古有什么不同?同美国有什么相同和不同的地方?如何评价中国的地理位置 地理位置纬度位置海陆位置南北纬度相差约50°海陆兼备大部分在温带,小部分在热带南北气候差异大利于发展多种农业经济东部多降水利于农业生产利于开发海洋资源利于发展海上交通季风气候显著旱涝频繁不利农业生产第一节 中国的疆域一、中国在世界的位置亚洲东部,太平洋西岸二、我国的疆域1、陆地面积约960万平方千米2、我国领土的四至点三、我国濒临的海洋1、海域辽阔,自北向南:渤海、黄海、东海和南海2、岛屿众多3、渤海和琼州海峡是我国的内海四、陆界和邻国1、我国陆上国界线长达2万多千米,陆上有15个邻国2、有6个国家与我国隔海相望拓展篇——内海政治地理上的内海概念,是指国家内水的一部分。它包括各海港,领海基线以内的海域,以及为陆地所包围但入口较狭的海湾和通向海洋的通道(海峡)等。内海处于沿海国主权之下,沿海国有权关闭内海,不让外国船只进入,或规定进入内海必须遵守的规则。渤海和琼州海峡,都 是我国的内海。自然地理上的内海概念,是指伸入大陆内的海,面积不大,仅有狭窄的水道与大洋相通,而且海水较浅。它的水文特征受周围大陆的影响。渤海就是一例。中国的行政区划请写出你的籍贯所在地________省(自治区、直辖市)________县(自治县、市、区)________乡(镇)1、划分原则便于行政管理利于经济发展利于民族团结思考:从书第41页表中可看出,我国的行政 区域分为哪三级?2、三级行政区①省(自治区、直辖市)②县(自治县、市)③乡(镇)3、特别行政区的设立(1)三级行政区23个省5个自治区4个直辖市2个特别行政区(共34个)(2)省、自治区、直辖市两湖两广两河山,五江(疆)二宁青陕甘,云贵西四北上天,内蒙台海福吉安,还有重庆和港澳,三十四个不可少。省级行政单位“七字歌”: 展开更多...... 收起↑ 资源列表 拼图.swf 演示文稿1.ppt