User blog comment:SamwiseFilmore/GUI Programs/@comment-25841881-20170412213001/@comment-25841881-20170415155903

Alright. For future reference, though, here's what I'd do to allow it to easily edit the string and have new templates added easily.. The template file format - as in the files to specify templates that you can edit - would be the same as an unfilled-out template. However, in all input spots, they'd have a symbol not used in any templates, possible an ampersand, followed by the name of the input for that slot. After that, another ampersand would follow. When loading the pattern into the editor, it'd scan the list for the text pattern which is just the character used as the symbol. When it found it, it'd take the text from there to the next symbol and create an input box with that as the label. It would continue that scanning until the end of the file. Then, after the user fills in all the inputs and hits 'generate' or w/e.. It would scan the file again. It would concatenate the string from start to symbol with the input for after that symbol. It would then concatenate that with the string until the symbol, then with the input after that symbol, and so on until the end of the pattern.