|
Ahh, anything can be done in computers. You could do it, but you would have to internally describe the file. Then you would need to look up the position of the field in the file description. Then you would need to get the data directly from the buffer %Subst(FileBuffer, Start, Finish). In fact, someone wrote a freeware utility that does this type of thing, and you can find a link to it in the midrange-l archives. I've not seen the source, so am not positive how he does it, but he would be the one to know. Regards, Jim Langston Programmer/Analyst Cels Enterprises, Inc. -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of Scott Klement Sent: Friday, September 07, 2001 1:13 PM To: rpg400-l@midrange.com Subject: Re: ALLOC help On Fri, 7 Sep 2001, Tony Pack wrote: > Hi all, > I think this can be done, but this is new to me. I want to read a > record from a file, get the value from a field, and then use that value's > name as a field within the program. You can't do that, sorry. Here's a gross oversimplification of why: The variable's "name" is usually something symbolic that makes it easier for you to write your program. Once the program has been compiled, that name is gone -- it's working with addresses in memory instead. So, you can't use data in a file to give you a variable name -- At least not directly. > I am reading on ALLOC and DEALLOC, and it looks as if I can use the > pointers to create a heap space and then set it's value via pointers. > Has anyone got any examples of a similar task they would care to share? I'm not quite sure what you're trying to do. Are you just looking for examples of how to use pointers? Or are you actually looking for something more specific? Perhaps if I had an idea of what you need to accomplish and why, I might be able to show you a technique that would help... can you send more information? Thanks! _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.