> In your example below, you have forced vVarName to
> be TEXT 
> by pre-defining SET VAR vVarName = 'vMyVar'
> 
> I have never seen any TEXT variable divided by
> INTEGER value <g>.
> 
> Always pre-define variable(s) with appropriate data
> type(s). 

No, I understand that.  I'm not trying to divide the
text by an integer value, but rather get the variable
name that I specified, recover the value of that
variable, and divide that integer value by another
integer value.  (That is, I don't want to use
.vVarName in the expression which does lead R:Base to
correctly reject the expression as division of TEXT by
INTEGER.  I want to use &vVarName to do macro
substitution, by R:Base has trouble parsing the
resulting expression).

The whole thing works as expected on my example case
if I use the workaround I specified in my original
message.  However, that workaround does not work in my
real situation, as described below:

In my real case, the variable does not hold a variable
name, but a column name.  The name of the column to be
operated on is not known until run-time, so I have to
put it into a variable, and somehow use that variable
to make the expression.  Here is the real statement
from my code (sorry for the wrapping):

UPDATE ttblReportData +
  SET &vPctColName =
((&vDollarColName/.vSalesLessReturns)*100) +
  WHERE &vDollarColName IS NOT NULL AND &vPctColName
IS NULL +
    AND StatementType <> 'BS'

The table contains 30 sets of columns of the form
Dollars01, Pct01, Dollars02, Pct02 and so on.  This
code is inside a loop, and for each iteration, a new
vPctColName and vDollarColName are determined, which
specify which pair of columns to operate on.

The expression
((&vDollarColName/.vSalesLessReturns)*100) cannot be
evaluated, because the & is missinterpreted as a
concatenation operator.  If I put the whole expression
in a variable and substitute in the variable in place
of the expression (this is the workaround from my
original post) then I still get the error message.
--
Larry

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
================================================
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/

Reply via email to