O$ - Object Method Lines notation

Doug Kuyvenhoven omnisdev at vencor.ca
Sat May 24 05:08:45 EDT 2008


Mark Phillips taught me a long time ago at an Omnis conference about  
using $findname. I use it in my code to make it '$' resilient.

It sometimes takes a few extra steps... but solves the problem of code  
breaking because of an unexpected $-sign in the notation string.

Do $libs.[iLibList.C1].$classes.[lClassName].$objs.[lObjName].$methods. 
$findname(lMethodID) Returns rMethod
If isnull(rMethod)
	OK message { Oops. Method not found }
Else
	Do rMethod.$methodlines.$makelist($ref.$ident,$ref.$text) Returns  
MethodLinesList
	; continue processing
End if

$findname(iMethodID) works whether or not the iMethodID string begins  
with a $-sign.

For more info Google -> studiotips $findname

HTH


Doug Kuyvenhoven
Vencor Software - www.vencor.ca

On 24-May-08, at 4:32 AM, Peter van Rooij wrote:

> Hello Chris
>
> This works for me:
>
> Calculate lMethodLinesList as $libs.[iLibList.C1].$classes. 
> [lClassName].$objs.[lObjName].$methods.[lMethodID].$methodlines. 
> $makelist($ref.$ident,$ref.$text)
>
>
> Maybe the problem for you lies in the fact that some methods start  
> with a $-sign.
> You would have to use the .//$methodName//. notation, because  
> otherwise the notation fails because omnis will try to evaluate it  
> as an attribute, or use the $ident, as I did.
>
> HTH
>
> Peter
>
>
> On 23 mei 2008, at 17:38, Chris Peck wrote:
>
>> Hi All,
>>
>> I'm having an issue getting the method lines/text to return to  
>> either a list
>> or a char var using notation.  I have a list of the object's items  
>> (e.g.
>> $event, $control) and can verify that the method lines are there  
>> via the
>> notation inspector (which is not helping much here).  I can see  
>> that under
>> the $methodlines level are the individual lines (labeled '1', '2',  
>> '3',
>> etc), but I'm unsure if they are stored individually or en masse,  
>> as Classic
>> I believe does it.  I've used the following constructs to try to  
>> get at
>> them, but all of them fail.  The first two are variations on the  
>> same code,
>> and the 3rd is just trying another approach since nothing else is  
>> working
>> for me.  I've tried multiple variations of all of the code below too.
>>
>>
>>
>> Calculate #F as
>> $root.$libs.[cvTargetLibInternalName].$windows.[cvClassName].$objs. 
>> [cvMethod
>> Name].$methods.[lvObjectItemName].$methodlines. 
>> $appendlist(lvMethodLinesList
>> ,$ref.$ident)
>>
>>
>>
>> Calculate #F as
>> $root.$libs.[cvTargetLibInternalName].$windows.[cvClassName].$objs. 
>> [cvMethod
>> Name].$methods.$event.$methodlines.$appendlist(lvMethodLinesList, 
>> $ref.$ident
>> )
>>
>>
>>
>> (I receive the following error for both notation lines above:   
>> Problem with
>> notation
>>
>> $root.$libs.[cvTargetLibInternalName].$windows.[cvClassName].$objs. 
>> [cvMethod
>> Name].$methods.[lvObjectItemName] or
>> $event.$methodlines.$appendlist(lvMethodLinesList,$ref.$ident) When
>> evaluating $event)
>>
>>
>>
>> Calculate cvMethodText as
>> $root.$libs.[cvTargetLibInternalName].$windows.[cvClassName].$objs. 
>> [cvMethod
>> Name].$methods.$event.$methodlines.$text
>>
>>
>>
>> The error I am getting for this one is: Problem with notation
>>
>> $root.$libs.[cvTargetLibInternalName].$windows.[cvClassName].$objs. 
>> [cvMethod
>> Name].$methods.$event.$methodlines.$text When evaluating $event
>>
>> This is not a recognized attribute for the parent item
>>
>>
>>
>> Which tells me there is a level in-between $methodlines and $text,  
>> as I
>> thought there was.  I can't figure out what I'm missing here.  I  
>> have also
>> tried using $ref.$order, $ref.$name, $ref.$text for the $appendlist
>> arguments, all of which all give me the same error message, which  
>> seems to
>> be stopping me at the $event level.  Any notation gurus have a  
>> suggestion or
>> solution?
>>
>>
>>
>> Chris Peck
>>
>> Software Developer
>>
>> Word Master, Inc.
>>



More information about the omnisdev-en mailing list