New features in 4.60 compiler?
Posted: Tue Dec 27, 2011 10:46 pm
Does anybody know if there's a complete list of enhancements made to the 4.60 compiler?
The reason I'm interested is that I found a useful new feature and I wonder what else is in there.
Somebody asked for @"string" to be allowed in Data statements a while back (sorry I don't remember who) and I found out it's been implemented in the compiler. I can't see any mention of it in the history.
A short compilable example showing how it allows data tables to be directly created and used.
Some of the stuff I make in PB has huge data tables and this feature is VERY helpful to me.
If everybody else already knew about this, I apologize for the noise.
The reason I'm interested is that I found a useful new feature and I wonder what else is in there.
Somebody asked for @"string" to be allowed in Data statements a while back (sorry I don't remember who) and I found out it's been implemented in the compiler. I can't see any mention of it in the history.
A short compilable example showing how it allows data tables to be directly created and used.
Code: Select all
EnableExplicit
Structure TRec ; each entry in table
RType.a
RStat.a
RPad.w
sTitle.s
sDesc.s
EndStructure
Structure TRecList
Recs.TRec[0]
EndStructure
Procedure PBMain()
Protected.l i
Protected.TRecList *x = ?StartTable ; constant table is ready for use now
For i = 0 To 3
With *x\Recs[i]
PrintN(LStr(\RType) + #TAB$ + LStr(\RStat) + #TAB$ + LStr(\RPad))
PrintN(\sTitle)
PrintN(\sDesc)
PrintN("")
EndWith
Next
DataSection
StartTable:
Data.a 1, 10
Data.w 1024
Data.i @"Title 1: this is it", @"Desc 1: not much to say here"
Data.a 2, 20
Data.w 2048
Data.i @"Title 2: the title of the 2nd record" , @"Desc 2: abcdefghijklmnopqrstuvwxyz"
Data.a 3, 30
Data.w 4096
Data.i @"Title 3: nothing more" , @"Desc 3: nor here"
Data.a 4, 40
Data.w 8192
Data.i @"Title 4: this is the last test record" , @"Desc 4: see, I said it was the last one"
EndDataSection
EndProcedure
OpenConsole()
PBMain()
If everybody else already knew about this, I apologize for the noise.