Page 1 of 1

Help with type differences

Posted: 8 Mar 2018 21:53
by daveplummermd
I am having trouble resolving this error:
The expression has type '() -> ::string* procedure', which is incompatible with the type '::string*'

that points to this code:

Code: Select all

 onPushButton2Click(_Source) = button::defaultAction :-         xx(DB),         List = DB:getallaslist,         listboxnew_ctl:addList(List),         !.
where getallaslist predicate is definesd in interface:

Code: Select all

predicates     addstring : (string) -> integer.     saveitall : ().     consultitall : ().     getallaslist : () -> string*.
with this clause in the *.pro file

Code: Select all

    getallaslist() = List :-         List = [ X || placed(X, _, _) ],         !.        

It objects to equating "string* procedure" to and string*.
I have tried variious "convert" and "convertToStringList" w/o success.
Can you advise

Thanks in advance.
Dave Plummer

Re: Help with type differences

Posted: 9 Mar 2018 9:54
by Thomas Linder Puls
When you write:

Code: Select all

List = DB:getallaslist,
List will be a predicate that can return a list. You will have to invoke the predicate (to an empty set of arguments '()') to obtain the list:

Code: Select all

List = DB:getallaslist(),

Re: Help with type differences

Posted: 9 Mar 2018 14:49
by daveplummermd
Of coarse!
thanks you sir.

dp