Larry, will this do it: SET VAR vMyVar = 24 SET VAR vVarName text = (ctxt(.vMyVar)) SET VAR vResult real = (int(.vVarName) / 2)
It gives the correct result. Jim Blackburn Kodiak Lawrence Lustig wrote: > > Does anyone know a work around to get the following > code to execute (this is a simplified version of what > I'm trying to do): > > SET VAR vMyVar = 24 > SET VAR vVarName = 'vMyVar' > SET VAR vResult = (&vVarName / 2) > > The result should be that R:Base substitutes vMyVar > for &vVarName and produces 12. as the result. > However, R:Base interprets the & as a concatenation > operator and reports that it cannot be used in this > location in the expression. (ERROR 2145 -- A left > parentheses cannot be followed by binary operator). > > What I'm looking for is some operator or expression I > can put in front of the & to force the expression to > evaluate correctly. > > (I have one work around, which is to do this: > > SET VAR vExpression = '(vMyvar / 2)' > SET VAR vResult = &vMyExpression) > > but in my real situation, as opposed to this > simplified version, it causes the code to become very > difficult to read) > -- > Larry ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
