JavaScript Editor js editor     Web development 



Main Page

Creates, releases, or modifies DDE service names and settings.

DDESetService(cServiceName, cOption [, cDataFormat | lExpression])

Parameters

cServiceName


Specifies the service name to create, release, modify, or return information about.
cOption


Specifies to create, release, or modify a service name or to return information about a service name. The following table lists the options you can specify with cOption, the default values for the options and a description of each option.

Option Default value Description

DEFINE

–

Creates a new service name.

RELEASE

–

Releases an existing service name.

ADVISE

.F.

Enables or disables client notification of changes to item names.

EXECUTE

.F.

Enables or disables command execution.

POKE

.F.

Enables or disables client pokes to the service.

REQUEST

.T.

Enables or disables requests to the service name.

FORMATS

CF_TEXT

Specifies supported data formats.

DEFINE


Creates a new service name. For example, the following command creates the service name myservice:
В Copy Code
glNewService = DDESetService('myservice', 'DEFINE')
RELEASE


Releases an existing service name to free up system resources. When a service name is released, all of the service's topic names are also released. The following command releases the service name created in the previous example:
В Copy Code
glRelease = DDESetService('myservice', 'RELEASE')
To release the default Visual FoxPro service, issue this command:
В Copy Code
glRelFox = DDESetService('FoxPro', 'RELEASE')
ADVISE


Specifies whether a client is notified when data changes in an item name or specifies to return the current advise status for a service name. Refer to DDEAdvise(В ) for additional information about advising clients. To enable client notification, specify true (.T.) for lExpression. Specifying false (.F.) for lExpression disables client notification. To return the current client notification status for the service name, omit lExpression. DDESetService(В ) returns true if client notification is enabled for the service name; it returns false if client notification is disabled.
EXECUTE


Allows you to enable or disable command execution requests to a service name or to determine the current execute status for a service name. To enable client requests to execute a command, specify true (.T.) for lExpression. Specifying false (.F.) for lExpression disables client requests to execute a command. .F. is the default value. To return the current command execution status for the service name, omit lExpression. DDESetService(В ) returns true if client command execution requests are enabled for the service name; otherwise, it returns false. The following commands enable command execution and disable data requests from client applications for the service name myservice. The current command execution status for myservice is then displayed:
В Copy Code
glExecute = DDESetService('myservice', 'EXECUTE', .T.)
glRequest = DDESetService('myservice', 'REQUEST', .F.)
? DDESetService('myservice', 'EXECUTE')
POKE


Allows you to enable or disable poke requests to the service name. You can also determine the current poke status for a service name. Refer to DDEPoke(В ) for additional information about poking data to a server or a client. To enable client poke requests, specify true (.T.) for lExpression. Specifying false (.F.) for lExpression disables client poke requests. .F. is the default value. To return the current poke status for the service name, omit lExpression. DDESetService(В ) returns true if poke requests are enabled for a service name; it returns false if poke requests are disabled.
REQUEST


Use REQUEST to enable or disable client requests to a service name or to return the current request status for the service name. To enable client requests to the service name, specify true (.T.) for lExpression. Specifying false (.F.) disables client requests to the service name. True (.T.) is the default value. To return the current request status for a service name, omit lExpression. DDESetService(В ) returns true if client requests are enabled for the service name; it returns false if client requests are disabled. The following commands disable requests from client applications to the service name myservice and display the current request status for myservice:
В Copy Code
glRequest = DDESetService('myservice', 'REQUEST', .F.)
? DDESetService('myservice', 'REQUEST')
FORMATS [ cDataFormat]


Specifies the data formats supported by the service name. Server requests for formats not specified with cDataFormat are rejected. When specifying data formats, include a list of the supported formats separated by commas. For example:
В Copy Code
=DDESetService('myservice', 'FORMATS', 'CF_TEXT, CF_SYLK')
If you omit cDataFormat, only the CF_TEXT format is supported.
lExpression


Specifies the state of the REQUEST, EXECUTE, POKE, or ADVISE options. Specify true (.T.) for lExpression to enable the option or false (.F.) to disable it.

Return Value

Logical

Remarks

Visual FoxPro can act as a dynamic data exchange (DDE) server to send data to client Microsoft Windows-based applications. DDESetService(В ) is used to create, release, or modify service names and settings in Visual FoxPro. Each service name can have a set of topic names created with DDESetTopic(В ). Client applications request data from DDE topic names.

DDESetService(В ) returns true (.T.) if the service name is successfully created, released, or modified. If the service name cannot be created, released, or modified, DDESetService(В ) returns false (.F.).

DDESetService(В ) can also be used to return information about a service name. Visual FoxPro has the default service name FoxPro. The Visual FoxPro service name has one topic name called System. The following table lists all the item names supported by the System topic.

Item name Item

Topics

A list of available topic names

Formats

A list of supported formats

Status

Busy or Ready

SysItems

A list of item names

You can use DDESetTopic(В ) to modify the FoxPro service name or to release it. For information about manipulating Visual FoxPro service names, see the DDESetTopic(В ) options.

See Also



JavaScript Editor js editor     Web development