[eclipse-clp-users] Getting data back to C++ from Eclipse using yield/2

From: <Archana.Dixit_at_...123...>
Date: Mon, 9 Jun 2008 17:54:09 +0530


Hello,



I am passing data from C++ to the Eclipse end and trying to get it back
using yield/2 method as follows:

Here, I have to pass the string "ABC" to the Eclipse and get the
Result(value = 3)  back to the C++ and print it.

Can you suggest me how can it be done?





Eclipse code:



:- module(module3).

:- export test/1.



test(Arg1):-



Result is 3,



yield(Result,Arg1).



C++ code :



EC_ref Result;

EC_word W="ABC";



//compile the module1.pl file import test/1 from module1



post_goal(term(EC_functor("test",1), W));



if(EC_resume()==EC_yield){    

           

            if(EC_resume(W,Result)==EC_yield)

            {    

                  post_goal(term(EC_functor("writeln",1),Result));     

                  cout << "yield done" ;

            }

}





Thanks and Regards,

Archana.



This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.
Received on Mon Jun 09 2008 - 05:24:20 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST