Subject Re: report canrender
From Mervyn Bick <invalid@invalid.invald>
Date Thu, 6 Dec 2018 07:53:54 +0200
Newsgroups dbase.getting-started

On 2018-12-06 6:53 AM, Ken Mayer wrote:
> On 12/5/2018 7:53 PM, charlie wrote:
>> Hi... I am having trouble with this:
>> function TEXT9_canRender()
>>          this.text =
>> this.parent.text6.text()+this.parent.textadditamt1.text()
>>        return true
> Well, text is ... text, right? So what are you getting? Have you tried
> using val() around these?

Well, sort of. :-)

Here we're talking of a property which can actually hold numeric values.
The property is named 'text' but it could just as easily have been named

The naming of the textadditamt1 object is typical of where a field has
been placed on the report from the Field Palette.  The contents of the
text property will be a codeblock and evaluating the codeblock by using
the () call operator is almost certain to return a numeric value if the
name is anything to go by.

The fact that Charlie is using the () call operator in conjunction with
the text property of text6 implies that this text property also contains
a codeblock.  If it's not a codeblock I would expect an "Expression
expected" error.

>   this.text = val(this.parent.text6.text()) +
> val(this.parent.textadditamt1.text())

If either text6.text() or textadditamt1.text() returned characters then
Charlie's code would concatenate the two values and not leave a blank.
My money's on a null lurking somewhere.