Astrocloud
Technical User
- May 29, 2007
- 13
/*My problem (of late) is that I am creating commands in C++ that will be called from sicstus prolog.
Basically I am creating a toolset that will be called from prolog. There is a sicstus compiler for this -so I won't bore you with the details.
The problem I have is that every tool will run as an independent procedure. Which means that there is no main. However, there are variables which need to be passed between functions. I've created a class and class functions to hold them.*/
class myItems {
private:
long cost;
long maxCost[100];
public:
myItems(void);
void play_with_cost();
//etc
}
void myItems:lay_with_cost() {
cost =12;
maxCost[12] = 0; //or whatever
}
/*The problem is (and this is conceptual): that there is no instance of myItems when it comes to acting on:
Thus the new tool:*/
int runPlaywithCosts(int beerpong, long foo) {
myItems:lay_with_cost()
//coding or more blah blah here...
return(SP_SUCCESS); //this statement is necessary for building tool
/*Can I make a global instance of a class? Should I?*/
/*Many thanks*/
/*Eric*/
Basically I am creating a toolset that will be called from prolog. There is a sicstus compiler for this -so I won't bore you with the details.
The problem I have is that every tool will run as an independent procedure. Which means that there is no main. However, there are variables which need to be passed between functions. I've created a class and class functions to hold them.*/
class myItems {
private:
long cost;
long maxCost[100];
public:
myItems(void);
void play_with_cost();
//etc
}
void myItems:lay_with_cost() {
cost =12;
maxCost[12] = 0; //or whatever
}
/*The problem is (and this is conceptual): that there is no instance of myItems when it comes to acting on:
Thus the new tool:*/
int runPlaywithCosts(int beerpong, long foo) {
myItems:lay_with_cost()
//coding or more blah blah here...
return(SP_SUCCESS); //this statement is necessary for building tool
/*Can I make a global instance of a class? Should I?*/
/*Many thanks*/
/*Eric*/