From: Jozo on
Hi all !

I use very oft SetSelective like:

SELF:SetSelectiveRelation(oWindow_DETAIL, #cFld)
.or.
SELF:SetSelectiveRelation(oWindow_DETAIL,'cFld')

and I know that next expressions are correct and works:
SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ") or
SELF:SetSelectiveRelation(oWindow_DETAIL,' "M" + cFld ')

but when I write it in the WED, VO changes it in :
SELF:SetSelectiveRelation(oWindow_DETAIL,' 'M' + cFld ')
and, normally, signals error.

Does anybody can to help me, how to write this expression in the editor
without error:
Relation string = " 'M' + cFld "


Thanks in advance
Jozo


From: Farid on
Try

" " + _CHR(34) + "M" + _CHR(34) + cFld + " " // if trailing blank is
needed?
* DEFINE K_QUOTE_ := _CHR(34)

Maybe?

-- Farid

On Feb 24, 4:34 am, "Jozo" <racun...(a)os.t-com.hr> wrote:
> Hi all !
>
> I use very oft SetSelective like:
>
> SELF:SetSelectiveRelation(oWindow_DETAIL, #cFld)
>  .or.
> SELF:SetSelectiveRelation(oWindow_DETAIL,'cFld')
>
> and I know that next expressions are correct and works:
> SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ") or
> SELF:SetSelectiveRelation(oWindow_DETAIL,' "M" + cFld ')
>
> but when I write it in the WED, VO changes it in :
> SELF:SetSelectiveRelation(oWindow_DETAIL,' 'M' + cFld ')
> and, normally, signals error.
>
> Does anybody can to help me, how to write this expression in the editor
> without error:
> Relation string =   " 'M' + cFld "
>
> Thanks in advance
> Jozo

From: Geoff Schaller on
Jozo,

You need to read the Help because you have this all wrong. The Help is
quite detailed and explains the three methods possible:

String
Code block
Array

But in the end (and you should review the SDK on this) they are all
compiled to a code block so if you provide a string then you MUST
provide one that can be compiled into a code block. If you have multi
field relations then the simplest option is the array of symbols.
Remember the RDD is the one executing the code block so it must have
scope that allows this.

So to answer your question, you cannot expect complex expressions to be
possible using the WED - it can only do things in terms of fields
expected. You are better handling such things in a method cal on the
class.

Geoff



"Jozo" <racunalo(a)os.t-com.hr> wrote in message
news:hm36ck$5s8$1(a)ss408.t-com.hr:

> Hi all !
>
> I use very oft SetSelective like:
>
> SELF:SetSelectiveRelation(oWindow_DETAIL, #cFld)
> .or.
> SELF:SetSelectiveRelation(oWindow_DETAIL,'cFld')
>
> and I know that next expressions are correct and works:
> SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ") or
> SELF:SetSelectiveRelation(oWindow_DETAIL,' "M" + cFld ')
>
> but when I write it in the WED, VO changes it in :
> SELF:SetSelectiveRelation(oWindow_DETAIL,' 'M' + cFld ')
> and, normally, signals error.
>
> Does anybody can to help me, how to write this expression in the editor
> without error:
> Relation string = " 'M' + cFld "
>
>
> Thanks in advance
> Jozo

From: Jozo on

Farid, thanks to reply but SetSelective in this example doesn't work
although compiler doesn't signalize error.

I put this example into PostInit() and works:
SELF:SetSelectiveRelation(oWindow_DETAIL,"'M'+cFld")

but it made me nervous because I can't it put in editor in Relation string:
Editor my expression "'M'+cFld" changes in ''M'+cFld'.

I have disjoined characters in this expression that you can perceive what
editor has changed
Editor this expression " 'M' + cFld " changes into ' 'M' + cFld ' what is
not correct syntax and compiler signalizes error

Jozo




"Farid" <faridwatson(a)gmail.com> wrote in message
news:380caf4f-478c-4225-93c8-57f6669b5790(a)t34g2000prm.googlegroups.com...
Try

" " + _CHR(34) + "M" + _CHR(34) + cFld + " " // if trailing blank is
needed?
* DEFINE K_QUOTE_ := _CHR(34)

Maybe?

-- Farid

On Feb 24, 4:34 am, "Jozo" <racun...(a)os.t-com.hr> wrote:
> Hi all !
>
> I use very oft SetSelective like:
>
> SELF:SetSelectiveRelation(oWindow_DETAIL, #cFld)
> .or.
> SELF:SetSelectiveRelation(oWindow_DETAIL,'cFld')
>
> and I know that next expressions are correct and works:
> SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ") or
> SELF:SetSelectiveRelation(oWindow_DETAIL,' "M" + cFld ')
>
> but when I write it in the WED, VO changes it in :
> SELF:SetSelectiveRelation(oWindow_DETAIL,' 'M' + cFld ')
> and, normally, signals error.
>
> Does anybody can to help me, how to write this expression in the editor
> without error:
> Relation string = " 'M' + cFld "
>
> Thanks in advance
> Jozo


From: Jozo on
Geoff,

> You need to read the Help because you have this all wrong. The Help is
> quite detailed and explains the three methods possible:

Although help explains this:
<cRelationBlock> When the relation is specified as a code block, a string
version of the code block can be provided as well; it is returned by the
Relation() method.

it has only 3 examples:

oDBCustomer:SetSelectiveRelation(oDBOrders, {||_FIELD->CustNo},"CustNo")
oDBCustomer:SetSelectiveRelation(oDBOrders, #CustNo)
oDBCustomer:SetSelectiveRelation(oDBOrders, {#LastName,#Initial,#FirstName})

Unfortunately, I like use <cRelationBlock> and I have tested my examples
like:
'cFld1' (works)
'cFld1+cFld2' (works)
'cFld1+Left(cFld,10)' (works)

So, I like use <cRelationBlock> for complex expressions because I "fight"
with code blocks although I don't know what is more complex.
For example the expression 'cFld1+Left(cFld,10)' is complex for me and
passes away in editor but the expression " 'M' + cFld " is not more complex
and doesn't pass away.

> So to answer your question, you cannot expect complex expressions to be
> possible using the WED - it can only do things in terms of fields
> expected. You are better handling such things in a method cal on the

What I can ! I like expect everything, especially a lot of examples, because
the utilization of software depends about it

Regards,

Jozo



"Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
news:eRghn.9616$pv.7428(a)news-server.bigpond.net.au...
> Jozo,
>
> You need to read the Help because you have this all wrong. The Help is
> quite detailed and explains the three methods possible:
>
> String
> Code block
> Array
>
> But in the end (and you should review the SDK on this) they are all
> compiled to a code block so if you provide a string then you MUST provide
> one that can be compiled into a code block. If you have multi field
> relations then the simplest option is the array of symbols. Remember the
> RDD is the one executing the code block so it must have scope that allows
> this.
>
> So to answer your question, you cannot expect complex expressions to be
> possible using the WED - it can only do things in terms of fields
> expected. You are better handling such things in a method cal on the
> class.
>
> Geoff
>
>
>
> "Jozo" <racunalo(a)os.t-com.hr> wrote in message
> news:hm36ck$5s8$1(a)ss408.t-com.hr:
>
>> Hi all !
>>
>> I use very oft SetSelective like:
>>
>> SELF:SetSelectiveRelation(oWindow_DETAIL, #cFld)
>> .or.
>> SELF:SetSelectiveRelation(oWindow_DETAIL,'cFld')
>>
>> and I know that next expressions are correct and works:
>> SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ") or
>> SELF:SetSelectiveRelation(oWindow_DETAIL,' "M" + cFld ')
>>
>> but when I write it in the WED, VO changes it in :
>> SELF:SetSelectiveRelation(oWindow_DETAIL,' 'M' + cFld ')
>> and, normally, signals error.
>>
>> Does anybody can to help me, how to write this expression in the editor
>> without error:
>> Relation string = " 'M' + cFld "
>>
>>
>> Thanks in advance
>> Jozo
>