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

Username:   Password: 
 RegisterRegister   
 Function that requires variables
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tasoya




PostPosted: Fri Jan 20, 2012 7:52 pm   Post subject: Function that requires variables

Posted: Today at 7:44 pm Post subject: Turing help for a noob? Very Happy

Hey everyone,
I'm very new to turing so please let the criticism come along with help! So our class started doing fuctions and arrays in school, and I am just simply perplexed by how I would run an array through a function that has required variables. The question was to find if a number was prime in an array.

My question is: Is there a way to run a function with a variable inside? For example : function primer (var list :array 1..count of int):real... ? Count would be the amount of terms (count of it) inputted by the user prior into the array.


Thanks for reading this,
Sincerely, a very confused child
Confused
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri Jan 20, 2012 7:56 pm   Post subject: RE:Function that requires variables

There is an example here.

EDIT: Damn docs can only link to the main page...
The example I mentioned:

code:
function total (a : array 1 .. * of real) : real
Tasoya




PostPosted: Fri Jan 20, 2012 7:59 pm   Post subject: Re: Function that requires variables

Thank you soooo much! Sorry for the bother with such an amateur question.
Tony




PostPosted: Fri Jan 20, 2012 8:40 pm   Post subject: RE:Function that requires variables

@Insectoid

[ tdoc ] function [/ tdoc] -- function
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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: