RE: DDE
"Savard, Greg" <[email protected]> Thu, 1 Jun 2006 13:18:47 -0400
| Newsgroups | gmane.comp.lang.4gl.fourjs.user |
|---|---|
| Message-ID | <[email protected]> |
Have a look at the Genero documentation. There's a section on DDE in the BDL manual which includes the following example program. The example should give you the basics you need for getting data into and out of Excel.
Example
dde_example.per
01 DATABASE formonly
02 SCREEN
03 {
04 Value to be given to top-left corner :
05
[f00 ]
06 Value found on top-left corner :
07 [f01 ]
08 }
09 ATTRIBUTES
10 f00 = formonly.val;
11 f01 = formonly.rval, NOENTRY;
dde_example.4gl
01 MAIN
02 -- Excel must be open with "File1.xls"
03 CONSTANT file = "File1.xls"
04 CONSTANT prog = "EXCEL"
05 DEFINE val, rval STRING
06 DEFINE res INTEGER
07 OPEN WINDOW w1 AT 1,1 WITH FORM "dde_example.per"
08 INPUT BY NAME val
09 CALL ui.Interface.frontCall("WINDDE","DDEConnect", [prog,file], [res] )
10 CALL checkError(res)
11 CALL ui.Interface.frontCall("WINDDE","DDEPoke", [prog,file,"R1C1",val], [res] );
12 CALL checkError(res)
13 CALL ui.Interface.frontCall("WINDDE","DDEPeek", [prog,file,"R1C1"], [res,rval] );
14 CALL checkError(res)
15 DISPLAY BY NAME rval
16 INPUT BY NAME val WITHOUT DEFAULTS
17 CALL ui.Interface.frontCall("WINDDE","DDEExecute", [prog,file,"[save]"], [res] );
18 CALL checkError(res)
19 CALL ui.Interface.frontCall("WINDDE","DDEFinish", [prog,file], [res] );
20 CALL checkError(res)
21 CALL ui.Interface.frontCall("WINDDE","DDEFinishAll", [], [res] );
22 CALL checkError(res)
23 CLOSE WINDOW w1
24 END MAIN
25
26 FUNCTION checkError(res)
27 DEFINE res INTEGER
28 DEFINE mess STRING
29 IF res THEN RETURN END IF
30 DISPLAY "DDE Error:"
31 CALL ui.Interface.frontCall("WINDDE","DDEError",[],[mess]);
32 DISPLAY mess
33 CALL ui.Interface.frontCall("WINDDE","DDEFinishAll", [], [res] );
34 DISPLAY "Exit with DDE Error."
35 EXIT PROGRAM (-1)
36 END FUNCTION
Online Documentation: http://www.fourjs.com/exclude/en/tmpl4/blocs/files/fjs-fgl-1.33-manual.pdf
DDE starts on page 337.
Regards,
Greg
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of John Borders
Sent: Thursday, June 01, 2006 12:46 PM
To: [email protected]
Subject: RE: [fourjs-users] DDE
Sir,
I agree, but cannot find any information on using DDE either.
For example, we use a Genero front-end to a 3rd party database.
We have literally thousands of entries to make, all calculated in a spreadsheet; however there is no way we can find to automate and upload those entries one-at-a-time into Genero - so we enter them by hand. I cannot use an SQL upload command because of triggers and processes within the database.
I have also tried to use Windows Scripts, but apparently they cannot grab Genero, either - it does not see it as an object.
Please let me know if you discover anything.
Thank you
From: [email protected] [mailto:[email protected]] On Behalf Of Neu, Gerhard
Sent: Thursday, June 01, 2006 8:37 AM
To: [email protected]
Subject: [fourjs-users] DDE
Hello,
Since we intend to combine Windows-Office-products
(esp. Excel and Word) with FourJs over DDE much more,
I was looking for documentation - but there is hardly any.
What we already have are several basic commands
and some basic examples (open Excel/Word,
poke/peek some data or call a macro),
but it is a lot of work to find out functions in detail.
I cannot imagine that every FourJs - programmer
has to work that out for himself.
Why is there no better detailed explanation for DDE ?
We think that we and every other developer
could do a lot more with it in such a way as to enable us/them
to meet the growing demands of our customers.
We think DDE is a big plus for FourJs/Genero.
Why not use it better ?
We would be pleased if anyone helps us,
thanks in advance