WWRequest()
- Last UpdatedJul 22, 2024
- 2 minute read
Using the DDE protocol, makes a one-time request for a value from a particular application, topic, and item and returns the status.
Category
WWDDE
Syntax
Status = WWRequest( Application, Topic, Item, Attribute );
Parameters
Application
The application from which you want to request data. Actual string or a string attribute.
Topic
The topic within the application. Actual string or a string attribute.
Item
The item within the topic. Actual string or a string attribute.
Attribute
A string attribute, enclosed in quotation marks, that contains the requested value from the application, topic, and item. Actual string or a string attribute.
Return value
Status is an integer attribute to which 1, -1, or 0 is written. The WWRequest() function returns 1 if the application is running, the topic and item exist, and the value was returned successfully. It returns 0 if the application is busy, and -1 if there is an error.
Remarks
Note: The three WWDDE functions Execute(), Poke() and Request() exist for legacy purposes.
The DDE value in the particular application, topic, and item is returned into Attribute.
The value is returned as a string into a string attribute. If the value is a number, you can then convert it using the StringToIntg() or StringToReal() functions.
Important: Never do the following when using WWRequest() in synchronous scripts:
1. Loop scripts (call them over and over).
2. Call several of scripts in a row and in the same script.
3. Use scripts to call a lengthy task in another DDE application.
All three actions can be done in asynchronous scripts.
Example
The following statement requests a value from an Excel spreadsheet cell and converts the resulting string into a value:
WWRequest("excel","[Book1.xls]sheet1","r1c1",Result);
Value=StringToReal(Result);