|
<<Forwarded from MIDRANGE-L>> > From: Barbara Morris > > Had you already been using VARYING? It's also very > powerful, both for parameters and for general use. All I can say about VARYING is... wow. I mean, serious wow. I changed a field one of my files to use VARLEN. In my prototypes, I've been using an externally described DS and a LIKE defines for that parameter, and magically this parameter is now VARYING. No more trims. String manipulation is much cleaner and easier to read. I'm floored. I wish I'd known about this sooner, because it would have alleviated a lot of headaches. No longer do I have to worry about buffer overflows when making long strings. Not only that, the CONST keyword will automatically resize the VARYING fields when they need to be fixed length (obviously, truncation is an issue, but that's programmatic, and would be a problem no matter what - but I don't have to constantly %trim and "+" while I'm working towards the final field contents). It's 11PM, and I've completely revamped major parts of my file manipulation logic to use this, and I'm still finding cool nuances. I wish I had another two days to redo everything, but other work beckons. One question: is there an easy way to bring in field definitions via an externally described data structure WITHOUT allocating the space for the buffer? I've got to believe that some application of the BASED keyword will allow me to do this, but I can't figure it out. Too many brain cells taken up with VARYING <grin>. Joe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.