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

Username:   Password: 
 RegisterRegister   
 Question about return type
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Geminias




PostPosted: Sat Nov 05, 2005 2:58 pm   Post subject: Question about return type

i'm going to write a module that will allow you to draw objects using turings graphic libraries by choosing the cordinates with your mouse rather than guessing at them with. the way it will work is this:
you essentially run the module in a program and you draw your picture on the run screen. then as a last option you save the picture to a file. then you call on that picture with your turing program, so kind of like paint except turing graphics paint lol.

i'm curious, cause for my functions i need a return type and i'm not sure what a function like drawfilloval (x1,y1,x2,y2,color) would return exactly.
does it return something?
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat Nov 05, 2005 6:13 pm   Post subject: Re: Question about return type

Geminias wrote:
i'm curious, cause for my functions i need a return type and i'm not sure what a function like drawfilloval (x1,y1,x2,y2,color) would return exactly.
does it return something?

drawfilloval does not return anything. It is a procedure. You know this because you don't have to pass the value returned by drawfilloval to anything, such as a variable. Doing something like
code:
var circle := drawfilloval (100, 100, 50, 50, 20)

give you "drawfilloval is a procedure and hence does not return a value".

As for the value returned by your function, you've got three choices: It could be an int which represents the picture you just drew. (You know how Pic.FileNew returns an integer?) Second, you could return a string that is the name of the file you are writing to. (I'm not sure if you are actually saving the image as a bitmap type image, or as a series of points in a data file that will be connected by lines or some other means). Lastly, you could return nothing.
Geminias




PostPosted: Sat Nov 05, 2005 10:49 pm   Post subject: (No subject)

ahhh thanks, i figured it all out and got the mod working
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  [ 3 Posts ]
Jump to:   


Style:  
Search: