Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Goals(1) = New Tile()
#4
(08-31-2023, 05:42 PM)gaslouk Wrote:
Code: (Select All)
    ReDim Goals(6)
    Goals(1) = New Tile()
    Goals(1).Symbol = "o"
Expected operator in equation

Help.

thank you.

As mentioned "new" is an operator for object oriented programming languages such as C++, PHP, Javascript etc. which is not possible in QB64(PE), however REDIM can do the job, but "Tile" have to be a user defined TYPE instead of a function.

Code: (Select All)
Type Tile
    Symbol As String * 1 'use higher numbers if you need more chars
End Type
ReDim Goals(6) As Tile

Goals(1).Symbol = "o"
Goals(2).Symbol = "x"
Goals(3).Symbol = "*"

etc.
Reply


Messages In This Thread
Goals(1) = New Tile() - by gaslouk - 08-31-2023, 05:42 PM
RE: Goals(1) = New Tile() - by TerryRitchie - 08-31-2023, 06:08 PM
RE: Goals(1) = New Tile() - by mnrvovrfc - 08-31-2023, 06:58 PM
RE: Goals(1) = New Tile() - by RhoSigma - 08-31-2023, 09:45 PM
RE: Goals(1) = New Tile() - by gaslouk - 09-01-2023, 07:07 AM
RE: Goals(1) = New Tile() - by RhoSigma - 09-01-2023, 08:35 AM
RE: Goals(1) = New Tile() - by SMcNeill - 09-01-2023, 07:28 AM
RE: Goals(1) = New Tile() - by gaslouk - 09-01-2023, 08:49 AM
RE: Goals(1) = New Tile() - by bplus - 09-01-2023, 09:28 AM
RE: Goals(1) = New Tile() - by gaslouk - 09-01-2023, 09:42 AM
RE: Goals(1) = New Tile() - by bplus - 09-01-2023, 09:49 AM
RE: Goals(1) = New Tile() - by gaslouk - 09-01-2023, 09:57 AM
RE: Goals(1) = New Tile() - by bplus - 09-01-2023, 10:08 AM
RE: Goals(1) = New Tile() - by gaslouk - 09-01-2023, 10:19 AM
RE: Goals(1) = New Tile() - by bplus - 09-01-2023, 11:18 AM
RE: Goals(1) = New Tile() - by gaslouk - 09-01-2023, 01:01 PM
RE: Goals(1) = New Tile() - by bplus - 09-03-2023, 06:39 PM



Users browsing this thread: 4 Guest(s)