|
I agree with you completely. I have a command file that runs every
time I start my app, and it looks something like: set v i1 int=null set v i2 int=null set v i3 int=null set v t1 text=null set v t2 text=null set v d1 date=null set v d2 date=null set v n1 num(4,2,)=null set v count_of_pn int=0 and I have about 2 pages of this kind of stuff that presets all my variables with a null, zero or whatever default/starting value I want. I NEVER use the CLEAR VAR command, instead just reset /reuse all these preset variables using the very compact syntaxes of: d1=.#date i1=0 t1='y' t2=null and so on. Very compact, clean and lean, and the fastest, because it's so easy on the CPU I've always suspected that clearing variables created a memory leak, but cannot prove it. But it surely causes more typing when coding! bill Alastair Burr wrote: Whilst I appreciate that it is sometimes nice to know if a variable already exists (and, if so, maybe even its value) but I would suggest that it is much better to declare _all_ of them at the start of your app/cmd file/eep/whatever and _never_ clear them until the end.Of course there will always be exceptions but I have found it much easier to be able to see all the vars at the top of the file and their data type in one place. If I need to reset any I simply set it to null or a specific value before use. Would anybody like to comment on the overhead of keeping variables defined against regularly setting and clearing them (and, maybe losing them)? With computing power such as it is these days can a practical limit be reached? Regards, Alastair. ----- Original Message ----- From: "James Hageman" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, September 10, 2003 9:24 PM Subject: [RBASE-L] - Re: Create variable on the fly |
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly MikeB
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly James Hageman
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly James Hageman
- [RBASE-L] - Re: Create variable on the fly MikeB
- [RBASE-L] - Re: Create variable on the fly Alastair Burr
- [RBASE-L] - Re: Create variable on the fly Doug Daily
- [RBASE-L] - Re: Create variable on the fly William Stacy
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly Alastair Burr
- [RBASE-L] - Re: Create variable on the fly Jim Limburg
- [RBASE-L] - Re: Create variable on the fly Alastair Burr
- [RBASE-L] - RE: Create variable on the fly Albert Berry

