From: Stephen Quinn on
Jozo

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

I think your missing a comma in the expression as the
2nd parameter should be a CodeBlock/Array of Symbols/Symbol
and the
3rd parameter a string

SELF:SetSelectiveRelation(oWindow_DETAIL,,' 'M' + cFld ')

Check the help, I'm remembering this from fading/failing memory.

CYA
Steve


From: Geoff Schaller on
Jozo.

I empathise but I don't sympathise <g>.

Look, there is only so much an editor can do. It has to make assumptions
and when it is pure field names it is easy. When involves expressions,
it has to ignore you.

My advice would be to code these things manually in a method and not let
the editor decide for you how the code block should look. And please
review the SDK to see how the method works internally. Everything is
compiled into a code block - ALL THREE VERSIONS - so you still need to
understand the code block mechanism and how the final resulting
expression will work.

Cheers,

Geoff




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

> 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
>
> >

From: Jozo on
Steve,
thanks on your suggestion, but whatsoever you write in editor, VO changes
double quote in single quote (and places in Init method):
for example: " 'M' + cFld " VO changes to ' 'M' + cFld ' what results syntax
error.

For this reason I omitted Relation string in editor and I put this code in
PostInit:
SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ")
what is syntax correct, and, what is most important, SetSelectiveRelation in
this example works correct, gets filtered data

I only ask me and others people, why VO have do that and how to write in
editor that VO doesn't change that.

> I think your missing a comma in the expression as the
>2nd parameter should be a CodeBlock/Array of Symbols/Symbol
> and the 3rd parameter a string
> SELF:SetSelectiveRelation(oWindow_DETAIL,,' 'M' + cFld ')

You are right according to help and syntax but this example doesn't work.
SetSelectiveRelation doesn't get selected (filtered) data. It gets all data

My example gets filtered data although I put expression in first parameter
(<cbRelationBlock>)
SELF:SetSelectiveRelation(oWindow_DETAIL," 'M' + cFld ")


Jozo




"Stephen Quinn" <stevejqNO(a)bigpondSPAM.net.au> wrote in message
news:F0ihn.9631$pv.5854(a)news-server.bigpond.net.au...
> Jozo
>
>> but when I write it in the WED, VO changes it in :
>> SELF:SetSelectiveRelation(oWindow_DETAIL,' 'M' + cFld ')
>> and, normally, signals error.
>
> I think your missing a comma in the expression as the
> 2nd parameter should be a CodeBlock/Array of Symbols/Symbol
> and the
> 3rd parameter a string
>
> SELF:SetSelectiveRelation(oWindow_DETAIL,,' 'M' + cFld ')
>
> Check the help, I'm remembering this from fading/failing memory.
>
> CYA
> Steve
>


From: Stephen Quinn on
Jozo

Then use a codebock instead of the string, all that's required is
{|| 'M' + cFld }

> thanks on your suggestion, but whatsoever you write in editor, VO changes
> double quote in single quote (and places in Init method):
> for example: " 'M' + cFld " VO changes to ' 'M' + cFld ' what results
> syntax error.
Why do you need the *extra* double quotes??

> I only ask me and others people, why VO have do that and how to write in
> editor that VO doesn't change that.

There are 3 characters ('',"",[]) available to quote strings
Try using '[]' square brackets instead of double quotes
Eg
[ 'M' + cFld ]

CYA
Steve