Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CmCursor.Addrule help
Message
From
29/10/2004 17:54:52
 
 
To
29/10/2004 16:02:34
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00955943
Message ID:
00955978
Views:
18
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') && You get a cursor reference.

* You can check to ensure that there isn't already a rule of the same name added to the cursor.
IF NOT PEMSTATUS(loBCSSettings, 'RuleBCSSettings', 5)
  WITH loBCSSettings
    .AddObject('oRuleBCSSettings', 'RuleBCSSettings')
    .AddRule(.oRuleBCSSettings)
  ENDWITH
ENDIF 
HTH

Regards,
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform