outra9e
24th July 2002, 15:57
Im back yet again!!!
I am displaying an addressfrom tccom013 on a form.
I want to control whether the address is displayed or not...
eg if a catagory in a field is selected, I do not want the address to be displayed.
Should I use the before.display variable to tell it not to? and do I tell the fields to = isspace?
evesely
24th July 2002, 18:09
You do want to use before.display. You can set the field value to space, but you can also set the attr.echo value to false. For example:
field.addr.field:
before.display:
attr.echo = (category.field <> "NO DISPLAY VALUE")
Good luck!
outra9e
24th July 2002, 18:36
field.addr.field:
before.display:
attr.echo = (category.field <> "NO DISPLAY VALUE")
What I actually want I think is this.
field.addr.field:
before.display:
If tdsls901.ncat = FCN or tdsls901.unpt is not isspace then
attr.echo = (addr.field not displayed)
Does that make sense?
evesely
24th July 2002, 18:57
attr.echo is a boolean. In my example, if the category equals the text, attr.echo is false -- the field does not display.
So, you could write yours as:
field.addr.field:
before.display:
attr.echo = not (tdsls901.ncat = FCN or not isspace(tdsls901.unpt))
or, if it is more comfortable:
field.addr.field:
before.display:
if tdsls901.ncat = FCN or not isspace(tdsls901.unpt) then
attr.echo = false
endif
outra9e
25th July 2002, 10:42
HI
Here is the code I have implemented, I am getting no errors on compilation but the address field does not display at all now even if the category is fcn or if I populate the unpt field with charachters...
|************field section**************
field.tccom013.nama:
before.display:
select.delivery.address.nama()
if tdsls901.ncat = tdsls.ncat.FCN or not isspace(tdsls901.unpt) then
attr.echo = false
endif
|***********function section*************
function select.delivery.address.nama()
{
select tccom013.nama
from tccom013
where tccom013.cuno = :tdsls901.cust and tccom013.cdel = :tdsls901.ncdel
selectdo
attr.input = false
endselect
}
Any ideas?
outra9e
25th July 2002, 11:53
Guys
Ignore the last post.
This now working using the first example you gave me ...
attr.echo = not (tdsls901.ncat = FCN or not isspace(tdsls901.unpt))
thanks for your help on this.
:D