TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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
on
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
------------------------------------------------------
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