RE - defaultFolder usage

Filippo Galimberti fgalimbe at
Mon Jul 15 13:43:01 EDT 2002

 >>answer folder "Select the default folder..."
 >>-- I choose, e.g., "C:/Documents and Settings/Filippo/Documenti"
 >>if it is not empty then
 >> set the defaultFolder to it
 >> put the defaultFolder
 >> -- I check that the defaultFolder is set to the folder I chose; in fact 
I get "C:/Documents and Settings/Filippo/Documenti" in the message box 
result line
 >> answer file "Select the file..."
 >>end if
 >Hello Filippo,
 >Both ask & answer file include an optional argument, [with <default.]
 >for the default path instead of useing the defaultFolder.
 >Try answer file "Select the file..." with "C:/Documents and 
 >Rob Cozens

Hello Rob,
thank you for your suggestion.

I'm aware of the optional "with defaultPath" and "with defaulFilePath" 
parameter of answer and ask file commands. The problem is that I need to 
set the defaultFolder directly. I got a few hundreds of scripts ported from 
Hypercard, where I used a XCMD (stdFile folderPath) to set the folder 
before ask and answer file commands. I'm trying to replace the XCMD with a 
Revolution command, instead of changing all the scripts:

on stdFile cartella
   set the defaultFolder to cartella
end stdFile
-- cartella is a folder name, correctly formatted for the platform

The problem is that I get the same results of the example above, which was 
just to show the problem.
For example:
stdFile "C:/Documents and Settings/Filippo/Documenti"
the defaultFolder is setted to "C:/Documents and Settings/Filippo/Documenti"
ask file "Select file"
-- open the box in the last used folder, or, sometimes, in "C:/Documents 
and Settings/Filippo", but the never in "C:/Documents and 

This behavior happens for all folders I've tried, with both Windows 2000 
and Windows XP Pro.

Kind regards
Filippo Galimberti

More information about the Use-livecode mailing list