Hi,
I can�t make it (to eliminate Windows to apply .TXT after projectname.ecd).
I use the lingo below. Please help meeeeee!!!!!!!!!
TIA
Tony
on mSave me
if objectP(gFile) then
gFile = 0
end if
gFile = new(xtra "fileio")
pFileName = ""
proName = member("projectname").text
if gLang = "eng" then
infotext = "Save your..."
defaultFile = proName & ".ecd"
else if gLang = "fra" then
infotext = "Sauvegarder votre..."
defaultFile = proName & ".ecd"
end if
pFileName = displaySave(gFile,infoText,defaultFile)
openFile(gFile,pFileName,1)
if status(gFile) = 0 then
delete(gFile)
closeFile(gFile)
gFile = 0
gFile = new(xtra "fileio")
end if
createFile(gFile, pFileName)
if status(gFile) = 0 then
openFile(gFile,pFileName,0)
--######################
-- START tempSaveList --
--######################
tempSaveList = [:]
tempSaveList.addProp(#showList, pShowList)
tempSaveList.addProp(#XXX,member("XXX").hilite)
writeString(gFile,string(tempSaveList))
--######################
-- END tempSaveList --
--######################
if status(gFile) = 0 then
closeFile(gFile)
gFile = 0
else
alert error(gFile, status(gFile))
end if
else if status(gFile) = -36 or status(gFile) = -122 then
-- Cancel --
else
alert "No file could be saved" && status(gFile)
end if
end
-- __________________________
Howdy-Tzi wrote:
> At 13:11 +0100 02/01/2002, Tony �str�m wrote:
>
> >I save a textfile with my suffix .ecd in Dir.8.0 (fileio).
> >On Mac it works fine = filename.ecd but
> >on Win it also apply .txt = filename.ecd.txt
> >WHY?????
>
> For some reason Director assumes that a path passed along in FileIO
> on Windows, if an extension is not explicitly supplied, should have a
> .txt appended. It's frustrating.
>
> To be fair I believe this is an artifact of FIleIO itself, which was
> released in its current incarnation with Director version 5. AFAIK it
> has not been significantly altered since then.
>
> Here's the fix. Assume the filename you want to use is stored in the
> variabe sMyPath. Add these lines of code just before you actually
> create and save the file. (Naturally you will want to substitute
> sMyPath for whatever variable you are using.)
>
> sDelimSave = the itemDelimiter
> the itemDelimiter = "."
> if the last item of sMyPath = "TXT" then
> delete the last item of sMyPath
> end if
> the itemDelimiter = sDelimSave
>
> You can let this run on Mac too. It won't have any effect there.
>
> --
>
> Warren Ockrassa | http://www.nightwares.com/
> Director help | Free files | Sample chapters | Freelance | Consulting
> Author | Director 8.5 Shockwave Studio: A Beginner's Guide
> Published by Osborne/McGraw-Hill
> http://www.osborne.com/indexes/beginners_guides.shtml
> [To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/lingo-l.cgi To post messages to the list, email
>[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
>learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]