my suggestion is to add a prefill-mechanism for arrays, like this:
Dim Test.s(2) = ("AA","BB","CC)
Instead of having to use:
Dim Test.s(2)
Test(0) = "AA"
Test(1) = "BB"
Test(1) = "CC"
(EDIT: added "having to use" to clarify

Omiting "Then" after "If" is no classic BASIC syntax, too.STARGÅTE wrote:Dim Test.s(2) = ("AA","BB","CC")
No Basic Syntax!
The main difference is, that jamirokwai's proposal is much better readable.STARGÅTE wrote:Use:
Dim Test.s(2) : Test(0) = "AA" : Test(1) = "BB" : Test(2) = "CC"
Code: Select all
Dim Test.s(1,2) = ("AA","BB","CC":"DD","EE","FF")
Code: Select all
Dim Test.s(1,2) = {{"AA","BB","CC"},{"DD","EE","FF"}}
Code: Select all
Dim Test.s(1,2) = { _
{"AA","BB","CC"}, _
{"DD","EE","FF"} _
}
Now, that is a great idea, I think!Little John wrote:My pre-processor probably will only support one-dimensional arrays.
Generally speaking, the programming language Euphoria (now free and open source) shows how this can be handled (IMHO) elegantly with arbitrary dimensions. Your example could look e.g. like this:
or, if line continuation is possible,Code: Select all
Dim Test.s(1,2) = {{"AA","BB","CC"},{"DD","EE","FF"}}
Regards, Little JohnCode: Select all
Dim Test.s(1,2) = { _ {"AA","BB","CC"}, _ {"DD","EE","FF"} _ }
Code: Select all
NewList Test.s() = {"AA","BB","CC"}
Code: Select all
NewMap Test.s() = {"Key1":"AA","Key2":"BB","Key3":"CC"}
Code: Select all
Structure Test
Long.l
String.s
Array Field.b(3)
EndStructure
Test.Test = {123,"Text",{1,2,3,4}}
Code: Select all
Structure XYZ
A.i
B.f
C.s
EndStructure
CopyMemory(?MyData, @SomeWhere, MySize)
DataSection
MyData:
Data.XYZ 10, 3.1415, "The Brown fox...."
Data.XYZ 12, 0.0010, ""
EndDataSection
PB does not support Multiline statements. That's why it's hard to read.STARGÅTE wrote:![]()
And for LinkedLists:And for Maps:Code: Select all
NewList Test.s() = {"AA","BB","CC"}
And for Structures:Code: Select all
NewMap Test.s() = {"Key1":"AA","Key2":"BB","Key3":"CC"}
Code: Select all
Structure Test Long.l String.s Array Field.b(3) EndStructure Test.Test = {123,"Text",{1,2,3,4}}
Code: Select all
NewList Test.s()
With Test()
"AA"
"BB"
EndWith
NewMap Test.s()
With Test()
(Key1, "A")
(Key2, "B")
EndWith
NewList Test.POINT()
With Test()
(10, 4)
(35, 95)
(45, 74)
EndWith