Hi Mike:
>I am writing a non-visual program in which I want to make use of the
>custom rules that I've setup. This is what I have so far for the instantiation:
>
>loCDE = CREATEOBJECT( 'cmDataEnvironmentCustom' )
>loCDE.addcursor( 'BCSSettings', 'curBCSSettings' )
>loBCSSettings = loCDE.getcursor( 'BCSSettings' )
>loBCSSettings.addrule( 'RuleBCSSettings' )
The following code should help. The trick is to add the rule class as an object to the cursor object itself. The cursor object then becomes the rule class's "parent". Then simply call the cursor object's AddRule method and that in turn adds the rule to the cursor object's aRule collection.
loCde = CREATEOBJECT('cmDataEnvironmentCustom')
loBCSSettings = loCDE.addCursor('BCSSettings', 'curBCSSettings')
IF NOT PEMSTATUS(loBCSSettings, 'RuleBCSSettings', 5)
WITH loBCSSettings
.AddObject('oRuleBCSSettings', 'RuleBCSSettings')
.AddRule(.oRuleBCSSettings)
ENDWITH
ENDIF
HTH
Regards,
-=Gary