Viewing Intermediate Output

Discussion in 'Questions (Windows Mobile)' started by Steve, Aug 13, 2008.

  1. Steve

    Steve Member Licensed 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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can find the C# code under: C:\Documents and Settings\All Users\Application Data\Anywhere Software\Basic4ppc\6.0.0.0\Tzor
    On Vista it is under ProgramsData.
    Note that the generated code is not so easy to understand.

    If you like you can post the sub's code and I'm sure that we will be able to help you find the problem.
     
  3. Steve

    Steve Member Licensed 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
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. Steve

    Steve Member Licensed 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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice