Program Structure - epilogue section

information about SharpBASIC language elements
Post Reply
User avatar
frank
Site Admin
Posts: 51
Joined: Sun Nov 21, 2021 12:04 pm
Location: Netherlands
Contact:

Program Structure - epilogue section

Post by frank »

The code area following the main section is called the epilogue section. This section is reserved for subroutine and function definitions (sub, func) only.

Code: Select all

' SharpBASIC – Times 2
' --------------------
decl func Times2(value: int): int;

dim x: int = 1;
dim y: int;

main do
  y = Times2(x);
  print(y);
end

func Times2(value: int): int
do
  Times2 = value * 2;
end
Last edited by frank on Wed Mar 09, 2022 2:51 pm, edited 2 times in total.
Keep it simple!
Post Reply