Re: Help! GO TO and PERFORM THRU!



On Mar 1, 6:53 am, "Michael Mattias" <mmatt...@xxxxxxxxxxxxxx> wrote:

I find the same thing in BASIC.

These mean the same thing...
IF Condition1 THEN
DoSomething1
END IF
(called 'block if')

and
IF Condition1 THEN DoSomething1
(called "single-line if")

But you can mix and match and boy, that IS confusing...

In Python the scope of a conditional is entirely controlled by the
indenting. The scope ends when you outdent. This means the the
compiler follows the same rules that you do with your eyes.

if ( condition1 ):
if ( condition2 ):
action2only
another actio2
action1

You must ensure that the editor does not use tab characters, or only
uses tabs otherwise it is impossible to get it to work.

In Python you can't write code that looks confusing.

.



Relevant Pages

  • Re: Help! GO TO and PERFORM THRU!
    ... IF Condition1 THEN DoSomething1 ... The scope ends when you outdent. ... You must ensure that the editor does not use tab characters, ... In Python you can't write code that looks confusing. ...
    (comp.lang.cobol)
  • Re: Possible Compiler Bug (C# 3.0)
    ... "A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i', which is already used in a 'child' scope to denote something else" ... int i = 0; ... while (condition1) ...
    (microsoft.public.dotnet.languages.csharp)