SA-MP Forums Archive
[Tool/Web/Other] Code Indenter - Fast And Efficient and supports huge scripts. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Tools and Files (https://sampforum.blast.hk/forumdisplay.php?fid=82)
+---- Thread: [Tool/Web/Other] Code Indenter - Fast And Efficient and supports huge scripts. (/showthread.php?tid=571538)



Code Indenter - Fast And Efficient and supports huge scripts. - Ahmad45123 - 19.04.2015

Ahmed's Code Indenter


Description:
Hello everyone, I am back with a new tool.
I actually need this for some personal stuff, However I decided to release it if someone else need it.

This is basically a code indenter but its very fast on huge scripts as it uses another thread to process the code which doesn't make the app crash, It takes like 30 seconds to process a 100K lines script.

All what you have to do is just press the "..." button and choose a file than click start.
And the app will create a new file in the same directory called "NAME_OF_FILE_fixed" so if the file was test, the fixed file will be test_fixed.

Examples of output:

This:
PHP Code:
Fucntion()
{
Function2()
{
hgfhfgh
}
Fucntion3()
{
Function4()
{
Function5() { SOME CODE HERE }
if(
dfdsf)
{
gfdgfdg
}
}
}
}
Functiondfs()
{
Function2()
{
}
Fucntion3()
{
Function4()
{
Function5() { SOME CODE HERE }
if(
dfdsf)
{
}
}
}

Became:
PHP Code:
Fucntion()
{
    
Function2()
    {
        
hgfhfgh
    
}
    
    
Fucntion3()
    {
        
Function4()
        {
            
Function5() { SOME CODE HERE }
            
            if(
dfdsf)
            {
                
gfdgfdg
            
}
        }
    }
}
Functiondfs()
{
    
Function2()
    {
        
    }
    
    
Fucntion3()
    {
        
Function4()
        {
            
Function5() { SOME CODE HERE }
            
            if(
dfdsf)
            {
                
            }
        }
    }

Download:
V1.1: http://www.mediafire.com/download/4j...denter_1.1.rar
Source: http://www.mediafire.com/download/0y...ter-source.rar
Thanks and don't forget to leave a reply or REP


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Karan007 - 19.04.2015

Nice job!


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Abagail - 19.04.2015

What's the difference between this and this?
https://sampforum.blast.hk/showthread.php?tid=480613


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Pottus - 19.04.2015

I don't see a need for this at all if your coding your scripts correctly indentation is a non-issue.


Re: Code Indenter - Fast And Efficient and supports huge scripts. - GWMPT - 19.04.2015

Well... Source code?


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Ahmad45123 - 19.04.2015

Quote:
Originally Posted by Abagail
View Post
What's the difference between this and this?
https://sampforum.blast.hk/showthread.php?tid=480613
That one is a textbox in a site, Copying/pasting 100K lines causes too much LAG.(for me)
This one you choose the PWN file itself.
However, It doesn't touch the main file incase if any bugs happen.
A new file is created with the indention.

Quote:
Originally Posted by GWMPT
View Post
Well... Source code?
Totally forgot about it... I am out of home now, Will upload it when I go home.


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Adawg - 19.04.2015

Uhoh? Since I haven't the time to test it, If I have an shitty indentation like I use in the exemple does it will fix it correctly?

PHP Code:
// example :
public blablabla(playerid)
{
        if(
blablabla[playerid] >= 1)
    {
         
blablabla[playerid] = 0;
             return 
1;
    }
return 
1;

PHP Code:
// fixed : 
public blablabla(playerid)
{
    if(
blablabla[playerid] >= 1)
    {
         
blablabla[playerid] = 0;
         return 
1;
    }
    return 
1;




Re: Code Indenter - Fast And Efficient and supports huge scripts. - feartonyb - 19.04.2015

Very nice job REP


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Ahmad45123 - 19.04.2015

Quote:
Originally Posted by Adawg
View Post
Uhoh? Since I haven't the time to test it, If I have an shitty indentation like I use in the exemple does it will fix it correctly?

PHP Code:
// example :
public blablabla(playerid)
{
        if(
blablabla[playerid] >= 1)
    {
         
blablabla[playerid] = 0;
             return 
1;
    }
return 
1;

PHP Code:
// fixed : 
public blablabla(playerid)
{
    if(
blablabla[playerid] >= 1)
    {
         
blablabla[playerid] = 0;
         return 
1;
    }
    return 
1;

That's the main purpose of the program... lol

TlR: Yes, i will.


Re: Code Indenter - Fast And Efficient and supports huge scripts. - Ahmad45123 - 20.04.2015

Added source code.