Thread: Is it possible?
View Single Post
Is it possible?
Old
  (#1)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Is it possible? - 16-12-2004

Well, i'm busy with a secret project.

The question is, can i have something like:

file a.cpp
Code:
int ReturnSomeIndex()
{
 return bla;
}
in file b.cpp
Code:
int UTIL_ReturnSomeIndex()
{
  if (ReturnSomeIndex)
	return ReturnSomeIndex();
 
 return 0;
}
so in other words.

file B must be in the project all the time, but will work even without file A. So when ReturnSomeIndex() does not exist, it compiles fine. I thought there was something done like this in botmans code before, with the engine functions put in a void *. But i am not sur eif this is possible.

So i want to override the UTIL_ReturnSomeIndex() with resulting a function. But even if that function does not exist (for neatness sake). I know i can 'do this simpler' with a simple boolean value or something like that. Or even provide an empty ReturnSomeIndex() function in file A. But thats the key, file A should NOT be needed and still compile and the program should run...

any idea?


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote