Thread: General Sorting Tool For Sorting Functions And Their Blocks Of Code Into A Language

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    5

    General Sorting Tool For Sorting Functions And Their Blocks Of Code Into A Language

    Hi. Maybe someone can help me. I am not a programmer and have wound up with a large programming task. I'm using Actionscript, but that's irrelevant to my issue (asking why I'm using Actionscript is a fair question - I was visually impaired during the lengthy creation of the program, and could not learn C whereas Actionscript was a no brainer - now this program is basically a huge concoction and I would like to pay someone to create a similar program in C, but thus far I have not found someone with the necessary backgrounds).

    Basically I've gotten a huge list of functions and thousands of lines of code, and excel does not seem to be able to sort the code without altering it. I.e. I can't easily copy and paste the code from Excel even if I entered it and sorted it. So I'm hoping to find the best tool keeps the function names associated with their respective function code blocks, and lets one sort these blocks in terms of function name. I already have a scheme that logically handles the ordering by name, so once I have such a sorting it will be much easier to add new functions to the right places.

    If you could help me I would be mucho grateful.

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Open your ActionScript in Notepad++. It's an editor with a tool called functions list right on the toolbar - lists all of your functions sorted and moves around your source file when you click on a name.

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    5
    Quote Originally Posted by whiteflags View Post
    Open your ActionScript in Notepad++. It's an editor with a tool called functions list right on the toolbar - lists all of your functions sorted and moves around your source file when you click on a name.
    I'm game. I installed it, and loaded my code, but my function names appear as part of the whole text with all functions. What I seek to do is sort functions by their function names - so that I can use this as an index of the function names as I continue to code. Because there are close to 500 and they're in a half-assed order and its a pain to search and find out if I've already entered one, and I need to improve the naming convention and add a lot more.

    I realize it must be a very, very basic thing, but the truth is I don't know what I'm doing.

    I'm not seeing a help file with the basics for doing sorting of functions by their function names. Could someone point me to a description of it?
    Last edited by jesussaddle; 02-26-2017 at 09:39 PM.

  4. #4
    Guest
    Guest
    I haven't used Notepad++ in a long time, but can't you "collapse" the functions in the editor and use CTRL+UP/DOWN (or whatever moves whole lines) to move them, along with their blocks? This way you might be able to get them into a sorted order by hand in an hour. Once that order is established, you can browse through the list and add any new function in the right spot from the beginning. I think that's what I would try.

    If you insist in having a program do this after the fact, and your ActionScript functions are consistently written using the same syntax, e.g.
    Code:
    function some_fun()
    {
        code_here;
    }
    ... then I'm sure this re-ordering could be done with a fairly simple (Python) script that someone could write for you.

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    5
    Maybe the process of collapsing isn't automatic in my case. Or maybe I don't understand how the "collapse" process works. Do I need to highlight part of the text first? I need to figure out how to get the code into its levels maybe. In the mean time I could try to find a video on "collapsing" in a text editor, since I hadn't seen this capability before; very new to all this!

    Edit: I was able to figure out how the collapse function works once I realized what the Language menu did. Lol.
    Last edited by jesussaddle; 02-27-2017 at 02:00 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting this in C language.
    By MF1991 in forum C Programming
    Replies: 27
    Last Post: 01-27-2013, 10:51 AM
  2. Sorting C Language
    By MF1991 in forum C Programming
    Replies: 2
    Last Post: 01-26-2013, 11:54 PM
  3. Replies: 21
    Last Post: 07-15-2012, 05:20 PM
  4. HELP with srand(time()( in Code::Blocks (C language)
    By Italikus in forum C Programming
    Replies: 4
    Last Post: 06-22-2011, 02:06 PM
  5. Sorting words with a fast, effincient sorting method
    By Unregistered in forum C++ Programming
    Replies: 19
    Last Post: 07-12-2002, 04:21 PM

Tags for this Thread