Current menu script
Jeff Harrison
jeffaharrison at yahoo.com
Fri Feb 3 22:58:31 PST 2006
--- Kenneth Brody <kenbrody at bestweb.net> wrote:
> Quoting Jeff Harrison (Fri, 3 Feb 2006 14:24:44
> -0800 (PST)):
> [...]
> > getmenu:::
> > :not @pw co ".":return:
> > ::mn=mid(@pw,"1",instr(@pw,".","2")-"1"):
> > ::aa=open(mn{"","rt"):
> > :aa lt "0":exit:
> > ::ab=readline(aa,ac):
> > ::return:
> [...]
>
> Just an FYI... The above won't read the heading if
> the menu contains
> exactly 10 items. (Nor will it work properly, I
> believe, under Windows
> if the menu contains exactly 13 items.)
>
That is an interesting bit of filepro menu trivia! If
there are 10 items then the first character of the
menu is chr("10") or hex 0A, and the filepro readline
command will of course stop reading when it sees that.
In my testing I found out that you are correct for
Unix - it is 10 items. It is also 10 items under
Windows - 13 items did work, however, for both
systems.
My fix was to simply add the following line after my
read command:
:ab eq "0":ab=readline(aa,ac); ac=" " & ac:
So if zero characters are read after the first read it
will read again.
Good Catch!
Jeff Harrison
jeffaharrison at yahoo.com
Author of JHExport and JHImport. The easiest and
fastest ways to generate code for filePro exports and imports.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Filepro-list
mailing list