From: Martin on
Details

Works in VO2.8

CLASS CustAreaComboBoxEx INHERIT ComboBoxEx
ACCESS Value CLASS CustAreaComboBoxEx

LOCAL uVal AS USUAL

uVal := SUPER:Value

IF ValType(uVal) == 'N'
RETURN uVal
ENDIF

IF ValType(uVal) == 'C'
IF Left(uVal,5) == 'Route'
RETURN Val(Right(Trim(uVal),2))
ENDIF

RETURN Val(Left(AllTrim(uVal),2))
ENDIF

RETURN SUPER:Value


However it does not work in 2.7, I need to add the following code to the
owning window

#IFDEF _VO28_
#ELSE
IF ocontrol:namesym == #CU_CustAre
oCustRec := SELF:Owner
oCustRec:asCustomer:FIELDPUT(#CU_CustAre,SELF:oDCCU_CustAre:Value)
ENDIF
#ENDIF

Can anyone explain this please?

Thanks

Martin


From: Stephen Quinn on
Martin


> CLASS CustAreaComboBoxEx INHERIT ComboBoxEx
> ACCESS Value CLASS CustAreaComboBoxEx
>
> LOCAL uVal AS USUAL
>
> uVal := SUPER:Value
>
> IF ValType(uVal) == 'N'
> RETURN uVal
> ENDIF
>
> IF ValType(uVal) == 'C'
> IF Left(uVal,5) == 'Route'
> RETURN Val(Right(Trim(uVal),2))
> ENDIF
>
> RETURN Val(Left(AllTrim(uVal),2))
> ENDIF
>
> RETURN SUPER:Value

Why are you calling SUPER twice??
What happens if you don't call SUPER twice??

CYA
Steve


From: Martin on
That bit works - but it just returns the same value again, it should never
even get that far, and in tests it returned the correct values in a
ListBoxSelect method.


"Stephen Quinn" <stevejqNO(a)bigpondSPAM.net.au> wrote in message
news:5j9jn.10751$pv.2629(a)news-server.bigpond.net.au...
> Martin
>
>
>> CLASS CustAreaComboBoxEx INHERIT ComboBoxEx
>> ACCESS Value CLASS CustAreaComboBoxEx
>>
>> LOCAL uVal AS USUAL
>>
>> uVal := SUPER:Value
>>
>> IF ValType(uVal) == 'N'
>> RETURN uVal
>> ENDIF
>>
>> IF ValType(uVal) == 'C'
>> IF Left(uVal,5) == 'Route'
>> RETURN Val(Right(Trim(uVal),2))
>> ENDIF
>>
>> RETURN Val(Left(AllTrim(uVal),2))
>> ENDIF
>>
>> RETURN SUPER:Value
>
> Why are you calling SUPER twice??
> What happens if you don't call SUPER twice??
>
> CYA
> Steve
>
>


From: Geoff Schaller on
Can we explain? Yes of course. The bug is fixed.
What more do you want ? <g>

And calling super twice is absolutely dangerous. Just return uValue.

Geoff



"Martin" <spam(a)spam.spam> wrote in message
news:d68jn.207440$7Q1.175590(a)newsfe14.ams2:

> Details
>
> Works in VO2.8
>
> CLASS CustAreaComboBoxEx INHERIT ComboBoxEx
> ACCESS Value CLASS CustAreaComboBoxEx
>
> LOCAL uVal AS USUAL
>
> uVal := SUPER:Value
>
> IF ValType(uVal) == 'N'
> RETURN uVal
> ENDIF
>
> IF ValType(uVal) == 'C'
> IF Left(uVal,5) == 'Route'
> RETURN Val(Right(Trim(uVal),2))
> ENDIF
>
> RETURN Val(Left(AllTrim(uVal),2))
> ENDIF
>
> RETURN SUPER:Value
>
>
> However it does not work in 2.7, I need to add the following code to the
> owning window
>
> #IFDEF _VO28_
> #ELSE
> IF ocontrol:namesym == #CU_CustAre
> oCustRec := SELF:Owner
> oCustRec:asCustomer:FIELDPUT(#CU_CustAre,SELF:oDCCU_CustAre:Value)
> ENDIF
> #ENDIF
>
> Can anyone explain this please?
>
> Thanks
>
> Martin