You can use preprocessor statements wherever you would like; the C preprocessor has no knowledge of functions. A macro will be in effect from the point in the source file where it is defined until the end of the file or when it is undefined using a #undef statement.
I'm not sure what you mean by ROBOTC can't create new variables - this is very possible. If you mean that ROBOTC has no built-in dynamic memory allocation like C++ or Java, then I believe this is correct.
To the OP, since you haven't responded yet, here's an explanation of what your current code does. Like I said, if you can give us a better idea of what you're trying to accomplish, then we can give you better advice.
Here, you're defining a new structure datatype called twoMotorDrive. This generally looks good.
You start defining a function called setDriveTrainSize. This function takes a single argument, size, of type byte.
You define two preprocessor macros, driveTrainSize, and driveTrain, then have a line where you appear to be trying to set a member of a structure variable, but this will not do what you think:
Preprocessor macros do one thing and one thing only: they replace code with other code when the code is compiled (more accurately, immediately before the code is compiled). When your code is compiled, the preprocessor will evaluate the code and the code in the function will be changed to this:
Because the second #define line tells the preprocessor that every time it sees the name driveTrain to replace it with the name twoMotorDrive. The preprocessed code is then sent to the compiler.
The compiler then tries to compile the code, but it runs into a problem: twoMotorDrive is the name of a structure type, not a variable. This is the source of the compiler error you are getting.
My guess is that instead of a #define statement, you want a variable declaration statement. The code of your function would instead be something like this:
This may or may not be what you need to do depending on what you're trying to accomplish, though. It's hard to tell without seeing how driveTrain is used further on in your program. I'm also not sure what the size of a drive train would be.