Copyright (1997-2013) EDMGROUP Pty Ltd - EZY Prolog Reference

 

 DDE sample program

main page

 

 

/****** EZY PROLOG. Copyright (C) 2002 EDMGROUP (Australia)

Written by: Serguei Penkov

EDMGROUP (Australia)

spenkov@ozemail.com.au

Notes:

this program establishes DDE messages handler

Testing rules - use any development environment, which supports DDE:

DDE Connection

DDENAME = EZY_PROLOG

DDETOPIC = System

DDE Request:

DDETOPIC = System

DDEITEM = dde_item

List of supported DDE functions:

dde_event_handler(CLAUSE)

dde_return(DATA)

dde_connect(SERVICE,TOPIC,DDE_CONV)

dde_disconnect(DDE_CONV)

dde_execute(DDE_CONV,COMMAND,TIMEOUT)

dde_request(DDE_CONV,ITEM,TIMEOUT,RESULT),

*******/

predicates

determ prolog_main

determ my_ezy_dde_handler(DDE_EVENT,STRING RESULT)

clauses

my_ezy_dde_handler(request( SERVICE , ITEM ),REPLY):-

SERVICE = "System" ,

ITEM = "dde_item" ,

write ( "EZY Prolog: request for data:\n" ),

write ( "SERVICE=" , SERVICE , ", ITEM=" , ITEM , "\n" ),

format(REPLY,"data returned from EZY PROLOG\n%" ,ITEM),

! .

my_ezy_dde_handler( DDE_EVENT,"" ):-

write ( "EZY Prolog DDE handler - " , DDE_EVENT ),

nl .

prolog_main():-

dde_event_handler ( "my_ezy_dde_handler" ),

write ( "EZY Prolog DDE Laboratory\nDDE Event handler installed - my_ezy_dde_handler\n" ).

 

 

Copyright 1997-2013 EDMGROUP (Australia)