Indenting scripts

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Indenting scripts

Shari-2
I finally installed LiveCode and the latest MC IDE 4.1 (had been
using Rev prior to LiveCode).  For the most part it all went smoothly
but I've encountered a really distracting issue.

I opened a project that was in-the-works and the script indent is
awry, making it very difficult to work.

Example:

on someHandler
get random(5)

if it is 1 then

    else if it is 2 then

       else if it is 3 then

           else if it is 4 then

                else if it is 5 then

                      end if
                         end someHandler

                         on someOtherHandler

                         end someOtherHandler


If I have not filled in some of the else-ifs yet, those get indented
additionally so that the end result is that the end of the handler is
not lined up with the beginning, even though there are no errors in
the handler. This additional indentation carries all the way down
thru subsequent handlers as well so that every handler after the
empty else-if is so indented that it's halfway across the window.

Sure I could put some bogus space filler in there but that sort of
negates how I work, which isn't from top to bottom.  I'm accustomed
to looking for the empty else-if's to fill in the blanks.  I'm also
accustomed to creating blank-shells handlers so that I know what
needs to be done.

Is there some way to fix the indents so that the only additional
indents are for script errors, and not empty places that I just
haven't filled in yet? This is driving me up a wall!

Shari


--
Bad Dog Books
http://books.gityasome.com
Critters, humor, patriots and sports t-shirts
http://www.bearsware.com
WlND0WS and MAClNT0SH shareware
http://www.gipsyking.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

J. Landman Gay
On 9/8/11 12:23 PM, Shari wrote:

> Is there some way to fix the indents so that the only additional indents
> are for script errors, and not empty places that I just haven't filled
> in yet? This is driving me up a wall!

Remove the carriage return between the "get random" line and the first
"if it is". Then the rest will align.


--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

Shari-2
>Remove the carriage return between the "get random" line and the
>first "if it is". Then the rest will align.

No luck.  I moved the first "if" right up under the "get" to no
avail.  It still doesn't align.
--
Bad Dog Books
http://books.gityasome.com
Critters, humor, patriots and sports t-shirts
http://www.bearsware.com
WlND0WS and MAClNT0SH shareware
http://www.gipsyking.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

J. Landman Gay
On 9/8/11 12:51 PM, Shari wrote:
>> Remove the carriage return between the "get random" line and the first
>> "if it is". Then the rest will align.
>
> No luck. I moved the first "if" right up under the "get" to no avail. It
> still doesn't align.

Works in 4.6.4.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

Shari-2
>On 9/8/11 12:51 PM, Shari wrote:
>>>Remove the carriage return between the "get random" line and the first
>>>"if it is". Then the rest will align.
>>
>>No luck. I moved the first "if" right up under the "get" to no avail. It
>>still doesn't align.
>
>Works in 4.6.4.
>


Ah. I'm at 4.6.3.

But that is confusing as 4.6.3/4.6.4 is the engine, and as far as I
know I'm using the latest MC IDE of 4.1.  Wouldn't this be an IDE
issue?


--
Bad Dog Books
http://books.gityasome.com
Critters, humor, patriots and sports t-shirts
http://www.bearsware.com
WlND0WS and MAClNT0SH shareware
http://www.gipsyking.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

J. Landman Gay
On 9/8/11 1:34 PM, Shari wrote:

>> On 9/8/11 12:51 PM, Shari wrote:
>>>> Remove the carriage return between the "get random" line and the first
>>>> "if it is". Then the rest will align.
>>>
>>> No luck. I moved the first "if" right up under the "get" to no avail. It
>>> still doesn't align.
>>
>> Works in 4.6.4.
>>
>
>
> Ah. I'm at 4.6.3.
>
> But that is confusing as 4.6.3/4.6.4 is the engine, and as far as I know
> I'm using the latest MC IDE of 4.1. Wouldn't this be an IDE issue?
>
>

Version 4.6.4 was released yesterday. Log into your LiveCode store
account and download the latest, if your license allows it.

It could be an IDE issue, I'm not sure. I know the engine does a lot of
the parsing, but I tested in LiveCode, not in the MC IDE. I don't use MC
often for actual development any more, I use it mostly just to test and
run existing stacks.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

Shari-2
>Version 4.6.4 was released yesterday. Log into your LiveCode store
>account and download the latest, if your license allows it.
>
>It could be an IDE issue, I'm not sure. I know the engine does a lot
>of the parsing, but I tested in LiveCode, not in the MC IDE. I don't
>use MC often for actual development any more, I use it mostly just
>to test and run existing stacks.

A day late, too funny!  I ended up creating a fake handler called
"filler" and sticking it in all the blank places that need to be
filled out.

I'd just spent several days upgrading two computers with LiveCode,
the MC IDE, and then discovering that LiveCode didn't like some of my
existing source code that had been rolling along happily for a
decade. I've had enough fun with upgrades and I think I'll sit tight
for the moment. I think I'd lose my marbles if I went through another
round of upgrading.

I did get to use the MC standalone builder for the first time since
the new incarnation. I likey! The Mac side worked flawlessly though I
did still need to make some manual changes to the plist file and a
couple other things inside the package.

The Win standalone builder failed, gave no reason for failing, so I
tried creating the Win version on the Mac and that worked flawlessly.
First time ever for building a standalone for one OS on another OS
and having it work happily.

"If it ain't broke, don't upgrade it."
:-)
--
Bad Dog Books
http://books.gityasome.com
Critters, humor, patriots and sports t-shirts
http://www.gityasome.com
WlND0WS and MAClNT0SH shareware
http://www.gipsyking.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

Ken Ray
In reply to this post by Shari-2

On Sep 8, 2011, at 1:34 PM, Shari wrote:

On 9/8/11 12:51 PM, Shari wrote:
Remove the carriage return between the "get random" line and the first
"if it is". Then the rest will align.

No luck. I moved the first "if" right up under the "get" to no avail. It
still doesn't align.

Works in 4.6.4.



Ah. I'm at 4.6.3.

But that is confusing as 4.6.3/4.6.4 is the engine, and as far as I know I'm using the latest MC IDE of 4.1.  Wouldn't this be an IDE issue?

Shari, sorry I didn't catch this earlier, but the answer is *yes*, it's an IDE issue... I put the script formatter in the MC IDE through a significant overhaul in IDE 4.1 and it looks like something crept in I hadn't tested for.

I'll fix the IDE and put out a new build as soon as I'm able. 

Sorry about that...

Ken Ray
Sons of Thunder Software, Inc.
Email: kray@...
Web Site: http://www.sonsothunder.com/


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Indenting scripts

Shari-2
>I put the script formatter in the MC IDE through a significant
>overhaul in IDE 4.1 and it looks like something crept in I hadn't
>tested for.

LOL!  One thing I've learned is that there is no such thing as a
simple code change :-)  There is always a domino effect.

Thank you for being so on top of it! I'll let you know if the updated
IDE fixes it :-)

Shari
--
Bad Dog Books
http://books.gityasome.com
Critters, humor, patriots and sports t-shirts
http://www.bearsware.com
WlND0WS and MAClNT0SH shareware
http://www.gipsyking.com

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard