• BAJA "FILE_VIEW" Equivalent in Javascript

    From High Spirit@VERT/DCBBS to All on Monday, December 10, 2018 13:52:31
    Thought I'd share with other Synchronet Sysops...

    I have converted the BAJA command "FILE_VIEW" to a Javascript command and added a few output lines showing what libs and dirs are being searched.

    function ViewFiles() {
    printf("\r\nView File(s)\r\n");
    var FILESPEC;
    if (FILESPEC = bbs.get_filespec() + "*") {
    if(bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number, FILESPEC, FL_VIEW)){
    return;
    }
    printf("%s", bbs.text(166));
    for(i=0;i<file_area.lib_list[bbs.curlib].dir_list.length;i++) {
    if(i!=bbs.curdir) {
    printf("Searching %s...\r\n", file_area.lib_list[bbs.curlib].dir_list[i].name);
    if(bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[i].number, FILESPEC, FL_VIEW)){
    return;
    }
    }
    }
    if(i<file_area.lib_list[bbs.curlib].dir_list.length){
    return;
    }
    printf("\r\n");
    printf("%s", bbs.text(167));
    for(i=0;i<file_area.lib_list.length;i++) {
    if(i!=bbs.curlib) {
    for(j=0;j<file_area.lib_list[i].dir_list.length;j++) {
    printf("Searching %s - %s...\r\n", file_area.lib_list[i].name, file_area.lib_list[i].dir_list[j].name);
    if(bbs.list_files(file_area.lib_list[i].dir_list[j].number, FILESPEC, FL_VIEW)){
    return;
    }
    }
    }
    }
    printf("%s", bbs.text(290));
    console.pause();
    }
    }

    -- High Spirit Digital Realms Main - connect.digitalrealms.net 23
    Digital Realms C=64 - connect.digitalrealms.net 6400

    ---
    Synchronet Digital Realms BBS - connect.digitalrealms.net