Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
suggestion: initialize array values within the DIM statement
#7
(12-21-2022, 03:36 AM)bobalooie Wrote: How difficult would it be to implement something similar to this in QB64PE? 

OPTION _EXPLICIT
DIM AS LONG LNUMS(5) = {1, 2, 5, 8, 4000}

This is syntax similar to C, and it is also supported to an extent by FreeBASIC. I have used this construct in FreeBASIC, and I have found it useful when initializing short arrays of 'fixed' data in a program.

(I always use OPTION _EXPLICIT, it has saved me more than a few times from fat-fingered typing.)

This would definitely be a nice feature - a function like what @mnrvovrfc (how do you pronounce that anyway?!) should work. When I am at my PC, I'll give it a try. Thanks mnrvovrfc!
Reply


Messages In This Thread
RE: suggestion: initialize array values within the DIM statement - by madscijr - 12-21-2022, 06:17 PM



Users browsing this thread: 1 Guest(s)