Another very useful and nice feature that is for sure!! Thanks Eros.
Next preview version will have the possibility to assign multiple values in one go to array elements.
So the following syntax will be accepted:
[code=thinbasic]
ElementNumber = 1
MyArray(ElementNumber) = FirstValue, SecondValue, ..., nthValue
[/code]
thinBasic will assign FirstValue to MyArray(ElementNumber), SecondValue to MyArray(ElementNumber + 1) and so on. Equivalent code is
[code=thinbasic]
MyArray(1) = FirstValue
MyArray(2) = SecondValue
...
MyArray(nth) = nthValue
[/code]
This will be possible with any numeric, string or variant array.
An example example using variant array:
[code=thinbasic]uses "console"
Dim ArrayNamesAndValues(4) As variant
Dim Counter as long
ArrayNamesAndValues(1) = 1, "ABC", 123, "Hello world"
for Counter = 1 to 4
console_writeline ArrayNamesAndValues(Counter)
next
console_waitkey
[/code]
I'm still working on this new feature adding error checking (mainly bounds checking).
It will work also on multi dim array but only with one index following colum order. So for example if MyArray is a 4 x 3 matrix (4 lines, 3 colums) MyArray(5) will be in reality MyArray(2,1).
Hope you will like it.
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Another very useful and nice feature that is for sure!! Thanks Eros.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Yes,
I like it too.
It is logical and it will help improve parsing performance.
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Nice
This is now included in official release
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks