Revision 1108 trunk/src/nh99/spcomm.cpp

spcomm.cpp (revision 1108)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
#include <windows.h>
8 8
#include <windows.h>
......
18 18

  
19 19

  
20 20
DWORD DDEspclient::idInst=0;
21
DWORD DDEspclient::sleeptime=0; 
21
DWORD DDEspclient::sleeptime=0;
22 22
HCONV DDEspclient::cstatus=NULL;
23 23
UINT  DDEspclient::status=0;
24 24

  
......
41 41

  
42 42
DDEspclient::DDEspclient(DWORD _sleeptime)
43 43
{
44
  status=DdeInitialize(&idInst, mycallback,CBF_FAIL_EXECUTES | 
44
  status=DdeInitialize(&idInst, mycallback,CBF_FAIL_EXECUTES |
45 45
    CBF_SKIP_ALLNOTIFICATIONS,0);
46 46
  HSZ  hszService=DdeCreateStringHandle(idInst,"SPLUS", CP_WINANSI);
47 47
  HSZ  hszTopic=DdeCreateStringHandle(idInst,"SCommand", CP_WINANSI);
......
71 71
  check_when_finished();
72 72
}
73 73

  
74
void SPsend(const dvector& x, const adstring& name) 
74
void SPsend(const dvector& x, const adstring& name)
75 75
{
76 76
  ofstream ofs("c:\\tmp.spl");
77 77

  
......
87 87
void SPsend(const named_dmatrix& _x)
88 88
{
89 89
  ADUNCONST(named_dmatrix,x)
90
  SPsend(x,adstring(x.label().mychar())); 
90
  SPsend(x,adstring(x.label().mychar()));
91 91
}
92 92

  
93 93

  
94
void SPsend(const named_dvar_matrix& _x) 
94
void SPsend(const named_dvar_matrix& _x)
95 95
{
96
  ADUNCONST(named_dvar_matrix,x) 
97
  SPsend(value(x),adstring(x.label().mychar())); 
96
  ADUNCONST(named_dvar_matrix,x)
97
  SPsend(value(x),adstring(x.label().mychar()));
98 98
}
99 99

  
100 100
void SPsend(const named_dvariable& _x)
101 101
{
102 102
  ADUNCONST(named_dvariable,x)
103
  SPsend(value(x),adstring(x.label().mychar())); 
103
  SPsend(value(x),adstring(x.label().mychar()));
104 104
}
105 105

  
106 106

  
107
void SPsend(const dmatrix& x, const adstring& name) 
107
void SPsend(const dmatrix& x, const adstring& name)
108 108
{
109 109
  int i1=x.rowmin();
110 110
  int ncol=x(i1).indexmax()-x(i1).indexmin()+1;
......
120 120
  check_when_finished();
121 121
}
122 122

  
123
void SPreceive(const dvector& _x, const adstring& name) 
123
void SPreceive(const dvector& _x, const adstring& name)
124 124
{
125
  ADUNCONST(dvector,x) 
125
  ADUNCONST(dvector,x)
126 126

  
127 127
  //adstring command = name + adstring(" <- scan(\"c:\\\\tmp.spl\")");
128 128
  // tell splus to send the size of the vector
......
145 145
    open_the_file_when_finished(pifs,waitflag,numwaits);
146 146
  }
147 147
  while (waitflag && numwaits<5);
148
  
148

  
149 149
  if (pifs && !(!(*pifs)) )
150 150
  {
151 151
    int n;
152 152
    (*pifs) >> n;
153
     
154
    
153

  
155 154
    // check to see if this object is allocated;
156 155
    if (!x)
157 156
    {
......
182 181
    pifs=NULL;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff