Limit on the text file? I seem to remember that XP had a 64k limit on txt
files, but that was years ago, and I would have tought it had been
inclreased by now. Definitely Vista and Windows 7 don't have that same
As for Authorware variables, theres the old 32k limit stuill hanging
around. You can store up to 512 k of data in an Authorware 7 variable, but
ReadExtFile only supports 32k.
There's various ways that you can read in the text in chunks, but I think,
ultimately, it is easier to use a database if you want to store and
retrieve a lot of text.
Thanks Steve, especially for the fast reply!
Is there any limit when using AppendExtFile?
I just put data from one record in a blank text file and it was 13KB, then I copied the same text 10 times and it went to 129KB, quickly exceeding the ReadExtFile 32K limit you mention. So ReadExtFile won't be a solution...thanks for saving time with that!
I wish there were a way to copy and move a file. I'll check with a coworker that may have a way to build a small program outside of Authorware that will copy a file and see if that may be a solution for the backup portion of this project.
My apologies, it's been a few years ...
CopyFile is a function that you can load from the WinAPI.u32
Once loaded, you use it like this
just remember you need to include WinAPI.u32 with your packaged file(s).
Hi Steve -
Great! I was able to load the function and copy a file locally.
Do you know if there is a limit to the size of the file that can be copied?
I also checked with a coworker who said that I could use a .bat file to copy a file. If we ever went that route (which I don't think we need to do now since if CopyFile works with a large data file), is there a way to have an Authorware button that could open/run a .bat file?
I don't believe there is a practical limit. If you have the fun(!) od
supporting XP, you might encounter a 2Gb limit, but if your file is ever
that big, you have other issues ...
should run the Bat file. many system security settings will prevent you
running a Bat file.
Hi Steve -
Once again, THANKS a bunch for your detailed help!
I was able to run the .bat file from an Authorware button, and I was also able to use the CopyFile function.
For anyone that may be interested, I also set up the backup copy to have the computer date and time appended to the file name. Code below:
Backup_MM := Month
if Month <10 then
Backup_MM := String("0"^Month)
if Day <10 then
Backup_DD := String("0"^Day)
if Hour <10 then
Backup_Hour := String("0"^Hour)
if Minute <10 then
Backup_Minute := String("0"^Minute)
Backup_Sec := Sec
if Sec <10 then
Backup_Sec := String("0"^Sec)
Backup_Time := Backup_Hour^Backup_Minute^Backup_Sec
Backup_Date := Backup_YYYY^Backup_MM^Backup_DD
-- This uses Computer Date
Temp_BackupPath := "p:\\test\\DATA_BACKUP_"^Backup_Date^"_"^Backup_Time^".txt"
Success:= CopyFile(FileLocation^"\\data\\DATA.txt", Temp_BackupPath)
Hi Steve -
I've been using the CopyFile function successfully to copy a specific file to a backup location. Thanks again for your help with that.
Is there an easy way that I can copy an entire folder to a backup location? I won't know how many separate text records will be in the folder at any particular time since it will vary.
I don't have Authorware handy - is there a CopyFolder function? I don;t
I'm pretty sure BudAPI has a CopyFolder function
If, like me, you prefer native only functions, you can use Catalog to get a
list of files in a folder, then iterate through the list of returned files
and copy them in turn. Since you are only taking about text files, this
should be pretty quick.