• parsing example

    From Tracker1@VERT/RGRGUMBY to All on Tue Sep 5 09:11:00 2000
    I'd like to create a text string to parse through for displaying menus...

    I know, there are functions to use an external screen, but working on a command shell, that I'd like to have everything internal.. already have some of the functions down, for like menu headers and prompts... but the parsing for the menu options is getting to me..

    also, is there a way to get an internal @ code to translate... I created a sub that will center a block of text in a given size, the only problem is that when I seem to use an @ code, it doesn't translate before the strlen goes.. :(

    anyways, back to the need at hand, an example on parsing a string would be really helpfull... :) there doesn't seem to be a means of getting a substring, or the position of a substring in a file.

    example of what I want to parse...

    M,Message Menu;F,FileMenu;

    would parse out to...
    [M] Message Menu
    [F] File Menu


    Also, any examples on reading in from a file would be great... :)

    ---
    þ Synchronet þ Rangergumbys Outpost - tracker1.darktech.org
  • From Digital Man@VERT to Tracker1 on Wed Sep 6 01:39:00 2000
    RE: parsing example
    BY: Tracker1 to All on Tue Sep 05 2000 08:11 pm

    I'd like to create a text string to parse through for displaying menus...

    I know, there are functions to use an external screen, but working on a comm shell, that I'd like to have everything internal.. already have some of the functions down, for like menu headers and prompts... but the parsing for the menu options is getting to me..

    also, is there a way to get an internal @ code to translate... I created a s that will center a block of text in a given size, the only problem is that w I seem to use an @ code, it doesn't translate before the strlen goes.. :(

    @-codes are expanded during printing only. Consider using one of the global variables (listed in SBBSDEFS.INC) or a command-line specifier (listed in Appendix A of SYSOP.DOC) instead.

    anyways, back to the need at hand, an example on parsing a string would be really helpfull... :) there doesn't seem to be a means of getting a substri or the position of a substring in a file.

    I've done this kind of thing before with a combination of compare_str and shift_str.

    example of what I want to parse...

    M,Message Menu;F,FileMenu;

    would parse out to...
    [M] Message Menu
    [F] File Menu

    Very doable.

    Also, any examples on reading in from a file would be great... :)

    Did you look at FILE_IO.SRC?

    Rob

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Amcleod@VERT to Digital Man on Wed Sep 6 05:42:00 2000
    RE: parsing example
    BY: Digital Man to Tracker1 on Wed Sep 06 2000 12:39 pm

    Also, any examples on reading in from a file would be great... :)

    Did you look at FILE_IO.SRC?

    Hehehe!

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Hax0r@VERT/HAX0RQWK to Digital Man on Wed Sep 6 08:52:00 2000
    RE: parsing example
    BY: Digital Man to Tracker1 on Wed Sep 06 2000 12:39 pm

    @-codes are expanded during printing only. Consider using one of the global variables (listed in SBBSDEFS.INC) or a command-line specifier (listed in Appendix A of SYSOP.DOC) instead.

    Actually, i'm working on something similar -- I'd like to do a compare againts @GRP and @SN but i havent seen any global vars or command line specifiers
    that report back this info -- is there anyway to get it in for a compare?

    basically I'm looking to have my main menu prompt either display the short or the long description of the current msg board based on the group its in.

    should be relatively easy to accomplish this, one i figure out how to get that info into my code ;)




    ...A feature is a bug with seniority.

    ---
    þ Synchronet þ hax0r's palace - unknown-realm.dynip.com - you've been hax0r'd
  • From Digital Man@VERT to Hax0r on Wed Sep 6 07:08:00 2000
    RE: parsing example
    BY: Hax0r to Digital Man on Wed Sep 06 2000 07:52 pm


    @-codes are expanded during printing only. Consider using one of the glob variables (listed in SBBSDEFS.INC) or a command-line specifier (listed in Appendix A of SYSOP.DOC) instead.

    Actually, i'm working on something similar -- I'd like to do a compare again @GRP and @SN but i havent seen any global vars or command line specifiers that report back this info -- is there anyway to get it in for a compare?

    You can use COMPARE_ARS to determine the current group/sub-board.

    basically I'm looking to have my main menu prompt either display the short o the long description of the current msg board based on the group its in.

    should be relatively easy to accomplish this, one i figure out how to get th info into my code ;)

    Yes, I think COMPARE_ARS is what you're looking for.

    Rob

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