Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Importing Modules
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: 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
Sponsor
sponsor
agnivohneb




PostPosted: 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




PostPosted: 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 Very Happy
Raknarg




PostPosted: 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 Razz thanks anyways
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: