<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://trans.onionmixer.net/wiki/index.php?action=history&amp;feed=atom&amp;title=StartprogrammingusingObjectPascal%3AFunctionAsAnInputParameter</id>
	<title>StartprogrammingusingObjectPascal:FunctionAsAnInputParameter - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://trans.onionmixer.net/wiki/index.php?action=history&amp;feed=atom&amp;title=StartprogrammingusingObjectPascal%3AFunctionAsAnInputParameter"/>
	<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=StartprogrammingusingObjectPascal:FunctionAsAnInputParameter&amp;action=history"/>
	<updated>2026-05-01T07:47:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://trans.onionmixer.net/wiki/index.php?title=StartprogrammingusingObjectPascal:FunctionAsAnInputParameter&amp;diff=311&amp;oldid=prev</id>
		<title>Onionmixer: SPOP 입력인자로서의함수 페이지 추가</title>
		<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=StartprogrammingusingObjectPascal:FunctionAsAnInputParameter&amp;diff=311&amp;oldid=prev"/>
		<updated>2012-07-26T10:32:25Z</updated>

		<summary type="html">&lt;p&gt;SPOP 입력인자로서의함수 페이지 추가&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===입력 인자로서의 함수===&lt;br /&gt;
&lt;br /&gt;
이전에 이야기 한 바와 같이, 함수를 프로시저 혹은 함수의 입력 인자로서 호출할 수 있는데, 함수를 값과 같은 존재로 다룰 수 있기 때문입니다.&lt;br /&gt;
&lt;br /&gt;
아래 예제를 봅니다.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
function DoubleNumber(x: Integer): Integer;&lt;br /&gt;
begin&lt;br /&gt;
    Result:= x * 2;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
// Main&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
    Writeln(&amp;#039;The double of 5 is : &amp;#039;, DoubleNumber(5));&lt;br /&gt;
    Readln;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
참고로 Writeln프로시저에서 DoubleNumber 함수를 호출했습니다.&lt;br /&gt;
&lt;br /&gt;
다음 수정한 예제에서는 함수의 결과를 저장하기 위해 중간 변수를 사용했고, Writeln프로시저를 사용하여 중간 변수를 입력으로 사용했습니다.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
function DoubleNumber(x: Integer): Integer;&lt;br /&gt;
begin&lt;br /&gt;
    Result:= x * 2;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
// Main&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
    MyNum: Integer;&lt;br /&gt;
begin&lt;br /&gt;
    MyNum:= DoubleNumber(5);&lt;br /&gt;
    Writeln(&amp;#039;The double of 5 is : &amp;#039;, MyNum);&lt;br /&gt;
    Readln;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
또한 if 조건문과 순환문의 조건부에서 함수를 호출할 수 있습니다&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
function DoubleNumber(x: Integer): Integer;&lt;br /&gt;
begin&lt;br /&gt;
    Result:= x * 2;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
// Main&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
    MyNum: Integer;&lt;br /&gt;
begin&lt;br /&gt;
    if DoubleNumber(5) &amp;gt; 10 then&lt;br /&gt;
        Writeln(&amp;#039;This number is larger than 10&amp;#039;)&lt;br /&gt;
    else&lt;br /&gt;
        Writeln(‘This number is equal or less than 10’);&lt;br /&gt;
    Readln;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Category:StartprogrammingusingObjectPascal]]&lt;/div&gt;</summary>
		<author><name>Onionmixer</name></author>
	</entry>
</feed>