Function & Format (2)
- To: mathgroup at smc.vnet.net
 - Subject: [mg5105] Function & Format (2)
 - From: F Renard <renard at limeil.cea.fr>
 - Date: Wed, 30 Oct 1996 22:03:59 -0500
 - Sender: owner-wri-mathgroup at wolfram.com
 
Thanks for your answer (See included message below), 
but I'm afraid it's not exactly what I want:
I want the function fun to RETURN, say x^2, but PRINT "-FUN-".
It's like Graphics, that PRINTS "-Graphics-", but RETURNS a more
complicated object, that it's possible to re-use for any other problem:
In[1]:= g = Graphics[...]
Out[1]= -Graphics-
In[2]:= Show[%]
Out[2]= -Graphics-
It's like the difference between InputForm and OutputForm...
Francois RENARD
renard at limeil.cea.fr
------Beginning Included Message----------------------------------------
The function to solve your problem seems to be simple:
 fun[x_]:= ( x^2 >>> "abc";     (* This appends the result x^2 to your
                                   (existing) file  abc. 
                                   (Example for your action)
                                 *)
            "-FUN-"             (* Alternative: Print["-FUN-"]
                                 *)
           )
fun[3]
fun[4]
fun[10]
I hope, it helps
G. Lamprecht
lamprecht at iwd.uni-bremen.de
------End Included Message----------------------------------------