Functions

Hi
this code this gives the error “cannot return a value as this method has not defined a return type”
Why? It’s copied from the xojo beginner pdf.

	Dim currentFont As String
	
	If FontListBox.ListIndex <> -1 Then
			 currentFont =  FontListBox.List(FontListBox.ListIndex) 
	Else
			 currentFont = ""
	End If
	Return currentFont

did you specify the return datatype in the inspector?
if not, then this would not be considered a “function”

Cheers Dave!