Thanks Bill,
I have split the command into individual segments for each variable but there
is still a problem:
It would _appear_ that there is some sort of aversion to variables when they
don't exist by the IFEQ function.
This works whether the variable exists or not:
SET VAR v1 INTEGER = (CHKVAR('RBTI_FORM_ALIAS'))
IF v1 = 1 THEN
SET VAR vFormData02 = ( (CTXT(.RBTI_FORM_ALIAS)) + (CHAR(013)) + (CHAR(010)) )
ELSE
SET VAR vFormData02 = ' '
ENDIF
and I'm determining exists by whether it appears using [F3].
This fails only when the variable does not NOT exist:
SET VAR vFormData02 = +
('Form Alias:' & (IFEQ( (CHKVAR('RBTI_FORM_ALIAS')), 0, ' ', .RBTI_FORM_ALIAS))
)
(I've removed the CR/LF just for clarity.)
This works whether the variable exists or not:
SET VAR vFormData02 = ('Form Alias:' & (IFEQ( (CHKVAR('vNotExist')), 0, ' ',
'NotExist')) )
But this fails:
SET VAR vFormData02 = ('Form Alias:' & (IFEQ( (CHKVAR('vNotExist')), 0, ' ',
.vNotExist)) )
The errors is always "Unrecognized global variable in expression (2161)"
followed by "Expression cannot be evaluated (2179)"
Obviously there is a work-around - less elegant but perfectly acceptable. I
assume that IFEQ cannot evaluate the 3rd & 4th arguments as being of the same
type if it can't find one of them and I suppose that's not unreasonable.
Thanks again for your help. I'll bear in mind the size and/or number of tokens
in future. Actually, I looked at the multi-line example given in the help for
the pause command and estimated that mine was not that different but, on a
second look, mine is significantly longer with more tokens.
Regards,
Alastair.
----- Original Message -----
From: Bill Downall
To: RBASE-L Mailing List
Sent: Wednesday, May 13, 2009 8:53 PM
Subject: [RBASE-L] - Re: Set Var/ChkVar problem
Alastair,
It's the size of the humongous expression you are using to build the variable
that is exceeding limits, not the size of the resulting variable itself. And/or
you've exceeded the number of what Wayne Erickson called "tokens" or discreet
items within the expression. Each "+" sign or "&" sign is one token. Each
variable is one token. Each quoted string is one, each parenthesis is one, etc.
I don't remember how many of those you are allowed, but I'm pretty sure you
have more than that.
I estimated about 1800 characters or so in your single-SET-VAR-command
expression, which would work fine in 8.0, but you may need more than 2 or 3
stages to get under 240 characters in each expression in 7.6.
Bill
On Wed, May 13, 2009 at 3:45 PM, Alastair Burr <[email protected]>
wrote:
Thanks, Bill,
I'm on v7.6 - but I don't _think_ that the size of the resulting variable
will breach the limit.
I'll try breaking the SET VAR into 2 or 3 stages and then concatenate the
results...
Regards,
Alastair.
----- Original Message -----
From: Bill Downall
To: RBASE-L Mailing List
Sent: Wednesday, May 13, 2009 8:01 PM
Subject: [RBASE-L] - Re: Set Var/ChkVar problem
Alastair,
What version do you use? The expression size limit is 2000 characters in
V8, and 240 characters in V7.6, 7.5. There's also a limit to a number of
"items" or "tokens" in an expression, but I'm not sure what that is.
Bill
On Wed, May 13, 2009 at 2:41 PM, Alastair Burr
<[email protected]> wrote:
Can anybody see/explain why this is not working:
SET VAR vFormData TEXT = NULL
SET VAR vFormData = +
('Form Name:' & (IFEQ( (CHKVAR('RBTI_FORM_FORMNAME')), 1,
(CTXT(.RBTI_FORM_FORMNAME)), ' ')) + (CHAR(013)) + (CHAR(010)) ++
--------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.325 / Virus Database: 270.12.27/2111 - Release Date:
05/12/09 18:03:00
------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.325 / Virus Database: 270.12.27/2111 - Release Date: 05/12/09
18:03:00