Last active
August 29, 2015 14:06
-
-
Save diego-aslz/01e1100c74f7541f4bec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure VarreItens(MenuItem: TMenuItem; List: TStringList; Nivel: Integer = 0); | |
| var | |
| str: String; | |
| i: Integer; | |
| begin | |
| str = ''; | |
| i := 0; | |
| while i < Nivel do | |
| begin | |
| str = str + ' '; | |
| Inc(i); | |
| end; | |
| List.Add(str + MenuItem.Caption); | |
| i := 0; | |
| while i < Length(MenuItem.Items) do | |
| begin | |
| VarreItens(MenuItem.Items[i], List, Nivel + 1); | |
| Inc(i); | |
| end; | |
| end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure VarreItens(MenuItem: TMenuItem; List: TStringList); | |
| var | |
| i: Integer; | |
| begin | |
| List.Add(MenuItem.Caption); | |
| i := 0; | |
| while i < Length(MenuItem.Items) do | |
| begin | |
| VarreItens(MenuItem.Items[i], List); | |
| Inc(i); | |
| end; | |
| end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment