Here's how we could change the example program to define another procedure:
PROC main() WriteF('My first program') fred() ENDPROC PROC fred() WriteF('...slightly improved') ENDPROC
This may seem complicated, but in fact it's very simple.
All we've done is define a second procedure called
fred which is just like the original program--it outputs a message.
We've called this procedure in the
main procedure just after the line which outputs the original message.
Therefore, the message in
fred is output after this message.
Compile the program as before and run it so you don't have to take my word for it.
Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.