Importing Modules
Author |
Message |
Raknarg
|
Posted: Mon Nov 28, 2011 8:07 pm Post subject: Importing Modules |
|
|
So I have a program, and I'm trying to import a module into it (obviously). However, I'm running into an issue and I cannot solve it .The program runs fine, but at the beginning I have a statement: import PlayerControls (thats the module name). However, it keeps telling me "syntax error at 'Import'" and I don;t know why. Any ideas? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
agnivohneb
|
Posted: Thu Dec 01, 2011 10:14 pm Post subject: RE:Importing Modules |
|
|
Usually if you get a syntax error on the first word in the line then it could be spelled wrong or there could be an error at whatever was executed above.
Other than that info I can't help you that much unless I see some code to be sure. |
|
|
|
|
|
smool
|
Posted: Sat Dec 03, 2011 1:00 pm Post subject: RE:Importing Modules |
|
|
Import before Export, make sure both files are saved in the same directory, import is lower case, so 'import' and not 'Import', make sure your module itself is saved as PlayerControls, make sure the module itself is also name exactly the same thing, and make sure you have unit on the first line of your PlayerControls module. so, shoudl be something like:
unit
module PlayerControls
%stuff
end PlayerControls
save that as PlayerControls.tu
main program:
import PlayerControls
and that should be good |
|
|
|
|
|
Raknarg
|
Posted: Sat Dec 03, 2011 7:50 pm Post subject: RE:Importing Modules |
|
|
No, i figured this out a few days ago, it's because I forgot to have import as my very first line instead of setscreeen thanks anyways |
|
|
|
|
|
|
|