Procedures are functions
<< Back
In FMAC, we can see the following.
#REPLACE END_FUNCTION END_PROCEDURE
#REPLACE PROCEDURE_RETURN FUNCTION_RETURN
#COMMAND FUNCTION R
.
.
.
.
HANDLE$MESSAGE GET !1 !2 !3 !4 !5 !6 !7 !8 !9
.
.
.
#ENDCOMMAND
#COMMAND PROCEDURE R
.
.
#IFSAME !1 SET
.
.
HANDLE$MESSAGE SET_!2 !3 !4 !5 !6 !7 !8 !9
.
.
#ELSE
.
.
HANDLE$MESSAGE MSG_!1 !2 !3 !4 !5 !6 !7 !8 !9
.
.
#ENDIF
#ENDCOMMAND
Internally procedures are pretty much the same as functions, which they are both sub-routines and
they can both return values. The only difference is that you can't really call a procedure using
expression format (Or I haven't discovered how).
Use Windows
Procedure Proc Returns String
Function_Return "Procedure with Function_Return and End_Function"
End_Function
Function Func Returns String
Procedure_Return "Function with Procedure_Return and End_Procedure"
End_Procedure
Procedure Main
String sProc
Get Msg_Proc to sProc
Send Info_Box (Func(Self)) sProc
End_Procedure
Send Main