[Santa Clara University]
Department of Mathematics
and Computer Science

Math 169

Icon Information

D. C. Smolarski, S.J.

[Return to Math 169 Homepage | Return to Supplement Listing Page]

Contents


Icon on the HP Unix Server

  1. Create a source code (program) file using an editor of your choice (e.g. Emacs or vi). The extension should be .icn.
  2. After the source code file is created, execution of the code is via a modified Unix sequence of steps. The "translator" name is icont. This produces an executable file that is the same as the original file but lacking any extension. This filename can be use to run the code. E.g.,
                   icont mpicon.icn
    	       mpicon
    
    One may omit the extension when invoking icont, if it is .icn.

  3. With the PC version, there is one translator, icont, but two "executing" drivers, one for the "shorter" integer version, called iconx and one for the "longer" integer version, called iconxl. These are used in conjunction with the filename and the translated file (which has the extension .icx).

Sample Icon Source Code

math 22: script
Script started on Wed Apr 26 13:44:43 2000
math 23: more fact.icn
procedure main()
    write("Input number of desired factorial")
    i := read()
    fact := 1
    j := 1
    while j <= i do {
        fact := fact*j
        j := j+1
    }
    write("factorial of ",i," is ",fact)
end

Sample Execution

math 24: icont fact
Translating:
fact.icn:
  main
No errors
Linking:
math 25: fact
Input number of desired factorial
100
factorial of 100 is 9332621544394415268169923885626670049071
596826438162146859296389521759999322991560894146397615651828
6253697920827223758251185210916864000000000000000000000000
math 26: exit
script done on Wed Apr 26 13:46:43 2000


My email address is dsmolarski@math.scu.edu

This page last updated 26 April 2000.