[Gambas-devel] Yet another PING > Benoit

Kadaitcha Man nospam.nospam.nospam at ...176...
Wed Jan 20 13:10:53 CET 2010


No response required to this part:

The code below compiles fine, and it runs, however it experiences odd behaviour:

  For nZ = 0 To aName.Count - 1
    Letter = Mid(aSplitPhrase[iSplitPhrasePtr], 1, 1)
    If LCase(Letter) = LCase(Mid(aName[nZ], 1, 1)) Then
      aSplitPhrase[iSplitPhrasePtr] =
ReplaceFirstOccurence(aSplitPhrase[iSplitPhrasePtr], Letter, "/" &
Letter & "/")
      OutputText &= aSplitPhrase[iSplitPhrasePtr] & mConst.$crlf
      If iSplitPhrasePtr < aSplitPhrase.Count - 1 Then
        ' Don't point past end
        iSplitPhrasePtr += 1
      End If
^^^^^^^^^^^
    Else
      If Trim(aName[nZ]) = mConst.$empty Then
        OutputText &= Trim(aName[nZ]) & mConst.$crlf
      Else
        OutputText &= "/"
        OutputText &= Trim(aName[nZ])
        OutputText &= "/" & mConst.$crlf
      End If
^^^^^^^^^^^
    End If
^^^^^^^^^^^
  Next

At first glance, to the untrained eye, all looks well. However the
code has been copied from .NET 2008, pasted into gb3 and modified to
run under gb3.

Neither the editor nor the compiler recognises "End If" as an error.

In addition, "End Function" also causes other issues, which I won't go
into right now, even though the code compiles and runs, though there
are visibly verifiable problems in the IDE as a result.

The issue of "End" followed by some unknown statement is a big problem
for translation projects because it causes unnecessary debugging, and
despite my respect for you and the team regarding the work done to
date, the help text simply sucks and is not any help at all. The wider
issue is that gb's failure to reject obvious errors reflects more on
gb than it does on the programmer's knowledge of the language.

I would like a response to this, if you see fit:

My opinion is that, whilst I should be aware of these problems, gb
should still reject anything following the End statement that is not
expected. "If" and "Function" being two examples.

Comments also not requiring a response:

Of course, despite fixing the above, I still haven't found what is
causing the problem I'm trying to solve. I merely realised the above
as a problem while trying to sort out another problem :)




More information about the Devel mailing list