Re: [eclipse-clp-users] Getting data back to C++ from Eclipseusingyield/2

From: Wit Jakuczun <wit.jakuczun_at_...6...>
Date: Mon, 9 Jun 2008 15:40:14 +0200
2008/6/9  <Archana.Dixit_at_...123...>:
>
>
> Well,
>
> We have to pass some data to Eclipse and get it back satisfying some
> constraints and then process it.
> Can you suggest me what are the other options to do so?
So going back to you example, you would like to have a
predicate that accepts a string and return a number:
test(Arg1, Result):-
   Result is 3.

You call this predicate using such construction:
EC_ref Result;

post_goal(term(EC_functor("test",1),EC_word("ABC"), Result));

if ( EC_resume() == EC_succeed)
{
    post_goal(term(EC_functor("writeln",1),Result));
    long result;
    EC_word(Result).is_long(&result);
    std:cout << result;
}



Best regards
-- 
[ Wit Jakuczun  w.jakuczun_at_...116... ]
[ WLOG Solutions http://wlogsolutions.com   ]
Received on Mon Jun 09 2008 - 06:40:18 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST