Entry
TSE: Programming: Recursion: Macro: Faculty: How to write a faculty function in TSE?
Jan 1st, 2005 08:09
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 01 January 2005 - 05:25 pm --------------------
TSE: Programming: Recursion: Macro: Faculty: How to write a faculty
function in TSE?
---
Steps: Overview:
1. -Create the following program
--- cut here: begin --------------------------------------------------
INTEGER PROC FNFacultyI( INTEGER I )
IF I == 0 RETURN( 1 ) ENDIF
IF I == 1 RETURN( 1 ) ENDIF
RETURN( I * FNFacultyI( I - 1 ) )
END
PROC Main()
Message( FNFacultyI( 4 ) ) // will show 4 . 3 . 2 . 1 = 24
END
<F12> Main()
--- cut here: end ----------------------------------------------------
2. -Save this macro
3. -Compile this macro
4. -Run this macro
5. -That will show on the statusbar below left
24
---
---
Internet: see also:
---
TSE: Programming: Recursion: Link: Overview: Can you give me an
overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/33130/fid/1738
----------------------------------------------------------------------