
-----------------------------------
Tasoya
Fri Jan 20, 2012 7:52 pm

Function that requires variables
-----------------------------------
Posted: Today at 7:44 pm   Post subject: Turing help for a noob? :D	
   
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  
 :?

-----------------------------------
Insectoid
Fri Jan 20, 2012 7:56 pm

RE:Function that requires variables
-----------------------------------
There is an example [url=http://compsci.ca/holtsoft/doc/]here.

EDIT: Damn docs can only link to the main page...
The example I mentioned:

[code]function total (a : array 1 .. * of real) : real[/code]

-----------------------------------
Tasoya
Fri Jan 20, 2012 7:59 pm

Re: Function that requires variables
-----------------------------------
Thank you soooo much!  Sorry for the bother with such an amateur question.

-----------------------------------
Tony
Fri Jan 20, 2012 8:40 pm

RE:Function that requires variables
-----------------------------------
@Insectoid

[ tdoc ] function [/ tdoc] -- [tdoc]function[/tdoc]
