[BR_forum] George - PROC TT
Posted: Sun May 10, 2009 8:29 pm
Hey George,
I know that you use "PROC tt" to set lots of "global" variables at the beginning of every program. I'm thinking of doing the same. I have a great need to cut down on the redundancy in each of my programs. Long ago, I used a program generator to create most of my programs. This was before libraries, so all of the "common code" was duplicated in every program. Then as time went on and my program generator didn't work the way I wanted it to, I started simply cannanalizing existing programs to create new ones. (I'm sure no one here has every done that
). Anyway, now most of my programs have a LOT of common code that I'd like to pull out into libraries or TT procs or whatever is most appropriate.
Questions:
1. Do you just keep the tt file as a static file or is it generated dynamically by a BR program?
I had an idea. I thought that if I "generated" the TT text file from a program, I could create more dynamic values in it that would be updated constantly, such as formatted date strings for "today", or assigning folder names for different applications and things like that. I'm sure there are loads of other things that this would enable me to do too. In other words, I'd create a program that I run on a regular basis (haven't decided if it would be daily, or when I launch a menu or what...) .
But that program could open a new text file "TT_GLOBAL", write the "static" tt lines in the original TT file and then add dynamic values based on other criteria. So if most of my programs depend upon a value "DATEYMD" that is calculated at the beginning of every program, I'd do this in my global setup program and write it to the TT_GLOBAL file like any other value. (Yes I know I can use the DATE/DAYS functions to get that particular value, but I have loads of old programs that use other variables, so it would maintain compatibility wit those.)
2. Do you PROC in TT in mostly every program as a routine?
3. Is there a way to handle variables in TT that are larger than the default size of 18 bytes for undim'd strings? I have a longer string that is my application name - used in multiple places in almost every program. I thought that I could load this as well, though I can't figure out how I can dim it from a PROC. Is there a way?
-- Susan
I know that you use "PROC tt" to set lots of "global" variables at the beginning of every program. I'm thinking of doing the same. I have a great need to cut down on the redundancy in each of my programs. Long ago, I used a program generator to create most of my programs. This was before libraries, so all of the "common code" was duplicated in every program. Then as time went on and my program generator didn't work the way I wanted it to, I started simply cannanalizing existing programs to create new ones. (I'm sure no one here has every done that
Questions:
1. Do you just keep the tt file as a static file or is it generated dynamically by a BR program?
I had an idea. I thought that if I "generated" the TT text file from a program, I could create more dynamic values in it that would be updated constantly, such as formatted date strings for "today", or assigning folder names for different applications and things like that. I'm sure there are loads of other things that this would enable me to do too. In other words, I'd create a program that I run on a regular basis (haven't decided if it would be daily, or when I launch a menu or what...) .
But that program could open a new text file "TT_GLOBAL", write the "static" tt lines in the original TT file and then add dynamic values based on other criteria. So if most of my programs depend upon a value "DATEYMD" that is calculated at the beginning of every program, I'd do this in my global setup program and write it to the TT_GLOBAL file like any other value. (Yes I know I can use the DATE/DAYS functions to get that particular value, but I have loads of old programs that use other variables, so it would maintain compatibility wit those.)
2. Do you PROC in TT in mostly every program as a routine?
3. Is there a way to handle variables in TT that are larger than the default size of 18 bytes for undim'd strings? I have a longer string that is my application name - used in multiple places in almost every program. I thought that I could load this as well, though I can't figure out how I can dim it from a PROC. Is there a way?
-- Susan