//
//	Xanthus
//	Copyright (c) 1992, 1993, 1994 Xanthus International AB.  
//	All rights reserved. 
//


#import <math.h>

#import "XQ_UserFunction.h"


@interface current_cell_demo:XQ_UserFunction
@end




@implementation current_cell_demo

+ (const char *)functionName;
{
	return "current_cell_demo";
}

+ (const char *)categoryName;
{
	return "external_demos";
}

- (const char *)argumentNameNo:(int)anIndex;
{
	return "<should never be seen>";
}

- (int)minArg;
{
	return 0;
}

- (int)maxArg;
{
	return 0;
}

- (int)formalCount;
{
	return 0;
}

- (int)argType:(int)index;
{
	return XQ_EVAL;
}

- (void *)runFunction: (void *)frame;
{
	int row = 0, col = 0;
	
    // Get the indeces of the current cell
    
    	XQ_GetCurrentCell(frame, &row, &col);
	
    // Since Questor uses 0-based references 
    // we add 1 to the row and the col
    	
	row++;
	col++;
	
    // Return the sum
    
	return XQ_CreateDoubleValue(frame, row + col);
}

@end
