Problem with User Defined Function
#1
When I try to compile this snippet

Code: (Select All)
Type ButtonT
    x As Integer        'Position left top
    y As Integer
    w As Integer        'Height
    h As Integer        'Width
    text As String        'label
End Type

Function Button(x As Integer, y As Integer, w As Integer, h As Integer, Text As String) As ButtonT                                    
  'Defines and draws a new button

    Dim As ButtonT btn
    
    btn.x = x
    btn.y = y
    btn.h = h
    btn.w = w
    btn.text = text
        
    'Button_Draw(btn, ButtonColor)
    
  Return btn
    
End Function
I get the following error:

------------------------
Expected )
Caused by (or after):
Line 9:
Function Button_New(x As Integer, y As Integer, w As Integer, h As Integer, Text As String) As Button
------------------------

Can someone clarify what I am doing wrong.
Reply


Messages In This Thread
Problem with User Defined Function - by RNBW - 06-13-2022, 10:08 AM
RE: Problem with User Defined Function - by bplus - 06-13-2022, 12:20 PM
RE: Problem with User Defined Function - by RNBW - 06-14-2022, 09:53 AM



Users browsing this thread: 2 Guest(s)