Comment by vunderba

18 hours ago

So I think you're talking about TYPES.

  TYPE PERSON
    AGE AS INTEGER
    FIRSTNAME AS STRING * 12
  END TYPE

  DIM KURTZ AS PERSON


  PRINT KURTZ._

You could do something like this, but it wouldn’t provide any kind of code completion or autocomplete to show the AGE/FIRSTNAME fields where the underscore represents the text cursor.

However you are right that if you hit F1 on KURTZ it would then show User defined PERSON, and then you could hit F1 again and it would show built-in help of user defined TYPE with AGE/FIRSTNAME properties. Sort of like context-sensitive help I guess.

As far as subroutines/functions go, if you tried to pass data into a subroutine where the data couldn’t be coerced, it would just give you a generic type mismatch.

  DIM Y AS SINGLE
  Y = 10.5

  PRINTIT  Y   ' Throws parameter type mismatch
  PRINTIT (Y) ' Succeeds through a self-evaluated expression which is effectively BYVAL because Microsoft takes pain in your suffering.

  SUB PRINTIT (X%)
    PRINT X%
  END SUB

But to your point, you could point at PRINTIT and hit F1 and get a quick symbol look-up.

I've spent the last 6 months building a similar 1:1 faithful recreation of QBASIC and QuickBasic 4.5 that runs natively in the browser [1] - so I know way more about this than anyone should by right.

[1] - https://mordenstar.com/share/qbasic-core-demos