Subj : bbs.menu vs bbs.menu_exists
To   : nolageek
From : Digital Man
Date : Tue Jan 14 2020 09:55 am

 Re: bbs.menu vs bbs.menu_exists
 By: nolageek to Digital Man on Tue Jan 14 2020 09:44 am

>   Re: bbs.menu vs bbs.menu_exists
>   By: Digital Man to nolageek on Mon Jan 13 2020 02:26 pm
>
>  DM> bbs.menu_exists() with a sub-directory specified should work fine. See
>  DM> xtrn_sec.js as an example which check for the existence (and displays)
>  DM> text/menu/xtrn/*.*.
>
> I can't figure out why this code doesn't work then:
>
> function mystMenu(file) {
> // check for 'file' in current command shell menu dir and if not found use
> // 'mystique' menu directory
>
> if (bbs.menu_exists(user.command_shell + '/' + file)) {
>     bbs.menu(user.command_shell + '/' + file);
>     } else {
>     bbs.menu('mystique/' + file);
>     }
> }
>
> If I then use mystMenu('mainmenu'); in my shell, it always shows the menu
> from the mystique directoy - even though they exist in both.

Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.



                                           digital man

Synchronet/BBS Terminology Definition #18:
DM = Digital Man (Rob Swindell) or Dungeon Master
Norco, CA WX: 54.4�F, 82.0% humidity, 0 mph W wind, 0.01 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net