Discussions related to Visual Prolog
Michel
Posts: 16
Joined: 8 Nov 2025 17:17

Question about objects

Post by Michel »

One last question ( I begin to LIKE VP ! ), it's probably silly or very simple and I asked it some time ago but I don't succeed. I don't have any more problem to declare a predicates visible from another ****.pro pro and execute it, aka :

in showRemedes.cl

Code: Select all

class showRemedes : showRemedes     open core   predicates     display : (window Parent) -> showRemedes Form.     theRemedies2 : (string*).   constructors     new : (window Parent).   end class showRemedes
in showRemedies.pro

Code: Select all

    theRemedies2(List) :- .../...         stdio::write("in theRemedies2 : ", List), % <- this line is OK         remedesBox_ctl:addList(List). <--- Here, I get The object member 'remedesBox_ctl' is used in the class predicate   % This code is maintained automatically, do not update it manually.   facts     remedesBox_ctl : listBox.   predicates     generatedInitialize : (). clauses     generatedInitialize() :-  .../...         remedesBox_ctl := listBox::new(This),         remedesBox_ctl:setRect(vpiDomains::rct(8, 31, 210, 217)),         remedesBox_ctl:setFont(vpi::fontCreateByName("Verdana", 11)),         remedesBox_ctl:setLabel("test...."),  .../... % end of automatic code
I presume I have to declare something in the "include.file".... but what ???

As I said, I am new to OOP and even if I begin to think about such a programmation, I don't have lost my "C" (bad) habits and it stays a new world but VP is such a fantastic development tool, I make all my possible to use it successfully.

Best regards, Michel