"함수"의 두 판 사이의 차이
둘러보기로 가기
검색하러 가기
Pythagoras0 (토론 | 기여) |
Pythagoras0 (토론 | 기여) (→노트: 새 문단) |
||
73번째 줄: | 73번째 줄: | ||
** http://news.search.naver.com/search.naver?where=news&x=0&y=0&sm=tab_hty&query= | ** http://news.search.naver.com/search.naver?where=news&x=0&y=0&sm=tab_hty&query= | ||
[[분류:고교수학]] | [[분류:고교수학]] | ||
+ | |||
+ | == 노트 == | ||
+ | |||
+ | * You do not need to do anything special to use subroutines from the Standard C library (libc.a).<ref name="ref_abea">[https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/aixprggd/genprogc/subr_prgs_libs.htm Chapter 24. Subroutines, Example Programs, and Libraries]</ref> | ||
+ | * The cc command automatically searches this library for subroutines that a program needs.<ref name="ref_abea" /> | ||
+ | * However, if you use subroutines from another library, you must tell the compiler to search that library.<ref name="ref_abea" /> | ||
+ | * If your program uses subroutines from the library libname.a, compile your program with the flag -lname (lowercase L).<ref name="ref_abea" /> | ||
+ | * AcknowledgeAllAlarms Subroutine Acknowledges alarms for all tags in the specified Picture.<ref name="ref_160a">[https://www.ge.com/digital/documentation/ifix/version60/Subsystems/FIXVBA/content/acknowledgeallalarms_subroutine.htm AcknowledgeAllAlarms Subroutine]</ref> | ||
+ | * The subroutine will also acknowledge the alarm associated with this block.<ref name="ref_160a" /> | ||
+ | * The subroutine will acknowledge other alarms, but not the alarm associated with this block.<ref name="ref_160a" /> | ||
+ | * (default) – Allows the subroutines to provide the error messages.<ref name="ref_160a" /> | ||
+ | * PURE Asserts that the procedure has no side effects.<ref name="ref_55c5">[https://www.cita.utoronto.ca/~merz/intel_f10b/main_for/mergedProjects/lref_for/source_files/rfsubr.htm SUBROUTINE]</ref> | ||
+ | * A subroutine is invoked by a CALL statement or defined assignment.<ref name="ref_55c5" /> | ||
+ | * A subroutine subprogram cannot contain a FUNCTION statement, a BLOCK DATA statement, a PROGRAM statement, or another SUBROUTINE statement.<ref name="ref_55c5" /> | ||
+ | * But, as other languages do, Perl has the ability to make subroutines, which are user-defined functions.<ref name="ref_14fd">[https://www.oreilly.com/library/view/learning-perl-6th/9781449311063/ch04.html Learning Perl, 6th Edition [Book]]</ref> | ||
+ | * As you may have noticed in the previous example, you may use any global variables within the subroutine body.<ref name="ref_14fd" /> | ||
+ | * Most often, you refer to the invocation as simply calling the subroutine.<ref name="ref_14fd" /> | ||
+ | * You always invoke a subroutine as part of an expression, even if you don’t use the result of the expression.<ref name="ref_14fd" /> | ||
+ | * You can divide up your code into separate subroutines.<ref name="ref_d967">[https://www.tutorialspoint.com/perl/perl_subroutines.htm Tutorialspoint]</ref> | ||
+ | * In versions of Perl before 5.0, the syntax for calling subroutines was slightly different as shown below.<ref name="ref_d967" /> | ||
+ | * Because the @_ variable is an array, it can be used to supply lists to a subroutine.<ref name="ref_d967" /> | ||
+ | * You can return a value from subroutine like you do in any other programming language.<ref name="ref_d967" /> | ||
+ | * A subroutine is a piece of code that performs a set of actions or calculations, or a combination of the two.<ref name="ref_332d">[https://sourcedaddy.com/ms-access/difference-between-subroutines-and-functions.html Difference Between Subroutines and Functions]</ref> | ||
+ | * The programmer has to write a subroutine only once, and it can be called from anywhere within the program as many times as needed.<ref name="ref_332d" /> | ||
+ | * You do not have to use the word Call to utilize the subroutine MySub.<ref name="ref_332d" /> | ||
+ | * A function is exactly like a subroutine except that it returns a value.<ref name="ref_332d" /> | ||
+ | * Subroutines are identified in a program by a unique subroutine label.<ref name="ref_efe2">[https://tormach.com/subroutines-reference SUBROUTINES REFERENCE]</ref> | ||
+ | * The subroutine keyword defines the action associated with the subroutine label.<ref name="ref_efe2" /> | ||
+ | * The sub and endsub keywords are used to define the beginning and end a subroutine.<ref name="ref_efe2" /> | ||
+ | * If the subroutine is defined in the same file as the main program that calls the subroutine, it must be defined before the call statement.<ref name="ref_efe2" /> | ||
+ | * A subroutine is a block of code that performs a task based on some arguments and optionally returns a result.<ref name="ref_c602">[https://www.keil.com/support/man/docs/armasm/armasm_dom1359731145503.htm Assembler User Guide: Register usage in subroutine calls]</ref> | ||
+ | * By convention, you use registers R0 to R3 to pass arguments to subroutines, and R0 to pass a result back to the callers.<ref name="ref_c602" /> | ||
+ | * To call subroutines, use a branch and link instruction.<ref name="ref_c602" /> | ||
+ | * Subroutines - In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.<ref name="ref_afb0">[https://bournetocode.com/projects/GCSE_Computing_Fundamentals/pages/3-2-7-subroutines.html 3.2.7 Subroutines (Procedures and Functions)]</ref> | ||
+ | * In different programming languages, a subroutine may be called a procedure, a function, a routine, a method, or a subprogram.<ref name="ref_afb0" /> | ||
+ | * The generic term 'callable unit' is sometimes used.<ref name="ref_afb0" /> | ||
+ | * In this example: def displayTotal(total): 'total' is a parameter that will be passed to the 'displayTotal' subroutine.<ref name="ref_afb0" /> | ||
+ | * E very subroutine in Java must be defined inside some class.<ref name="ref_3294">[http://math.hws.edu/javanotes/c4/s2.html Javanotes 8.1, Section 4.2 -- Static Subroutines and Static Variables]</ref> | ||
+ | * This makes Java rather unusual among programming languages, since most languages allow free-floating, independent subroutines.<ref name="ref_3294" /> | ||
+ | * One purpose of a class is to group together related subroutines and variables.<ref name="ref_3294" /> | ||
+ | * Static subroutines are easier to understand: In a running program, a static subroutine is a member of the class itself.<ref name="ref_3294" /> | ||
+ | * NAME is the name given to the subroutine and must follow the same rules as variables.<ref name="ref_ff3c">[https://www.oc.nps.edu/~bird/oc3030_online/fortran/subs/subs.html Subroutines and Functions]</ref> | ||
+ | * In a subroutine, values are returned via the arguments.<ref name="ref_ff3c" /> | ||
+ | * The number and type of the arguments in the CALLing statement must agree with the number and type of the arguments in the SUBROUTINE.<ref name="ref_ff3c" /> | ||
+ | * The subroutine on the left has no arguments and simply prints out a message when it is called.<ref name="ref_ff3c" /> | ||
+ | * The code for a subroutine can be written to the same file as the calling program.<ref name="ref_3647">[https://infosys.beckhoff.com/content/1033/tcnci/9007199725851019.html Subroutine techniques]</ref> | ||
+ | * In this case the subroutine is linked directly: it is automatically also loaded as the file is read.<ref name="ref_3647" /> | ||
+ | * A procedure is a subroutine that performs a specific task.<ref name="ref_7347">[https://www.bbc.co.uk/bitesize/guides/zb33rwx/revision/4 Procedures and functions of subroutines]</ref> | ||
+ | * When the task is complete, the subroutine ends and the main program continues from where it left off.<ref name="ref_7347" /> | ||
+ | * , followed by that subroutine's name.<ref name="ref_b750">[https://pages.mtu.edu/~shene/COURSES/cs201/NOTES/chap07/subroutine.html Designing Subroutines]</ref> | ||
+ | * Here are a examples: The following is a subroutine called Factorial .<ref name="ref_b750" /> | ||
+ | * Subroutines can be internal to a program or a module.<ref name="ref_b750" /> | ||
+ | * In Fortran and other programming languages, this corresponds to creating a set of subprograms.<ref name="ref_ab63">[https://www.ichec.ie/academic/national-hpc/documentation/fortran-tutorial/subprograms Subprograms, functions and subroutines]</ref> | ||
+ | * Fortran subroutines are similar to functions, except that they can return more than one variable or array to the calling program.<ref name="ref_ab63" /> | ||
+ | * Another difference is that the output values are returned via the arguments to the subroutine.<ref name="ref_ab63" /> | ||
+ | * A subroutine subprogram must have a SUBROUTINE statement as the first statement.<ref name="ref_9bde">[https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vnbg/index.html SUBROUTINE (FORTRAN 77 Language Reference)]</ref> | ||
+ | * Like many languages, Perl provides for user-defined subroutines.<ref name="ref_2388">[https://www.cs.ait.ac.th/~on/O/oreilly/perl/prog/ch02_07.htm [Chapter 2] 2.7 Subroutines]</ref> | ||
+ | * You can generate anonymous subroutines, accessible only through references.<ref name="ref_2388" /> | ||
+ | * The return value of the subroutine (or of any other block, for that matter) is the value of the last expression evaluated.<ref name="ref_2388" /> | ||
+ | * Or you may use an explicit return statement to specify the return value and exit the subroutine from any point in the subroutine.<ref name="ref_2388" /> | ||
+ | * FlashBASIC or BASIC provides the ability to call subroutines.<ref name="ref_8236">[https://www3.rocketsoftware.com/rocketd3/support/documentation/d3nt/91/refman/pickbasic-flashbasic/subroutine_statement.htm subroutine Statement]</ref> | ||
+ | * You can write a subroutine in any language that supports subroutines.<ref name="ref_e538">[https://infocenter.informationbuilders.com/wf80/topic/pubdocs/reporting/UsingFunctions/source/topic208.htm Writing a Subroutine]</ref> | ||
+ | * When you write a subroutine you need to consider the requirements and limits that affect it.<ref name="ref_e538" /> | ||
+ | * Call subroutine SIMPLE (PRINCPAL, DATE_PUT, YRRATE, TOTAL).<ref name="ref_e538" /> | ||
+ | * If you move the SIMPLE subroutine into a file separate from the main program and compile it, you can call the subroutine.<ref name="ref_e538" /> | ||
+ | * A subroutine is a user-defined command that can be called to perform a block of logic and optionally return a value.<ref name="ref_f035">[https://www.promodel.com/onlinehelp/promodel/80/C-06%20-%20Subroutines.htm Subroutines]</ref> | ||
+ | * ProModel handles subroutines in three ways.<ref name="ref_f035" /> | ||
+ | * First, a subroutine may be processed by the calling logic as though the subroutine is part of the calling logic.<ref name="ref_f035" /> | ||
+ | * This way is the most commonly used, and is done by simply referencing the subroutine by name in some logic or expression.<ref name="ref_f035" /> | ||
+ | * All of these terms refer to a single conceptual object, which, when first invented, was called a subroutine.<ref name="ref_c56b">[https://www.mtholyoke.edu/courses/dstrahma/cs221/olr/olr9.htm Subroutines]</ref> | ||
+ | * In others, such as C/C++, both types (functions and procedures) are called functions.<ref name="ref_c56b" /> | ||
+ | * A subroutine is a sequence of instructions that can be called (branched to), causing the sequence of instructions to execute.<ref name="ref_c56b" /> | ||
+ | * A procedure can have both input and output parameters.<ref name="ref_c56b" /> | ||
+ | * A subroutine begins with the keyword subroutine followed by the name of the routine and any arguments, and ends with the keyword endsub .<ref name="ref_64d8">[http://www.eviews.com/help/content/cprogram-Subroutines.html EViews Help: Subroutines]</ref> | ||
+ | * This subroutine has no arguments so that it will behave identically every time it is used.<ref name="ref_64d8" /> | ||
+ | * You may use the return command to force EViews to exit from the subroutine at any time.<ref name="ref_64d8" /> | ||
+ | * A common use of return is to exit from the subroutine if an unanticipated error is detected.<ref name="ref_64d8" /> | ||
+ | * Subroutines are similar to functions, yet differ from them in several ways.<ref name="ref_5a4c">[https://www.lrsm.upenn.edu/~vitek/courses/f77intro/node27.html Structure of subroutine subprograms]</ref> | ||
+ | * Subroutine is invoked using a call statement from anywhere else in your F77 code.<ref name="ref_5a4c" /> | ||
+ | * Keywords subroutine and end are used to define the beginning and end of a subroutine.<ref name="ref_5a4c" /> | ||
+ | * This is very convenient once you want to leave a subroutine in the middle and forget the remaining commands.<ref name="ref_5a4c" /> | ||
+ | * Using subprograms allows you to tackle bite size pieces of a problem individually.<ref name="ref_01e1">[http://www.chem.ox.ac.uk/fortran/subprograms.html Functions and Subroutines]</ref> | ||
+ | * Subroutines, on the other hand, can return several results.<ref name="ref_01e1" /> | ||
+ | * As with functions, there are some rules for using subroutines.<ref name="ref_01e1" /> | ||
+ | * All variables used by the subroutine, including the arguments, must be declared in the subroutine.<ref name="ref_01e1" /> | ||
+ | * A routine or subroutine, also referred to as a function, procedure, and subprogram, is code called and executed anywhere in a program.<ref name="ref_3856">[https://www.computerhope.com/jargon/r/routine.htm What is a Routine and Subroutine?]</ref> | ||
+ | * For example, a routine may be used to save a file or display the time.<ref name="ref_3856" /> | ||
+ | * In cases like this, you can create a subroutine.<ref name="ref_4827">[https://www.neurobs.com/pres_docs/html/06_introduction_to_programming/07_chapter_7_-_subroutines.htm Chapter 7 - Subroutines]</ref> | ||
+ | * A subroutine can save a lot of time not only in writing your scenarios, but also in making your code more flexible and easier to re-use.<ref name="ref_4827" /> | ||
+ | * However, if you have put those lines of code into a subroutine, you will only need to update the subroutine.<ref name="ref_4827" /> | ||
+ | * In some ways, creating a subroutine is like defining your own method.<ref name="ref_4827" /> | ||
+ | * As in the case of modules, import lists serve to document the interface between a subroutine and the rest of the program.<ref name="ref_1a60">[https://www.sciencedirect.com/topics/computer-science/subroutines Subroutines - an overview]</ref> | ||
+ | * The only problem is a decision problem: when should a function be implemented as a subroutine and when should it become a coroutine?<ref name="ref_d312">[https://www.sciencedirect.com/topics/engineering/subroutine Subroutine - an overview]</ref> | ||
+ | * Is one or more internal subprograms (defining internal procedures).<ref name="ref_d53c">[https://scc.ustc.edu.cn/zlsc/sugon/intel/compiler_f/main_for/lref_for/source_files/rfsubr.htm SUBROUTINE]</ref> | ||
+ | * A subroutine subprogram cannot contain a BLOCK DATA statement, a PROGRAM statement, or a MODULE statement.<ref name="ref_d53c" /> | ||
+ | * A subroutine can contain SUBROUTINE and FUNCTION statements to define internal procedures.<ref name="ref_d53c" /> | ||
+ | * A set of Instructions which are used repeatedly in a program can be referred to as Subroutine.<ref name="ref_68bc">[https://www.geeksforgeeks.org/subroutine-subroutine-nesting-and-stack-memory/ Subroutine, Subroutine nesting and Stack memory]</ref> | ||
+ | * When a Subroutine is required it can be called many times during the Execution of a Particular program.<ref name="ref_68bc" /> | ||
+ | * A call Subroutine Instruction calls the Subroutine.<ref name="ref_68bc" /> | ||
+ | * Subroutine linkage method is a way in which computer call and return the Subroutine.<ref name="ref_68bc" /> | ||
+ | * In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.<ref name="ref_18cb">[https://en.wikipedia.org/wiki/Subroutine Subroutine]</ref> | ||
+ | * Subroutines may be defined within programs, or separately in libraries that can be used by many programs.<ref name="ref_18cb" /> | ||
+ | * In different programming languages, a subroutine may be called a routine, subprogram, function, method, or procedure.<ref name="ref_18cb" /> | ||
+ | * The subroutine may return a computed value to its caller (its return value), or provide various result values or output parameters.<ref name="ref_18cb" /> | ||
+ | * A procedure returns no values and is called in a statement, not an expression.<ref name="ref_c7c4">[https://cs.lmu.edu/~ray/notes/subroutines/ subroutines]</ref> | ||
+ | * The languages use some mechanism like "void context" or employ a special return value like or to make functions look like procedures.<ref name="ref_c7c4" /> | ||
+ | * A subroutine's signature specifies the number, order, names, modes and types of its parameters and return values.<ref name="ref_c7c4" /> | ||
+ | * Should we search in outer scopes, even when subroutines of the same name are "closer" to the call?<ref name="ref_c7c4" /> | ||
+ | ===소스=== | ||
+ | <references /> |
2020년 12월 16일 (수) 05:29 판
개요
- 함수와 관련된 기본적인 개념과 수학에서 가장 기본적인 함수 몇가지를 배움.
배우기 전에 알고 있어야 하는 것들
- 기초적인 집합의 개념
중요한 개념 및 정리
초등함수의 예
메모
Early attempts to define a function were made by James Gregory (1687), Euler (1748), and, later in the 18th century, by La Croix, Lagrange, and d'Alembert.
All these attempts were intuitive, rough-and-ready affairs and none gained acceptance. Fourier and Cauchy, both around 1820, offered improved versions;
finally Dirichlet in 1837 identified the essential property of uniqueness": y is a function of x when to each value of x in a given interval there correspond as unique value of y". This is not quite the end of the story, of course;in time it became apparentt.
- [Atkinson2002]
관련논문
- [Atkinson2002]Where Do Functions Come from? Leigh Atkinson, The College Mathematics Journal, Vol. 33, No. 2 (Mar., 2002), pp. 107-112
- Evolution of the Function Concept: A Brief Survey Israel Kleiner, The College Mathematics Journal, Vol. 20, No. 4 (Sep., 1989), pp. 282-300
- An Introduction to Logarithms F. G. Brown, The Mathematical Gazette, Vol. 11, No. 160 (Oct., 1922), pp. 164-166
- A Brief History of Logarithms R. C. Pierce, Jr., The Two-Year College Mathematics Journal, Vol. 8, No. 1 (Jan., 1977), pp. 22-26
- History of the Exponential and Logarithmic Concepts Florian Cajori, The American Mathematical Monthly, Vol. 20, No. 1 (Jan., 1913), pp. 5-14
관련기사
- 네이버 뉴스 검색 (키워드 수정)
- http://news.search.naver.com/search.naver?where=news&x=0&y=0&sm=tab_hty&query=함수
- http://news.search.naver.com/search.naver?where=news&x=0&y=0&sm=tab_hty&query=에프엑스
- http://news.search.naver.com/search.naver?where=news&x=0&y=0&sm=tab_hty&query=
- http://news.search.naver.com/search.naver?where=news&x=0&y=0&sm=tab_hty&query=
노트
- You do not need to do anything special to use subroutines from the Standard C library (libc.a).[1]
- The cc command automatically searches this library for subroutines that a program needs.[1]
- However, if you use subroutines from another library, you must tell the compiler to search that library.[1]
- If your program uses subroutines from the library libname.a, compile your program with the flag -lname (lowercase L).[1]
- AcknowledgeAllAlarms Subroutine Acknowledges alarms for all tags in the specified Picture.[2]
- The subroutine will also acknowledge the alarm associated with this block.[2]
- The subroutine will acknowledge other alarms, but not the alarm associated with this block.[2]
- (default) – Allows the subroutines to provide the error messages.[2]
- PURE Asserts that the procedure has no side effects.[3]
- A subroutine is invoked by a CALL statement or defined assignment.[3]
- A subroutine subprogram cannot contain a FUNCTION statement, a BLOCK DATA statement, a PROGRAM statement, or another SUBROUTINE statement.[3]
- But, as other languages do, Perl has the ability to make subroutines, which are user-defined functions.[4]
- As you may have noticed in the previous example, you may use any global variables within the subroutine body.[4]
- Most often, you refer to the invocation as simply calling the subroutine.[4]
- You always invoke a subroutine as part of an expression, even if you don’t use the result of the expression.[4]
- You can divide up your code into separate subroutines.[5]
- In versions of Perl before 5.0, the syntax for calling subroutines was slightly different as shown below.[5]
- Because the @_ variable is an array, it can be used to supply lists to a subroutine.[5]
- You can return a value from subroutine like you do in any other programming language.[5]
- A subroutine is a piece of code that performs a set of actions or calculations, or a combination of the two.[6]
- The programmer has to write a subroutine only once, and it can be called from anywhere within the program as many times as needed.[6]
- You do not have to use the word Call to utilize the subroutine MySub.[6]
- A function is exactly like a subroutine except that it returns a value.[6]
- Subroutines are identified in a program by a unique subroutine label.[7]
- The subroutine keyword defines the action associated with the subroutine label.[7]
- The sub and endsub keywords are used to define the beginning and end a subroutine.[7]
- If the subroutine is defined in the same file as the main program that calls the subroutine, it must be defined before the call statement.[7]
- A subroutine is a block of code that performs a task based on some arguments and optionally returns a result.[8]
- By convention, you use registers R0 to R3 to pass arguments to subroutines, and R0 to pass a result back to the callers.[8]
- To call subroutines, use a branch and link instruction.[8]
- Subroutines - In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.[9]
- In different programming languages, a subroutine may be called a procedure, a function, a routine, a method, or a subprogram.[9]
- The generic term 'callable unit' is sometimes used.[9]
- In this example: def displayTotal(total): 'total' is a parameter that will be passed to the 'displayTotal' subroutine.[9]
- E very subroutine in Java must be defined inside some class.[10]
- This makes Java rather unusual among programming languages, since most languages allow free-floating, independent subroutines.[10]
- One purpose of a class is to group together related subroutines and variables.[10]
- Static subroutines are easier to understand: In a running program, a static subroutine is a member of the class itself.[10]
- NAME is the name given to the subroutine and must follow the same rules as variables.[11]
- In a subroutine, values are returned via the arguments.[11]
- The number and type of the arguments in the CALLing statement must agree with the number and type of the arguments in the SUBROUTINE.[11]
- The subroutine on the left has no arguments and simply prints out a message when it is called.[11]
- The code for a subroutine can be written to the same file as the calling program.[12]
- In this case the subroutine is linked directly: it is automatically also loaded as the file is read.[12]
- A procedure is a subroutine that performs a specific task.[13]
- When the task is complete, the subroutine ends and the main program continues from where it left off.[13]
- , followed by that subroutine's name.[14]
- Here are a examples: The following is a subroutine called Factorial .[14]
- Subroutines can be internal to a program or a module.[14]
- In Fortran and other programming languages, this corresponds to creating a set of subprograms.[15]
- Fortran subroutines are similar to functions, except that they can return more than one variable or array to the calling program.[15]
- Another difference is that the output values are returned via the arguments to the subroutine.[15]
- A subroutine subprogram must have a SUBROUTINE statement as the first statement.[16]
- Like many languages, Perl provides for user-defined subroutines.[17]
- You can generate anonymous subroutines, accessible only through references.[17]
- The return value of the subroutine (or of any other block, for that matter) is the value of the last expression evaluated.[17]
- Or you may use an explicit return statement to specify the return value and exit the subroutine from any point in the subroutine.[17]
- FlashBASIC or BASIC provides the ability to call subroutines.[18]
- You can write a subroutine in any language that supports subroutines.[19]
- When you write a subroutine you need to consider the requirements and limits that affect it.[19]
- Call subroutine SIMPLE (PRINCPAL, DATE_PUT, YRRATE, TOTAL).[19]
- If you move the SIMPLE subroutine into a file separate from the main program and compile it, you can call the subroutine.[19]
- A subroutine is a user-defined command that can be called to perform a block of logic and optionally return a value.[20]
- ProModel handles subroutines in three ways.[20]
- First, a subroutine may be processed by the calling logic as though the subroutine is part of the calling logic.[20]
- This way is the most commonly used, and is done by simply referencing the subroutine by name in some logic or expression.[20]
- All of these terms refer to a single conceptual object, which, when first invented, was called a subroutine.[21]
- In others, such as C/C++, both types (functions and procedures) are called functions.[21]
- A subroutine is a sequence of instructions that can be called (branched to), causing the sequence of instructions to execute.[21]
- A procedure can have both input and output parameters.[21]
- A subroutine begins with the keyword subroutine followed by the name of the routine and any arguments, and ends with the keyword endsub .[22]
- This subroutine has no arguments so that it will behave identically every time it is used.[22]
- You may use the return command to force EViews to exit from the subroutine at any time.[22]
- A common use of return is to exit from the subroutine if an unanticipated error is detected.[22]
- Subroutines are similar to functions, yet differ from them in several ways.[23]
- Subroutine is invoked using a call statement from anywhere else in your F77 code.[23]
- Keywords subroutine and end are used to define the beginning and end of a subroutine.[23]
- This is very convenient once you want to leave a subroutine in the middle and forget the remaining commands.[23]
- Using subprograms allows you to tackle bite size pieces of a problem individually.[24]
- Subroutines, on the other hand, can return several results.[24]
- As with functions, there are some rules for using subroutines.[24]
- All variables used by the subroutine, including the arguments, must be declared in the subroutine.[24]
- A routine or subroutine, also referred to as a function, procedure, and subprogram, is code called and executed anywhere in a program.[25]
- For example, a routine may be used to save a file or display the time.[25]
- In cases like this, you can create a subroutine.[26]
- A subroutine can save a lot of time not only in writing your scenarios, but also in making your code more flexible and easier to re-use.[26]
- However, if you have put those lines of code into a subroutine, you will only need to update the subroutine.[26]
- In some ways, creating a subroutine is like defining your own method.[26]
- As in the case of modules, import lists serve to document the interface between a subroutine and the rest of the program.[27]
- The only problem is a decision problem: when should a function be implemented as a subroutine and when should it become a coroutine?[28]
- Is one or more internal subprograms (defining internal procedures).[29]
- A subroutine subprogram cannot contain a BLOCK DATA statement, a PROGRAM statement, or a MODULE statement.[29]
- A subroutine can contain SUBROUTINE and FUNCTION statements to define internal procedures.[29]
- A set of Instructions which are used repeatedly in a program can be referred to as Subroutine.[30]
- When a Subroutine is required it can be called many times during the Execution of a Particular program.[30]
- A call Subroutine Instruction calls the Subroutine.[30]
- Subroutine linkage method is a way in which computer call and return the Subroutine.[30]
- In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.[31]
- Subroutines may be defined within programs, or separately in libraries that can be used by many programs.[31]
- In different programming languages, a subroutine may be called a routine, subprogram, function, method, or procedure.[31]
- The subroutine may return a computed value to its caller (its return value), or provide various result values or output parameters.[31]
- A procedure returns no values and is called in a statement, not an expression.[32]
- The languages use some mechanism like "void context" or employ a special return value like or to make functions look like procedures.[32]
- A subroutine's signature specifies the number, order, names, modes and types of its parameters and return values.[32]
- Should we search in outer scopes, even when subroutines of the same name are "closer" to the call?[32]
소스
- ↑ 1.0 1.1 1.2 1.3 Chapter 24. Subroutines, Example Programs, and Libraries
- ↑ 2.0 2.1 2.2 2.3 AcknowledgeAllAlarms Subroutine
- ↑ 3.0 3.1 3.2 SUBROUTINE
- ↑ 4.0 4.1 4.2 4.3 Learning Perl, 6th Edition [Book]
- ↑ 5.0 5.1 5.2 5.3 Tutorialspoint
- ↑ 6.0 6.1 6.2 6.3 Difference Between Subroutines and Functions
- ↑ 7.0 7.1 7.2 7.3 SUBROUTINES REFERENCE
- ↑ 8.0 8.1 8.2 Assembler User Guide: Register usage in subroutine calls
- ↑ 9.0 9.1 9.2 9.3 3.2.7 Subroutines (Procedures and Functions)
- ↑ 10.0 10.1 10.2 10.3 Javanotes 8.1, Section 4.2 -- Static Subroutines and Static Variables
- ↑ 11.0 11.1 11.2 11.3 Subroutines and Functions
- ↑ 12.0 12.1 Subroutine techniques
- ↑ 13.0 13.1 Procedures and functions of subroutines
- ↑ 14.0 14.1 14.2 Designing Subroutines
- ↑ 15.0 15.1 15.2 Subprograms, functions and subroutines
- ↑ SUBROUTINE (FORTRAN 77 Language Reference)
- ↑ 17.0 17.1 17.2 17.3 [Chapter 2 2.7 Subroutines]
- ↑ subroutine Statement
- ↑ 19.0 19.1 19.2 19.3 Writing a Subroutine
- ↑ 20.0 20.1 20.2 20.3 Subroutines
- ↑ 21.0 21.1 21.2 21.3 Subroutines
- ↑ 22.0 22.1 22.2 22.3 EViews Help: Subroutines
- ↑ 23.0 23.1 23.2 23.3 Structure of subroutine subprograms
- ↑ 24.0 24.1 24.2 24.3 Functions and Subroutines
- ↑ 25.0 25.1 What is a Routine and Subroutine?
- ↑ 26.0 26.1 26.2 26.3 Chapter 7 - Subroutines
- ↑ Subroutines - an overview
- ↑ Subroutine - an overview
- ↑ 29.0 29.1 29.2 SUBROUTINE
- ↑ 30.0 30.1 30.2 30.3 Subroutine, Subroutine nesting and Stack memory
- ↑ 31.0 31.1 31.2 31.3 Subroutine
- ↑ 32.0 32.1 32.2 32.3 subroutines