QC Code Editor

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #6212

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347

    This video is almost 30 minutes long and it’s basically just me writing and testing code while I explain what I am doing so, if that isn’t your cup of tea you probably won’t enjoy this video.

    #6183

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347
    #6182

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347

    BONUS:

    If you watched the video you know what the findTail function does but, I never showed it in the video. I’d like to share it cause, it’s a very simple function but it works for any delimiters. It’s most common use would be like findTail(“{“, “}”); but it can be used like this as well findTail(“=”, “;”);

    /**	FIND_ACTUAL_CLOSING_DELIMITER_FOR_NEXT_INSTANCE_OF_OPENING_DELIMITER
     * @param	open	- the opening delimiter
     * @param	close	- the closing delimiter
     * @param	txt		- the text to search or if omittied caretLinetext is used
     * @return	close delimiter character index
     */
    public function findTail(open:String, close:String, txt:String = ""):int
    {	var count:int = 0;
    	var reg:RegExp = new RegExp('[\\' + open + '\\' + close+']', "g");
    	var result:Array = reg.exec((!txt.length)?caretLineText:txt);
    	
    	while(result != null)
    	{	if ((count += (result[0] == open)?1:((result[0] == close)?-1:0)) == 0) return reg.lastIndex;
    		result = reg.exec((!txt.length)?caretLineText:txt);
    	}
    	
    	return -1;
    }
    
    #6174

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347

    I laid the groundwork for a directory tree. Right now it only prints the information to my console.

    It was actually very very simple to get the meat of this feature tenderized. It’s just one simple little function. I didn’t even bother to add event listeners to it. The only thing an event listener would do is tell me COMPLETE, PROGRESS or FAIL. Since there will not be a way to manually input directories (you will have to browse) there isn’t going to be a FAIL. Also, I’m loading it all async so it will show up when it’s done. If I was loading something I would use some listeners but, this is literally just collecting folder/file names/data.

    click for fullscreen

    I put so much focus on checking for “zipped” files because, long ago I wrote scripts that can open most “zipped” formats. I intend to eventually treat “zips” like a directory. So, just like you can expand a folder to view it’s contents you will be able to expand a “zip”. The only “zip” format that I never wrote a parser for is RAR but, there is a commandline tool that will unzip RAR files. I can bury that in the application directory and “silently” send it files to unzip/list for me.

    I wrote the directory list function to work cyclically. Maybe that’s not the best word so I will explain.

    I call directoryTree() get an array of listings and loop them into display elements. Each display element will have a MOUSE_DOWN or CLICK listener that calls directoryTree() on it’s own path. So browsing for the initial directory and navigating within it all just keep calling directoryTree(). It’s like a self-fulfilling prophecy or summin’.

    #6173

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347
    #6138

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347
    #6131

    OneMadGypsy
    Participant
    • topics: 47
    • replies: 347

    Thanks, Mr. Burns!

    There is a very long way to go on this one. Making just a generic text editor is a lot of work. Making a script editor is substantially more. I have a lot of ideas. The current state and features are only 3 or 4 drops in the bucket.

    #6125

    Monty Burns
    Moderator
    • topics: 5
    • replies: 47

    Some very nice features there MG, keep up the good work. From my perspecfive it’s starting to look quite slick but I wonder what features QC coders like Zop, Spike, SOC and Slot would find espeically useful.

    Kind regards

    Monty

    =====================
    Mr. Burns
    My little OOT project thing - Demo download
    top | reply

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.