Presenting successive file names in 'Open'
Frank D. Engel, Jr.
fde101 at fjrhome.net
Wed Dec 1 12:03:11 EST 2004
If the filenames are always sequential and in that format, you could do
something like this in a button (say, "Next File"):
on mouseUp
put <the previous filename> into x
put char 1 of x into aLetter
put char 2 to 3 of x into aNumber
add 1 to aNumber
if aNumber is 100 then
-- next letter
put 0 into aNumber
end if
put aLetter & format("%02d", aNumber) into theNewFileName
-- open the file
end mouseUp
Alternately, let the user pick the folder rather than the file, then do
something like this:
-- get the list of files and put them in hidden field "fileList"
sort lines of field "fileList"
-- open the file listed on the first line of field "fileList"
delete line 1 of field "fileList"
then for your "Next File" button:
on mouseUp
-- open the file listed on the first line of field "fileList"
delete line 1 of field "fileList"
if field "fileList" is empty then disable me
end mouseUp
On Dec 1, 2004, at 11:53 AM, Graham Samuel wrote:
> Folks
>
> I'm not sure how to approach this problem:
>
> I want a user to see the contents of a series of text files, all in
> the same folder. Let's say the files are called A01,A02... G99 or
> something like that. The sequence of operations is -
>
> 1. The user is offered a normal 'open' dialog to select a file,
> initially navigating to the folder in question and picking A01 to
> read.
>
> 2. The user looks at the file, does some action and disposes of it.
>
> 3. The user usually then wishes to look at the next file in the
> alphabetical sequence (A02 in my example, but it might be any text
> string). Clearly she/he can navigate to this name by:
>
> a) remembering the name of the last file looked at;
>
> b) scrolling down to the file below the last file looked at in the
> normal 'open' dialog
>
> If there are a lot of files, this scrolling becomes tedious on most
> OSs (e.g in OSX the OS 'open' dialog doesn't hilite the last file
> read, nor does it scroll down to it), so I would prefer to propose the
> name of the next file in the sequence in the 'open' dialog for the
> user to accept or reject.
>
> What would be the best way to do this? So far I've only thought of
> traversing the folder somehow before the user starts work, and putting
> all the file names in a list field for the user to pick from. Seems
> kind of overkill, though.
>
> All thoughts gratefully received.
>
> TIA
>
> Graham
> -----------------------------------------------------------------------
> ----
> Graham Samuel / The Living Fossil Co. / UK and France
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
-----------------------------------------------------------
Frank D. Engel, Jr. <fde101 at fjrhome.net>
$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com
More information about the use-livecode
mailing list