• Bug

    From Tommyknocker@TALAMASC to All on Sunday, January 03, 1999 03:39:00

    Ok here is the top portion of the code I am having trouble with.
    This is the main menu and web listings menu for websites.

    The problem is this. Hitting a key that is not listed as a command key just reprints the menu, and does nothing else. This works perfectly on both menus, except hitting 'n'. If I hit n, the first time it prints the statement about a wrong key, then gives the hit a key pause. At this point if you hit n again, it will then print the command prompt, but not the menu.

    The same thing happens if for example you hit a q which is an invalid key. It will print the wrong key statement and pause. If you hit any key except n it will clear the screen and reprint the menu and prompt just like it should. If you hit an n it clears the screen and reprints just the prompt.

    To see this bug in action logon to The Talamasca
    talamasc.madnet.net
    and run Internet Resource Listing from the main menu.

    Here is the code...


    !INCLUDE SBBSDEFS.INC
    !INCLUDE FILE_IO.INC

    ##### Set Node action
    node_action node_xtrn
    async

    ############################ Display Main Menu ############################### :main
    cmd_home
    cls

    compare_user_misc um_ansi
    if_true
    printfile "%jbajamods\\websites\\main.ans"
    else
    printfile "%jbajamods\\websites\\main.asc"
    end_if

    ##### Display Main Prompt #####

    print "\r\nSelect an option @ALIAS@-->"

    ##### Get Command Key #####

    compare_user_misc um_coldkeys
    if_false
    getkeye
    else
    getstrupr 60
    end_if

    ##### Do nothing for control keys and space #####

    cmdkey ^@
    end_cmd
    cmdkey ^M
    end_cmd
    cmdkey ^S
    end_cmd
    cmdkey "
    end_cmd

    compare_user_misc um_coldkeys
    if_true
    crlf
    end_if
    pause_reset

    ##### Main Menu Commands #####

    cmdkey a
    call add
    end_cmd

    cmdkey e
    call email
    end_cmd

    cmdkey f
    call ftp
    end_cmd

    cmdkey r
    return
    end_cmd

    cmdkey t
    call telnet
    end_cmd

    cmdkey w
    call web
    end_cmd

    print "Excuse me, try a key that works!\r\n"
    crlf
    pause
    end_cmd

    ############################ Display Web Menu ################################ :web
    cmd_home
    async
    cls

    compare_user_misc um_ansi
    if_true
    printfile "%jbajamods\\websites\\web.ans"
    else
    printfile "%jbajamods\\websites\\web.asc"
    end_if

    ##### Display Web Prompt #####

    print "\r\nSelect an option @ALIAS@-->"

    ##### Get Command Key #####

    compare_user_misc um_coldkeys
    if_false
    getkeye
    else
    getstrupr 60
    end_if

    ##### Do nothing for control keys and space #####

    cmdkey ^@
    end_cmd
    cmdkey ^M
    end_cmd
    cmdkey ^S
    end_cmd
    cmdkey "
    end_cmd

    compare_user_misc um_coldkeys
    if_true
    crlf
    end_if
    pause_reset

    cmdkey d
    call udeleteweb
    end_cmd

    cmdkey r
    cmd_pop
    return
    end_cmd

    cmdkey s
    call searchweb
    end_cmd

    cmdkey u
    call updateweb
    end_cmd

    cmdkey v
    call webfile
    end_cmd

    print "Have you thought about getting some new fingers?\r\n"
    crlf
    pause
    end_cmd

    end of code posted, but not the end of the module.

    TommyKnocker





    ---
    ■ Synchronet ■ telnet://talamasca-bbs.com http://www.talamasca-bbs.com
  • From Tommyknocker@TALAMASC to Tommyknocker on Sunday, January 03, 1999 14:17:00
    RE: Bug
    BY: Tommyknocker to All on Sun Jan 03 1999 11:39 am

    Ok here is the top portion of the code I am having trouble with. This is the main menu and web listings menu for websites.
    The problem is this. Hitting a key that is not listed as a command key ju reprints the menu, and does nothing else. This works perfectly on both menus

    The problem has been fixed. A little phone time with U. Crazy Diamond put me on the right track. All I needed was to trap the built in control-c.

    For the record, I think this is the final bug in my Internet Resource Listing. I am going to spend a little time cleaning up and commenting the code, and then I will release it for you all to poke holes in.

    Thank you very much UCD. You code snippet did not work, but it put me on the right track.
    clear_abort
    was the command we was needing. Works perfect now, and a bug that bugged me for 3 or 4 months is now history.
    ░░▒▒▓▓╤ømmµKnøÇkεr▓▓▒▒░░


    ---
    ■ Synchronet ■ telnet://talamasca-bbs.com http://www.talamasca-bbs.com