Skribent: info at smallinnovations.nl Dato: Til: dng Emne: Re: [DNG] Would you guys hate me if...
On 06-08-16 10:39, Edward Bartolo wrote: > In the case of simple parsing requirements, I prefer to have the
> program itself do the parsing instead of relying on an external
> parser. This remove the extra dependency on the parser.
>
> I would also like to comment on the text file format in which menus
> and menu trees will be stored. If I were to code the project myself I
> would opt to avoid using a nested format to mimic a tree structure.
> Instead lines defining tree-nodes would be used as I described
> earlier.
>
> placement="main menu/sub-menu1/next-sub-menu1"
>
> This neatly describes tree nodes without using a nested format. It
> also allows menu items to be placed anywhere in the file which is an
> advantage.
>
> Such parser would "understand" the start of a menu definition by the
> "placement=" string after which it should search for other fields as I
> described earlier. A menu definition would be delimited by the next
> "placement=" string.
>
> What I am describing is simple but it can effectively be used to
> define a menu tree that is saved in a human editable/readable format
> not requiring any external parsers.
>
> Requoting for ease of reference:
> <<
> placement="/path/to/menu/item/in/menu/tree"
> name="my cool menu"
> command="/path/to/command param1 param2 ..."
> icon="/path/to/icon"
> Edward
> Back in the old MS-DOS days i made a menu with 26 choices from A to Z
per page. The file structure was a simple text file with at the [A]
"Description" command parameter. To have a submenu you had a [A]
"Description" line and [AA] "Description" command parameter line. Never
needed more then two layers but you could also have [AAA] or more.
Maybe i still have the original Turbo Pascal source somewhere.