Skip to content

Commit 301cf61

Browse files
committed
getting compiling
1 parent c1b1991 commit 301cf61

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

wrap/wrapxloper.d

+25-12
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import core.stdc.wchar_ : wcslen;
4040
import core.stdc.wctype:towlower;
4141
import std.format;
4242

43-
43+
/+
4444
4545
/**
4646
Syntax of the Register Command:
@@ -124,7 +124,7 @@ struct xllCategory(string _name)
124124
xllFunctionHelp!"returns the hash of arguments",xllArgumentHelp!"number 1,2..29 are 1 to 29 arguments to process",
125125
xllThreadSafe!false,xllMacro!false, xllAllowAbort!false,xllVolatile!false,xllDisableFunctionWizard!false,
126126
xlldisableReplaceCalc!false)
127-
127+
+/
128128

129129
/**
130130
To do:
@@ -145,6 +145,7 @@ struct ExcelResult(T)
145145
enum ExcelReturnStatus
146146
{
147147
success,
148+
missing,
148149
wrongType,
149150
wrongShape,
150151
excelError,
@@ -159,23 +160,23 @@ if (is(T==Variant[][]) || (is(T==double[][])) || is(T==double[]))
159160
ExcelResult!T ret;
160161
long i; // Row and column counters for arrays
161162
LPXLOPER12 px; // Pointer into array
162-
ret.suucess=true;
163+
ret.success=true;
163164
ret.status=ExcelReturnStatus.success;
164165

165166
switch (pxArg.xltype)
166167
{
167168
case xltypeMissing:
168-
break;
169+
return ExcelResult(false,ExcelReturnStatus.missing);
169170

170171
case xltypeNum:
171-
static if is(T==double[])
172-
ret=[pxArg.val.num];
172+
static if (is(T==double[]))
173+
return ExcelResult(true,ExcelReturnStatus.success,[pxArg.val.num]);
173174
else
174-
ret=[[pxArg.val.num]];
175+
return ExcelResult(true,ExcelReturnStatus.success,[[pxArg.val.num]]);
175176
break;
176177

177178
case xltypeStr:
178-
static if(is(T==(double[]))
179+
static if(is(T==(double[])))
179180
return ExcelDoubleResultVector(false,ExcelReturnStatus.wrongType,[double.nan]);
180181
else static if(is(T==double[][]))
181182
return ExcelDoubleResultMatrix(false,ExcelReturnStatus.wrongType,[[double.nan]]);
@@ -244,13 +245,17 @@ if (is(T==Variant[][]) || (is(T==double[][])) || is(T==double[]))
244245
// if an error store in error //
245246
case xltypeErr::
246247
status=ExcelReturnStatus.excelError;
247-
if(is(T==Variant[][])||is(T==double[][])
248+
static if ((is(T==Variant[][]))||(is(T==double[][])))
249+
{
248250
ret[i][j]=px.val.err;
251+
}
249252
else // double[]
253+
{
250254
if (!flipped)
251255
ret[i]=px.val.err;
252256
else
253257
ret[j]=px.val.err;
258+
}
254259
break;
255260

256261
case xltypeNil:
@@ -295,6 +300,14 @@ if (is(T==Variant[][]) || (is(T==double[][])) || is(T==double[]))
295300
}
296301

297302

303+
LPXLOPER12 makeXLOPER12(double arg)
304+
{
305+
LPXLOPER12 lpx;
306+
lpx=cast(LPXLOPER12) excelCallPool.allocate(XLOPER12.sizeof);
307+
lpx.xltype=xltypeNum;
308+
lpx.val.num=arg;
309+
return lpx;
310+
}
298311
// need to have allocator!
299312
LPXLOPER12 makeXLOPER12(Flag!"autoFree" autoFree=Flag.autoFree.No)(string arg)
300313
{
@@ -322,7 +335,7 @@ LPXLOPER12 makeXLOPER12(Flag!"autoFree" autoFree=Flag.autoFree.No)(Variant[][] a
322335
}
323336
auto numCols=arg[0].length;
324337
foreach(row;arg[1..$])
325-
enforce(row.length==numCols, new Exception("makeXLOPER12: arg must be rectangular");
338+
enforce(row.length==numCols, new Exception("makeXLOPER12: arg must be rectangular"));
326339

327340
auto xlValuesLength=numRows*numCols;
328341
XLOPER12* ret=allocXLOPER12!autoFree(1);
@@ -542,10 +555,10 @@ string makeMultiArgWrap(string wrapperName, int numArgs)
542555
";
543556
return ret;
544557
}
545-
558+
/+
546559
mixin!makeMultiArgWrap("multiArgWrap30",30);
547560
multiArgWrap30(&simpleMulti);
548-
561+
+/
549562
LPXLOPER12 simpleMulti(LPXLOPER12[] args)
550563
{
551564
Variant[][][] niceArgs;

0 commit comments

Comments
 (0)