Discussions related to Visual Prolog
hadiranji
Posts: 11
Joined: 7 Dec 2013 15:16

using object in class predicate

Unread post by hadiranji »

hi
i need to define clause with value from edit control but i received error :
"The object member 'edit_ctl' is used in the class predicate"

how can do it ?

Code: Select all

class facts     edge:(string,string,string).   clauses     classInfo(className, classVersion).   edge("A","B",edit_ctl:getText()). edge("A","C",edit1_ctl:getText()).  
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

My solution of the problem similar to your one

Unread post by Ferenc Nagy »

I hope these code fragments help you.
The following code is within the implementation of the class.
The handling of *.frm dialog is usually in the *.pro file.
The facts storing the user input are global, in other word class facts.
I handle the user's selection from a list box this way.

Code: Select all

class facts - draw_options     compose:(purpose, style).   predicates       getSetting:() ->style determ.     clauses getSetting()=Setting :-         Width=width_int:getInteger(),         [Type]=type_lbt:getSelectedItems(),         [Rule]=rule_lbt:getSelectedItems(),         Setting=s(Width,Type,Rule).   predicates     onOkClick : button::clickResponder.   clauses     onOkClick(_Source) = button::noAction:-         Setting=getSetting(),         retractall(compose(apply_for,_)),         assertz(compose(apply_for,Setting)).        
I have more instances the form which can be distinguished by the fact variable.
TIA, Regards,
Frank Nagy
Post Reply