array initialization

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

array initialization

Post by Tenaja »

When working with string-heavy apps, the inability to initialize arrays is my biggest PB pet peeve. (Or, rather, the thing I miss most about C.) Please, please, please add it.

Code: Select all

TestStringArray.s() = ("one", "two", "three","middle", "four", "five", "six", "end")
TestNumArray.i() = (1, 2, 3, 0, 4, 5, 6, 0)
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: array initialization

Post by STARGÅTE »

Why do you post this topic again?
Prefill Array

Please read the answers there!
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: array initialization

Post by Tenaja »

Because the term "prefill" is not something I have ever heard of! As such, that thread did not show up in my searches.

I have always called it "Initializing" the variable. Even the PB Help file describes it: "assign an initial value to the variable."

...but thanks for the link--Little John mentions it in conjunction with his preprocessor (pre-processor). I'll have to search for that tool...

In the meantime, it sounds like I, and others, would still like this feature. Why does PB give us the ability to initialize a single variable, but not an array???
Post Reply