Re: msg_select_areaã By: art to All on Tue Nov 10 2009 06:50 pmãã > Hi all,ã >ã > In DEFAULT.SRC, there's the following:ã >ã > cmdkey Jã > msg_select_areaã >ã > How would I call msg_select_area in a .JS? I see previous threads onã > calling Baja modules, but this is still unclear to me, if someone couldã > point me in the right direction please?ããThere is no equivalent function in JavaScript, but here is a snippet fromãexec/classic_shell.js that does the same thing:ãã case 'J':ã if(!msg_area.grp_list.length)ã continue main;ã while(1) {ã var orig_grp=bbs.curgrp;ã var i=0;ã var j=0;ã if(msg_area.grp_list.length>1) {ããif(file_exists(system.text_dir+"menu/grps.*"))ã bbs.menu("grps");ã else {ããconsole.putmsg(bbs.text(CfgGrpLstHdr),P_SAVEATR);ã for(i=0;ãi<msg_area.grp_list.length; i++) {ã if(i==bbs.curgrp)ããconsole.print('*');ã elseã console.print('ã');ã if(i<9)ã console.print('ã');ã if(i<99)ã console.print('ã');ããconsole.putmsg(format(bbs.text(CfgGrpLstFmt),i+1,msg_area.grp_list[i].descriptiãon),P_SAVEATR);ã }ã }ããconsole.mnemonics(format(bbs.text(JoinWhichGrp),bbs.curgrp+1));ããj=get_next_num(msg_area.grp_list.length,false);ã if(j<0)ã continue main;ã if(!j)ã j=bbs.curgrp;ã elseã j--;ã }ã bbs.curgrp=j;ããif(file_exists(system.text_dir+"menu/subs"+(bbs.curgrp+1)))ã bbs.menu("subs"+(bbs.curgrp+1));ã else {ã console.clear();ããconsole.putmsg(format(bbs.text(SubLstHdr),ãmsg_area.grp_list[j].description),P_SAVEATR);ã for(i=0;ãi<msg_area.grp_list[j].sub_list.length; i++) {ã var msgbase=newãMsgBase(msg_area.grp_list[j].sub_list[i].code);ã if(msgbase==undefined)ã continue;ã if(!msgbase.open())ã continue;ã if(i==bbs.cursub)ã console.print('*');ã elseã console.print(' ');ã if(i<9)ã console.print(' ');ã if(i<99)ã console.print(' ');ããconsole.putmsg(format(bbs.text(SubLstFmt),i+1,ãmsg_area.grp_list[j].sub_list[i].description,"",msgbase.total_msgs),P_SAVEATR);ã msgbase.close();ã }ã }ããconsole.mnemonics(format(bbs.text(JoinWhichSub),bbs.cursub+1));ããi=get_next_num(msg_area.grp_list[j].sub_list.length,false);ã if(i==-1) {ã if(msg_area.grp_list.length==1) {ã bbs.curgrp=orig_grp;ã continue main;ã }ã continue;ã }ã if(!i)ã i=bbs.cursub;ã elseã i--;ã bbs.cursub=i;ã continue main;ã }ããThat didn't paste too well (we need a way to specify 4-space tabs in fseditor),ãbut you can find that code in:ãã
http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/exec/classic_shell.jsãã digital manããSnapple "Real Fact" #100:ãIn a year, the average person walks 4 miles makeing their bed.ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã