Suggestion for correcting the IDE's script editor

SimPLsol at aol.com SimPLsol at aol.com
Tue Jun 28 19:30:37 EDT 2005


In a message dated 6/28/05 3:24:45 PM, jbondy at sover.net writes:


> 
> > We could argue all month about style but
> 

As I said "We could argue all month about style " and, knowing this list, we 
will.
Putting "end" in line with the statements is inconsistent with the standard 
xTalk way of handling handlers:

on mouseUp
end mouseUp

on something
end something

if something
then
     doWhat
else
     doOther
end if

And the more nested repeats you have in a handler, the easier it is to read 
as formatted above -or below:

If something
then
     if subCommand
     then
          if something2
          then
               subCommand2
          else
               otherCommand2
          end if
     else
          altCommand
     end if
end if

It is very hard to see where nested conditionals end if the "end" is in line 
with the nested statement:
If something
then
     if subCommand
     then
          if something2
          then
               subCommand2
          else
               otherCommand2
               end if
     else
          altCommand
          end if
     end if

It gets worse with "inline thens":
If something then
     if subCommand then
          if something2 then
               subCommand2
          else
               otherCommand2
               end if
     else
          altCommand
          end if
     end if
I'm not still sure where that last "end if" goes, should it be indented 
further (to the "end if" on the line above)? No wonder the editor gets confused 
trying to align such scripts.
Paul Looney



More information about the use-livecode mailing list