Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Illegal string-number conversion
#4
@Herve 
welcome

it is an interesting glitch of parser

[Image: Rules-for-naming-variables-in-Qbasic.png]


[Image: Rules-of-DOT-in-naming-an-UDT-variables-by-TYPES.png]




[Image: Rules-ofnamingvariables-by-DIM.png]




Code: (Select All)
Option _Explicit
Type SomeType
    i As Integer
    s As String
    d As Double
End Type

Type OtherType
    element As SomeType
End Type

Dim S.t.Q As String
Dim Shared S.t.S As Single
Dim Shared glop.w As OtherType 'glop.element has been changed into glop.w to avoid misunderstandment

S.t.Q = "Mio"
' it is legal to use DOT "." in the name of variable, so how can the Parser distinguish between an UDT and a simple variable?
S.t.S = 1.0

glop.w.element.i = 0
glop.w.element.d = 5.726E45
glop.w.element.s = "Home"
End
In Lubuntu and QB64pe 4.1.
Reply


Messages In This Thread
Illegal string-number conversion - by Herve - 07-02-2025, 07:02 PM
RE: Illegal string-number conversion - by Jack - 07-02-2025, 07:08 PM
RE: Illegal string-number conversion - by Herve - 07-02-2025, 07:25 PM
RE: Illegal string-number conversion - by TempodiBasic - 07-05-2025, 01:20 AM
RE: Illegal string-number conversion - by Herve - 07-06-2025, 08:54 AM
RE: Illegal string-number conversion - by a740g - 07-07-2025, 09:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Maximum Number of Attachments per Thread Magdha 7 482 01-13-2026, 10:13 AM
Last Post: Magdha
Question Experimenting with a "StringList" type for simpler handling of string arrays/lists Heimdall 18 1,248 12-19-2025, 12:51 PM
Last Post: Heimdall
  Sub not Reconizing Dim as String pmackay 18 1,477 10-16-2025, 03:32 PM
Last Post: pmackay
  Conversion From CBASIC eoredson 0 360 10-07-2025, 01:05 AM
Last Post: eoredson
  getting the number of dimensions in an array on the fly? madscijr 7 748 09-16-2025, 12:34 AM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)