½ºÅ©¸³Æ® °Á¸¦ º¸´øÁß ¹®¶à ±¸ÇöÇØ º¸°í ½Í´Ù´Â »ý°¢ÀÌ µé¾ú½À´Ï´Ù. ±×·±µ¥ °¡Àå °É¸®´Â°Ô if ¹®À̶óµçÁö ±âŸ ÆǺ°¹®Àε¥ Àú¿¡°Ô ±¤¸íÀ» ÁÖ½ÃÁö ¾ÊÀ¸½Ã°Ú½À´Ï±î?
^^*
#99-1. ¾È¿µ±â |
2005/01/12 (Wed) |
½ºÅ©¸³Æ®ÀÇ ºñ±³¹®
Á¦°¡ ¸¸µç ½ºÅ©¸³Æ® Áß¿¡¼ ½Ç¿ëÈ µÈ °ÍÀÌ 2°³°¡ Àִµ¥ ±×°ÍµéÀº ¸ðµÎ ºñ±³¹®ÀÌ ¾ø½À´Ï´Ù. ±× ´ë½Å ºñ±³¹®À» ¸ðµÎ ÇÔ¼ö·Î ¸¸µé¾î¼ ó¸®Çß½À´Ï´Ù.
if a < b then -> if LESS_THAN(a, b) then if a <= b then -> if LESS_EQUAL(a, b) then if a = b then -> if EQUAL_TO(a, b) then if a > (b+c) then -> if GREATER_THAN(a, b+c) then
ÀÌ°ÍÀº fortranÀÇ ¿µÇâÀ» ¹ÞÀº °ÍÀÔ´Ï´Ù.
ÀÏ´Ü 'if LESS_THAN(a, b) then' ¿¡ ´ëÇØ Ã³¸®ÇÏ´Â ÀÔÀå¿¡¼´Â
1. keywordÀÎ 'if'°¡ ¹ß°ßµÇ¾ú´Ù. 2. ÀÌÈÄ¿¡ ²À ³ª¿Í¾ß ÇÏ´Â Å°¿öµåÀÎ 'then'À» ã´Â´Ù. 3. 'if'¿Í 'then'»çÀÌÀÇ ¹®ÀÚ¸¦ °¡Á® ¿Â´Ù. (³¡ÀÇ °ø¹éÀº ¾ø¾Ø´Ù.) -> 'LESS_THAN(a, b)'ÀÌ °ËÃâµÇ¾ú´Ù. 4. ¹®¹ý¿¡ ÀÇÇØ 'ÇÔ¼öÀ̸§(....)'ÀÇ ÇüÅ°¡ µÇ¹Ç·Î '(' ÀÌÀü ¹®ÀÚ¿°ú '('¿Í ')'»çÀÌÀÇ ¹®ÀÚ¿À» ã´Â´Ù. -> 'LESS_THAN' °ú 'a, b'°¡ °ËÃâµÇ¾ú´Ù. 5. 'LESS_THAN'¿¡ ÇØ´çÇÏ´Â »ç¿ëÀÚ ÇÔ¼ö¸¦ ½ÇÇàÇÑ´Ù. À̶§ÀÇ ÆĶó¹ÌÅÍ´Â 'a,b'°¡ µÈ´Ù. -> ÇÔ¼ö¸í: LESS_THAN, param1 = a, param2 = b 6. ¹Ì¸® µî·ÏµÈ native ÇÔ¼ö¿¡¼´Â ´ÙÀ½°ú °°ÀÌ Ã³¸®ÇÑ´Ù.
bool __LESS_THAN(int param1, int param2) { return (param1 < param2); }
¸¸¾à native ¾ð¾î°¡ delphiÀÏ ¶§´Â
function __LESS_THAN(param1, param2: integer): boolean begin result := (param1 < param2); end;
7. native ÇÔ¼öÀÇ °á°ú°¡ trueÀ̸é then ÀÌÈÄÀÇ ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ´Ù. native ÇÔ¼öÀÇ °á°ú°¡ falseÀ̸é ¦ÀÌ µÇ´Â end if ÀÌÈÄÀÇ ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ´Ù.
À§ÀÇ ½Ã³ª¸®¿À¿¡´Â ¹®¹ýÀû ¿¡·¯ 󸮴 ºüÁ® ÀÖÀ¸´Ï ÇÊ¿äÇÑ ºÎºÐ¿¡ ³Ö¾î¾ß ÇÕ´Ï´Ù. ±×¸®°í ÆíÀÇ»ó ÇÔ¼ö·Î ó¸®ÇßÀ» »Ó ½ÇÁ¦ ºÎÈ£·Î ó¸®ÇÑ´Ù°í ÇÏ´õ¶óµµ ±×·¸°Ô ¾î·ÆÁö´Â ¾Ê½À´Ï´Ù.
|
#99-2. ¹Ù¶÷µ¹ÀÌ |
2005/01/12 (Wed) |
¾È¿µ±â´ÔÀÇ ÃÖ±Ù Á¤½ÅÀûÀÎ ºØ±« »óÅ¿¡¼µµ
±¤¸íÀ» ã¾Æ ÁÖ½Ã´Ï ±íÀÌ ±íÀÌ °¨»çµå¸³´Ï´Ù.
|
|