How to declare and to pass Control name between clauses

Discussions related to Visual Prolog
User avatar
abdelrahman
VIP Member
Posts: 65
Joined: 13 Sep 2009 6:23

How to declare and to pass Control name between clauses

Unread post by abdelrahman » 14 Mar 2013 10:39

My Dear Friends ,

I wish if i can do something like this , how to declare control Name as object

Code: Select all

predicates      check_value:(string Value ,string Ctrl_Name)procedure(i,i). clauses      check_value(String,EditControl_name):-           string::isWhiteSpace(String),          name :=EditControl_name ,          name : setVisible(false),!.        check_value(_String,EditControl_name):-            name :=EditControl_name,            name :setVisible(true).

dominique f pannier
VIP Member
Posts: 98
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier » 14 Mar 2013 16:23

Hi,
This code will not work.
If you write :

Code: Select all

check_value(_String,EditControl_name):-     name :=EditControl_name,     name :setVisible(true).
it means that the fact-variable name stores the object EditControl_name. Then when you declare this fact-variable, its type is editcontrol :

Code: Select all

 facts   name : editcontrol := erroneous.
it means now that the variable EditControl_name stores an editControl object.
Then you have to declare your predicate with the editcontrol type for the variable EditControl_name instead of string :

Code: Select all

predicates  check_value:(string Value, editcontrol  EditControl_Name)procedure(i,i).
Regards
Dominique Pannier

User avatar
abdelrahman
VIP Member
Posts: 65
Joined: 13 Sep 2009 6:23

Thank you My Dear Dominique

Unread post by abdelrahman » 15 Mar 2013 9:13

MY Dear Dominique ,
now it is working .
Thank you Very much for your Explanation .
Abdelrahman

Post Reply