Viewing Intermediate Output

Steve

Member
Licensed User
Longtime User
Hello,

I am working on a B4P project, and although there is nothing syntactically wrong with the code, I am receiving the CS1002 error. Supposedly a ";" is expected on the line that reads, "End Sub." As far as I can tell, no loops, decision blocks, or other scoping constructs are out of order, so I want to look at the C# code being generated to figure out what's happening.

I understand that the translation process typically negates the need for the developer to even know about the CS code, but in this case it would be very helpful to read.

Any ideas?
 

Steve

Member
Licensed User
Longtime User
Thanks Erel. You are right; that code is really hard to read. Here are some snipets of what I have:

In Sub AppStart:
AddForm("frmClock","Test Form")
AddTimer ("tmrClock")
tmrClock.Interval = 1000
tmrClock.Enabled = True
AddEvent("tmrClock", Tick, "tmrClock_Tick")

And now the timer Sub:
Sub tmrClock_Tick
GetTime
If CheckAlarm = True Then Return
CheckQuarter
CheckHalf
CheckThreeQuarters
CheckHour
End Sub

It's this last "End Sub" that is causing the optimizing compiler to error out. CheckAlarm, CheckQuarter, etc are all boolean functions. What is odd is that the unoptimized version compiles, and B4P indicates the code is error free.

Since this is a port of an existing shareware product, I can't release the entire source code. If more snippets are needed, please let me know.

Thanks very much for the help.

Steve
 

Steve

Member
Licensed User
Longtime User
Hi Erel,

Thanks for the offer. After doing some massive surgery on my code, I found the problem. Several hundred lines down, I had a line which read:

pathToCheck = pathList.Item(i])

As this was a port from C, I somehow let the } slip by when I was porting to B4P. In a future version, would it be possible for the code parser to recognize mismatching expressions and coding errors such as
String3 = String1 + String2

I am really loving the speed increase that we can enjoy with the translation to .Net code. Thanks for all the work you've put into this product.

Best regards,
Steve
 
Top