Your source code is quite incomplete. For example, it misses the data types. In FreeBASIC you choose between several data types depending on what kind of data you want to store (Integer, Double, String, ...).
Moreover, you did not define how your sub programs actually should work. You didn't give any code what your procedure "subtract" should do.
Here's a working example of your small calculator:
' These two functions take 2 Integers (..., -1, 0, 1, 2, ...) and
' return 1 Integer as their result.
' Here we find the procedure declarations ("what inputs and outputs
' exist?"). The implementation ("how do these procedures actually
' work?") follows at the end of the program.
Declare Function Add (a As Integer, b As Integer) As Integer
Declare Function Subtract (a As Integer, b As Integer) As Integer
' == Begin of main program ==
Dim choice As Integer
Print "1. Add"
Print "2. Subtract"
Input "what is your choice? ", choice
' You could use "input" (see choice above) to get values from the user.
Dim As Integer x, y
x = 10
y = 6
If (choice = 1) Then
Print Add(x, y)
ElseIf (choice = 2) Then
Print Subtract(x, y)
Else
Print "Invalid input!"
End If
Print "Press any key to quit."
GetKey
End
' == End of main program ==
' == Sub programs (procedures = subs and functions) from here on ==
Function Add (a As Integer, b As Integer) As Integer
Return a + b
End Function
Function Subtract (a As Integer, b As Integer) As Integer
Return a - b
End Function