J is an interpreter so that there is no main program. When J starts it will execute the default profile.ijs or other script specified.
eg. save the follow 2 lines to a file eg, /home/bill/hello.ijs 1!:2&2 'hello world' 2!:55[0 in your j601 folder, type ./jconsole -jprofile /home/bill/hello.ijs however reading stdin is more involved as other members already noted. Amelia Stein wrote:
I am new to J programming, and I don't quite understand script files. How do you write the equivalent of a main function from C programming? I don't want to define a verb. I simply want to create a main program where I can query the user and except user input. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
-- regards, bill ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
