1. Re: Variable naming in Euphoria
- Posted by Mike Sabal <MikeS at NOTATIONS.COM> Aug 11, 2000
- 385 views
<shameless plug> My lockseq library in the archives should meet your needs. Or get it at http://sabal.8m.com/ and click the Euphoria button. <disclaimer>This is a freeservers site.</disclaimer> </shameless plug> Michael J. Sabal >>> futures8 at PCOLA.GULF.NET 08/11/00 12:53PM >>> I'm new to Euphoria, so my question will seem very basic to those on the list. Hope some kind soul will offer some suggestions. Some languages have the capability to programatically create variable names; the following example from Foxpro demonstrates what I'm hoping can somehow be done in Euphoria. I have checked the Euphoria docs and various other Euphoria programs submitted to the archives by others, but haven't found and examples of what I'm looking for; . ----------------------------------------------------------------------------- if reccount() - recno() < 10 k = reccount() - recno() else k = 10 endif for i = 1 to k j = alltrim(str(i)) -- makes j a character respresentation of the integer i store val(CLOSE) to Price&j skip next i --------------------------------------------------------------------------------- the loop iteratively creates variables Price1, Price2 ...Price10 and assigns them a value. The concatenation operator in Euphoria will catenate the contents of sequences, but not variable names. Is there a way to similarly create (declare) and assign variable names on the fly in Euphoria? Any suggestions will be appreciated. Thanks. Jim