I've been working on a precompiler for DBP which changes its syntax to be more akin to a curly bracket language (i.e. C/C++).
For example:
If x=y
Endif
`Becomes
If x=y
{
}
The same syntax is used for all conditional statements, so:
Do
Loop
`Becomes
Do
{
}
`You can also do this:
For t=1 to 10{
...}
`However, the following is incorrect:
While 1=1 { ... }
The precompiler also introduces a major change to the syntax of select statements:
`Normal DBP
Select X
case 1
...
endcase
case default
...
endcase
Endselect
`DBP w/precompiler
Select X {
Case 1
default
}
`No endcase is nessacary, and "case default" becomes "default"
The final advantage my precompiler brings is the 'Enum' statement. For those who've never encountered this statement in another language it allows you to list a group of constants which increase/decrease in value in order:
`Normal DBP
#Constnat X 1
#Constnat Y 2
#Constnat Z 3
`DBP w/precompiler
Enum 1 {
X
Y
Z
}
The 'Enum' statement takes the following format, where parts in []s are optional:
Enum [Starting Value] [Step] [Step Value] {
}
`A step value can be given without a starting value. The default starting value is 0 and the default step value is 1.
`You can also assigin a constant in the enumeration a different value than it would otherwise be given, and then the enumeration will continue from that new value i.e:
Enum 10 Step 5 {
X `Will be 10
Y `Will be 15
Z `Will be 20
XX 7 `Will be 7
XY `will now be 13
}
I'm fairly confient that my precompiler is bug-free, but I'm having some difficulty connecting it to the actual DBP compiler, so that's why I'm posting here. If anyone knows how to do this, I'd welcome their help (evil_grunger@*NOSPAM*hotmail.com).
As it stands you drag-n-drop your source file over the DBP++ exe and it will process it and OVERWRITE the original file, you'll then have to compile it manually via the DBP compiler, but I will get this fixed in later versions.
Enjoy!
~Heed my word hobags: Jism~