Sign in to follow this  
Followers 0
Markus

#region at scite

10 posts in this topic

Hi!

As my new script is quite long, i wanted to add regions, but if i do:

#region

...

...

Case ....

#endregion

The "Case" doesnt belong to the region somehow, if i close the upper region in the scite editor, the "case" isnt closed.


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites



Are you using the latest Scite4AutoIt3 as that sounds like a old problem that was solved previously in the SciLexer.dll. This is with using Switch, EndSwitch with those Case statements?

Share this post


Link to post
Share on other sites

Hm i just updated but it still doesnt work


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

Works for me, maybe you could post a trimmed down piece of code that can duplicate the problem


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#region

Case
    
#endregion


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

Cant close "Case" with "#region"


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

#region

Case
    
#endregion
A 'Case' is closed by EndSelect If using [select] or a EndSwitch if using [switch].

I'm not sure I'm understanding your example or if your assuming that #endregion closes all items before automatically:

#region
Select
Case 1 = 1
    MsgBox(0, '', '')
#endregion
EndSelect
works

#region
Select
Case 1 = 1
    MsgBox(0, '', '')
EndSelect
#endregion
works

#region
Select
Case 1 = 1
    MsgBox(0, '', '')
EndSelect
Works even without the closing of the #region

#region
Select
Case 1 = 1
    MsgBox(0, '', '')
#endregion
Won't work because there is no closing of the Select

#region

Case 1 = 1
    MsgBox(0, '', '')
#endregion
Won't work because there is no Select/EndSelect

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This is a case of bad syntax gives bad folding.

This:

#region

    Case

#endregion

Is the same as:

#region

    Wend; or EndIF  etc...

#endregion

The case/EndIF/Wend/Next etc statements cause the folding to go 1 level to the left. This is the reason that the folding gets confused.......

Start with Select or Switch and things as they should.....

:lmao:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Right! I'm so stupid :lmao: I just saw #region in a script, tried it... and tried it wrong^^ Thank you


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0