Could someone please so me the correct way to call a sub in calc?

Sub EnterTrans

Dim iTT As Integer
iTT = Int((N3)

Select Case iTT
    Case 1 
    	gosub CashReceipts
    Case 2
    	gosub Payroll
    Case 3 
    	Gosub Expenses
    Case Else
End Select

End Sub

What I get is : BASIC syntax error.
Label CashReceipts undefined

Please go easy on me, I’m new to LibreOffice. Thank you

Hello,

In StarOffice Basic (basic used in LibreOffice), you simply note the Sub (actually a procedure or function) you are calling. Once completed, you will be returned to the next instruction.

Case 1 
    CashReceipts
Case 2
    Payroll(parameters)
 etc....

For the manual, here is a link to the PDF → StarOffice 7 - Basic Programmer’s Guide

Edit - Simple example based upon your code:

Sub EnterTrans
Dim iTT As Integer: iTT = 3
Select Case iTT
    Case 1 
         CashReceipts
    Case 2
         Payroll
    Case 3 
         Expenses
     Case Else
         Nada
End Select
End Sub

Sub CashReceipts
Print "Hello CR"
End Sub
Sub Payroll
Print "Hello PR"
End Sub
Sub Expenses
Print "Hello EXP"
End Sub
Sub NADA
Print "Nothing Selected"
End Sub

As with all questions, if this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.