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

Username:   Password: 
 RegisterRegister   
 Creating New Variable Types
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Sun Aug 21, 2005 11:24 am   Post subject: Creating New Variable Types

I'm looking to add two variable types to turing. They look like this:
Turing:

type *Coord2D :
    record
        x, y : real
    end record

Turing:

type *Vector2D :
    record
        mag, ang : real
    end record

Does anyone know how to make these as global to Turing as types such as strings and booleans?
I have found a solution that works, though it is sloppy. I stuck my code at the end of "%oot\support\predefs\error.inc". Does anyone know a better place to put it?
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sun Aug 21, 2005 5:06 pm   Post subject: (No subject)

Can't you just put them somewhere in Limits.tu or Typeconv.tu? Those are the two most relating ones I can find.

Other than what you just adding it to somewhere in the predefs folder, I can't see what else is possible. Seeing how limited Turing's moddability is.
Cervantes




PostPosted: Sun Aug 21, 2005 6:56 pm   Post subject: (No subject)

I could put it in any module I'd like, but that's as sloppy as sticking it in error.inc.

Fortunately, though, I got it to work. I wanted to make my own module, so I called it "Type.tu" and added it to "predefs.lst", inserting it in the big list aphabetically. Turns out that it needs to be above the majoraty of them, (except anyclass) or else I can't use it inside any of those modules (I was trying to use it in the Mouse module).

Turing seems to be pretty moddable.

Thanks for the reply. Smile
[Gandalf]




PostPosted: Mon Aug 22, 2005 8:26 pm   Post subject: (No subject)

Yeah, I learned that the hard way Laughing I spent two hours looking for a bug in the modules, and yet it was just in the order of the file in predefs.lst, I thought it had to be alphabetical too.

Well, the moddability of Turing is fine, but the range is limited only to what Turing can do... They should allow you to mod the C (or C++) files they used. But that would probably be too much to ask from a 'commercial' company like HoltSoft...
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: