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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Preserving multi-dim arrays Pete 5 416 12-19-2025, 03:17 PM
Last Post: Dimster
  Arbitrary CONST values Unseen Machine 31 2,891 10-29-2025, 05:44 AM
Last Post: bplus
  Array out of passing arrays... Pete 2 408 09-22-2025, 08:53 PM
Last Post: ahenry3068
  Huge array of variable length strings mdijkens 9 1,840 10-17-2024, 02:01 PM
Last Post: mdijkens
  An Array v's A Dictionary Dimster 10 1,877 10-08-2024, 06:59 PM
Last Post: TempodiBasic

Forum Jump:


Users browsing this thread: