Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New and improved SICK project
#26
(09-28-2022, 05:03 AM)eoredson Wrote: btw; what is "as" without any preceding variable?
I had forgotten to tell you a few days ago that a line beginning with "AS" has to be inside the definition of an UDT (User-Defined Type). This is to declare more than one field of the same type without extra typing. The same could be done with "DIM" (global) or "STATIC" (inside subprograms only) to declare multiple variables of the same type. For example:

DIM A AS INTEGER, B AS INTEGER, C AS INTEGER, D AS INTEGER

could be written as:

DIM AS INTEGER A, B, C, D

Inside an UDT, however, the "old" style forced multiple lines or colons to be used to declare multiple fields, even if they were of the same type. Consider this:

TYPE MYUDT
AS INTEGER A, B, C, D
END TYPE

instead of this:

TYPE MYUDT
A AS INTEGER
B AS INTEGER
C AS INTEGER
D AS INTEGER
END TYPE

which would have had to be typed in QuickBASIC or QBasic. The "new" style for UDT looks a bit confusing but it's meant to save time typing stuff. This is even more important if the program is subjected to "OPTION _EXPLICIT" in which every variable must be declared.
Reply


Messages In This Thread
New and improved SICK project - by eoredson - 09-20-2022, 04:44 AM
RE: New and improved SICK project - by mnrvovrfc - 09-24-2022, 02:52 AM
RE: New and improved SICK project - by mnrvovrfc - 09-24-2022, 08:06 PM
RE: New and improved SICK project - by eoredson - 09-27-2022, 06:21 AM
RE: New and improved SICK project - by eoredson - 09-28-2022, 03:11 AM
RE: New and improved SICK project - by mnrvovrfc - 09-28-2022, 04:39 AM
RE: New and improved SICK project - by eoredson - 09-28-2022, 05:03 AM
RE: New and improved SICK project - by mnrvovrfc - 10-06-2022, 11:34 PM
RE: New and improved SICK project - by mnrvovrfc - 09-28-2022, 07:02 PM
RE: New and improved SICK project - by Pete - 09-28-2022, 03:48 PM
RE: New and improved SICK project - by aurel - 09-28-2022, 09:34 PM
RE: New and improved SICK project - by eoredson - 09-29-2022, 04:45 AM
RE: New and improved SICK project - by Pete - 09-28-2022, 09:46 PM
RE: New and improved SICK project - by mnrvovrfc - 09-30-2022, 04:25 PM
RE: New and improved SICK project - by eoredson - 10-01-2022, 02:30 AM
RE: New and improved SICK project - by eoredson - 10-01-2022, 03:58 AM
RE: New and improved SICK project - by mnrvovrfc - 10-04-2022, 02:20 PM
RE: New and improved SICK project - by eoredson - 10-06-2022, 12:44 AM
RE: New and improved SICK project - by mnrvovrfc - 10-06-2022, 05:12 AM
RE: New and improved SICK project - by aurel - 10-06-2022, 07:09 PM
RE: New and improved SICK project - by mnrvovrfc - 10-06-2022, 08:05 PM
RE: New and improved SICK project - by bplus - 10-06-2022, 07:46 PM
RE: New and improved SICK project - by aurel - 10-07-2022, 11:39 AM
RE: New and improved SICK project - by aurel - 10-07-2022, 12:00 PM
RE: New and improved SICK project - by mnrvovrfc - 10-07-2022, 11:41 PM
RE: New and improved SICK project - by mnrvovrfc - 10-12-2022, 05:19 PM
RE: New and improved SICK project - by eoredson - 10-21-2022, 03:15 AM
RE: New and improved SICK project - by mnrvovrfc - 10-21-2022, 07:03 AM
RE: New and improved SICK project - by eoredson - 03-11-2023, 04:34 AM
RE: New and improved SICK project - by eoredson - 04-07-2023, 03:52 AM
RE: New and improved SICK project - by eoredson - 09-15-2023, 12:17 AM



Users browsing this thread: 4 Guest(s)