Current menu script

Kenneth Brody kenbrody at bestweb.net
Sat Feb 4 09:47:41 PST 2006


Quoting Jeff Harrison (Fri, 3 Feb 2006 22:58:31 -0800 (PST)):

> --- 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.
[...]
> 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.
[...]

Or, use SEEK() to position to the actual spot in the file that you
want to read, and then READ.  (This also means that no MID would be
required later on.)

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list