Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac debugger not connecting, a user error! BlameTroi 0 110 02-07-2026, 06:18 PM
Last Post: BlameTroi
  I'm looking for suggestions to solve the problem! Petr 10 682 02-05-2026, 04:56 PM
Last Post: ahenry3068
Star Suggestion for new REPLACE$() function zaadstra 3 262 01-26-2026, 05:11 PM
Last Post: grymmjack
  Nth problem with hardware images Ikerkaz 9 503 01-23-2026, 02:58 PM
Last Post: bplus
  Install problem...... jssantoro 6 397 12-17-2025, 08:31 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)