Variable creation, in the case of RBase, are global, as the language was not implemented with encapsulation in mind.
Without belaboring, garbage collection within any specific language, variables that are created within a subroutine (which would be within a procedure or function) are local to that routine only and disappear as you exit the routine, UNLESS, they are passed in to the routine by reference, which allows that variable to maintain its' life until it returns to the routine in which it was created, which in most languages could also be declared at the global level, or public. So creating EVERY variable that you are ever going to use in an RBase session could be a disaster in a big application, so the prudent thing to do is create and destroy them as close to their necessity as possible. Some of our inventive RBase users, preface their variable names with a few characters, containing enough identifying info to clear large groups of variables in a single CLEAR statement or reference, like if you had 30 variables prefaced with "f12a_", you would clear all of them with: CLEAR VAR fi2a_% > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf Of Michael > J. Sinclair > Sent: Monday, July 28, 2014 9:13 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - Creating Variables in large applications with > while loops/whileopt on > > Hi All, > I was reading about whileopt. To make it work well, one of the > requirements is to create all of the variables outside of the while > loop. I assume (correct me if I am wrong please) that this also applies > to any RUN statements within the while loop. > > How do professional programmers create variables? Do they create all > variables needed at the beginning of the application including all the > sub routines? Should subroutines not be allowed to create variables > just in case they are ever used within a while loop? Does having > hundreds of variables created at the beginning of a large application > make sense? > > TIA > Mike

