FileIO Xtra
Version 1.0.4 - 09dec97 CH
FileIO Xtra for Macromedia Director 6.0
=======================================
FileIO provides a set of methods allowing users of Macromedia Director 6.0 to
programmatically access files using the Lingo scripting language. The FileIO
Xtra is a scripting Xtra. The scripting Xtra interface is portable across
all 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 platform
into Application Xtra's folder. If automatic opening is not desired, the Xtra can be
placed anywhere and opened using Lingo's 'openXLib' command. This applies to
projector's as well, the Xtra must be placed in an Xtra's folder in the same folder
as the projector.
Each instance of FileIO can reference a single open file. If multiple files are to
be 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 closed
before a new file is opened. To create a new instance, use the new() method, defined
below. To dispose of an instance, set the instance variable to 0. All methods that
read from or write to the file must be called after the file has been opened using
the openFile() method. If a new file is to be opened using the same instance, the
file 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 after
the current position are overwritten.
Example Lingo
set myFile = new(xtra "fileio") -- Create an instance of FileIO
set fileName = displayOpen(myFile) -- Display Open Dialog and return the fileName
openFile(myFile, fileName, 1) -- Open the file
set theFile = readFile(myFile) -- Read the file and return a string to Lingo
closeFile(myFile) -- Close the file
set myFile = 0 -- Dispose of the instance
In 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 to
be chosen. The file is returned as a fully-qualified path string to Lingo. The file
is then opened in read only mode, the contents of the file are read, and the file is
closed. 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 is
replacing an existing file. The workaround is to attempt to create the file using
createFile() 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 and
thier value types. The internal name of the FileIO Xtra is "fileio". This name is
used whenever referencing the xtra using the form 'xtra "fileio"'.
Note that while Director and projector's can use net-based files by supplying a URL
for a filename, the FileIO Xtra cannot. It is limited to accessesing files available
via 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 name
or 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 this
method.
---
status( instance )
Returns the error code returned by the last method called. The value is returned as
an integer.
---
error( instance, int error )
Returns a readable error string. A numeric error code is passed in as the
second 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 filter
mask determines what files to show when displaying an Open or Save dialog. The second
parameter is a string representing the filter mask to set. On Windows, this is a
comma seperated string of file types and associated extensions (e.g. "All
Files,*.*,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 the
Macintosh, you are limited to four four-character types. When a new instance of
FileIO is created, the filter masks defaults to all files. To reset the filter mask to
display 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 can
take place. The filename can be either a fully-qualified path and filename, or a
relative filename. The Lingo '@' pathname operator is supported. The openMode
parameter specifies whether to open the file in Read, Write or ReadWrite mode. Valid
Flags 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 a
fully-qualified path and fileName to Lingo. The setFilterMask() method can be used to
control 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 a
fully-qualified path and fileName to Lingo. The setFilterMask() method can be used to
control what file types are displayed in the dialog. The string and defaultFileName
parameters allow you to specifiy a default filename to be displayed, as well as title
text for the save dialog.
---
createFile( instance, string fileName )
Creates a file. The fileName must be either a fileName to be created in the current
directory, or a fully-qualified path and fileName. The Lingo '@' pathname operator
and relative paths are not supported. After creating the new file, the file must be
opened 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 this
method.
---
getPosition( instance )
Gets the file position of the current open file. Returned as an integer. The file
must be open to use this method.
---
getLength( instance )
Gets the length of the currently opened file. Returned as an integer. The file must
be open use this method. The value returned is the length of the file in bytes.
没有合适的资源?快使用搜索试试~ 我知道了~
机械原理课件培训.rar
共613个文件
swf:189个
avi:126个
html:98个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 140 浏览量
2022-04-26
10:53:22
上传
评论
收藏 476.5MB RAR 举报
温馨提示
机械原理课件
资源推荐
资源详情
资源评论
收起资源包目录
机械原理课件培训.rar (613个子文件)
复合轮系2.avi 15.2MB
图11-1.avi 12.88MB
复合轮系1.avi 11.42MB
图12-5.avi 9.72MB
牛头刨床.avi 9.72MB
图11-22b.avi 9.28MB
自动机床.avi 9.05MB
外齿轮固定行星轮系.avi 9.04MB
差速器.avi 7.37MB
12-5.avi 7.29MB
差动轮系.avi 7.01MB
转塔刀架.avi 6.22MB
准双曲面传动.avi 5.84MB
3k型周转轮系.avi 5.31MB
圆锥齿轮差动轮系.avi 5.24MB
12-28.avi 5.06MB
图11-15.avi 5.01MB
11-16.avi 4.9MB
13-4.avi 4.77MB
图10-6.avi 4.72MB
换向机构.avi 4.7MB
图10-4a.avi 4.63MB
调速器.avi 4.55MB
图11-22e.avi 4.35MB
平面定轴轮系.avi 4.23MB
12-4a.avi 4.14MB
12-4b.avi 4.14MB
实现分路传动.avi 3.79MB
12-8b.avi 3.78MB
曲线齿圆锥齿轮.avi 3.77MB
空间定轴轮系.avi 3.68MB
图11-22f.avi 3.56MB
10-4b.avi 3.55MB
蜂窝煤.avi 3.54MB
图11-22c.avi 3.54MB
图11-22d.avi 3.32MB
12-3.avi 3.2MB
图11-22a.avi 3.18MB
图10-1b.avi 3.17MB
内齿轮固定行星轮系.avi 3.17MB
实现大传动比.avi 3.16MB
单齿不完全齿轮.avi 3.09MB
12-17a.avi 3.05MB
不完全外啮齿轮机构.avi 2.88MB
12-8a.avi 2.84MB
12-18a.avi 2.83MB
图10-4c.avi 2.82MB
图11-22g.avi 2.79MB
12-1.avi 2.68MB
图10-3b.avi 2.51MB
图10-3a.avi 2.38MB
shexiangji .avi 2.25MB
内燃机.avi 2.25MB
图10-5.avi 2.23MB
图10-1a.avi 2.19MB
kaimen .avi 2.17MB
点高副.avi 2.06MB
sizu.avi 2.06MB
12-11.avi 1.98MB
12-16.avi 1.93MB
12-12.avi 1.92MB
12-9.avi 1.92MB
自动装卸机构.avi 1.91MB
不完全锥齿轮.avi 1.89MB
棘条.avi 1.88MB
yuanzhupi.avi 1.88MB
12-15.avi 1.81MB
图10-2.avi 1.79MB
qiche.avi 1.78MB
feijiqiluojia .avi 1.64MB
fengshan.avi 1.59MB
13-5.avi 1.52MB
qichezhuanxiang .avi 1.51MB
螺旋副.avi 1.4MB
槽条.avi 1.4MB
wujiaoxing .avi 1.38MB
sanjiaoxing.avi 1.3MB
jiaobanji .avi 1.29MB
QIZHONGJI.avi 1.29MB
12-17b.avi 1.23MB
12-18b.avi 1.19MB
13-1.avi 1.19MB
feijian.avi 1.16MB
小型抓片机抓片机构.avi 1.15MB
共轭凸轮.avi 1.15MB
LEIDA.avi 1.14MB
不完全齿轮齿条机构.avi 1.13MB
BAOCHUANG !.avi 1.13MB
球副.avi 1.09MB
kaimen2.avi 1.09MB
6-5.avi 1.09MB
进刀机构.avi 1.08MB
bozhongji.avi 1.07MB
13-3.avi 1.07MB
配气机构.avi 1.06MB
GUANXINGSHAI .avi 1.05MB
四杆机构.avi 904KB
叽桶.avi 903KB
线高副.avi 890KB
摆动平地推杆凸轮.avi 880KB
共 613 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
制冷技术咨询与服务
- 粉丝: 1830
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功