"Save" on Linux, not on Mac, Win

Sarah Reichelt sarah.reichelt at gmail.com
Mon Dec 5 19:29:31 EST 2005


On 12/6/05, Jerry Muelver <jerry at hytext.com> wrote:
> My first Rev app, being developed on Linux with Rev 2.2.1, saves and reads a
> data file. On Windows XP, with Dreamcard Player running the stack, the
> program goes through the motions of saving when called to, but nothing gets
> saved.

Check "the result" after saving. This might tell you why the save has failed.

> On Mac, with Player, the file gets saved, but can't be opened by the
> program -- "answer file" dialog shows the file grayed out, and not
> selectable. I use "ask file" to SaveAs originally, direct "open file" for
> in-progress saves, and "answer file" to open or re-open the file.

It sounds like the filter on your answer file is not matching your
data file type correctly. Try using answer file without any filters
and see if that works.

> I'll try using "*.txt" instead of my own extension, just in case. But in the
> meantime, are there file access issues I have to tweak for each platform?
> Are there filename extension or type conditions that come into play?

The filter options for the answer file dialog were improved in Rev
2.6. The docs for this were in the Engine Change Log file that came
with the 2.6 installation, but I haven't found them anywhere else, so
I'll include the relevant section below.

Cheers,
Sarah



answer/ask file with type
~~~~~~~~~~~~~~~~~~~~~~~~~
  There is now a new form of answer and ask file allowing
cross-platform specification of file filters:

  answer file[s] <prompt> [ with <defaultFile> ] with type <filter> \
    [ or type <filter> or ... ] [ titled <title> ] [ as <sheet> ]

  ask file[s] <prompt> [ with <defaultFile> ] with type <filter> \
    [ or type <filter> or ... ] [ titled <title> ] [ as <sheet> ]

The <filter> parameters are return-delimited lists of the form:
  <tag>|<extensions>|<filetypes>
Where:
  <tag> is a textual description of the filter
  <extensions> is a comma-delimited list of extensions
  <filetypes> is a comma-delimited list of MacOS filetypes

If more than one filter (in total) is specified, then the dialog box
displayed will contain a drop-down list consisting of the filter name
(this is always visible on Windows). When the user selects from this
list, the corresponding filter will be applied to the file dialog.

Upon selecting a file, the filename(s) will be placed in the it
variable and the result variable will contain the <tag> of the last
selected element from the drop-down list.

Upon cancelling the action, both the it and the result variable will be empty.

With the introduction of this new form, commands of the form:
  answer file ... of type ...
  answer file ... with filter ...
  ask file ... with filter ...
Have been deprecated and should not be used in new applications.



More information about the use-livecode mailing list