Page 1 of 1

using object in class predicate

Posted: 17 Dec 2013 9:30
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()).  

My solution of the problem similar to your one

Posted: 27 Dec 2013 12:15
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.