Re: lexical question

Subject: Re: lexical question
From: "Russell H. Whyte" <russell -dot- whyte -at- SHERIDANC -dot- ON -dot- CA>
Date: Tue, 29 Jun 1993 13:45:45 EDT

Hi Amy!

In the past I've defined the difference by how they're used. A routine
is called by a statement. e.g. gosub 1000
perform add-routine
call add-routine

A function is usually used within a statement, e.g.
net_salary = calc_net(gross)
where calc_net is the function
gross is the variable the function acts
net_salary is where the result is stored.

You're right in saying that a function returns a value. A routine does
not have to return a value.

I usually use parentheses when defining functions, to differentiate
between functions and routines.

Subroutines and routines are interchangeable. I usually use routines
(less typing :-))

I hope this helps you out!


Russell H. Whyte russell -dot- whyte -at- sheridanc -dot- on -dot- ca
Technologist, End User Services
Sheridan College, Information Technology
1430 Trafalgar Road
Oakville, Ontario
L6H 2L1

Previous by Author: Re: framemaker q&a
Next by Author: Helping a new subscriber
Previous by Thread: lexical question
Next by Thread: Re: lexical question

What this post helpful? Share it with friends and colleagues:

Sponsored Ads