- Jun
- 762
- 16
I maintain the definitions for the buttons in a file. Whenever I add, remove, or change the position of a button in the file, I have to renumber all the buttons. If the numbers are out of order or some are missing, I don't get the toolbar I expect. (I'm not sure why TCMD doesn't do this automatically when reading in the file, but maybe there are cases where one does not want the buttons to be in order with no gaps.)
Today I decided to deal with this and wrote a program in Pascal that processes the file and renumbers all the buttons in order. (Trying to do this in a BTM script seemed to be impossible because of all the special characters in the file.) One can create/edit the file to have lines that that start with just "B=" or "B#=" or "B##=" (# can actually be any character), and the program will renumber them. The program writes its output to a new file, and I use a BTM script to manage testing and renaming.
If anyone is interested, I would be happy to provide the Pascal source code and the EXE file.
Today I decided to deal with this and wrote a program in Pascal that processes the file and renumbers all the buttons in order. (Trying to do this in a BTM script seemed to be impossible because of all the special characters in the file.) One can create/edit the file to have lines that that start with just "B=" or "B#=" or "B##=" (# can actually be any character), and the program will renumber them. The program writes its output to a new file, and I use a BTM script to manage testing and renaming.
If anyone is interested, I would be happy to provide the Pascal source code and the EXE file.