CodeQuickTester - Write and run code without touching the file system

Post your working scripts, libraries and tools
GeekDude
Posts: 741
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

29 Jan 2015, 11:51

The working directory will be the same as the working directory of the code tester. The actual script directory will be \\.\pipe, and I'm not sure what happens if you try to write normal files there
User avatar
boiler
Posts: 1912
Joined: 21 Dec 2014, 02:44

Re: CodeQuickTester

29 Jan 2015, 11:58

OK. Thanks.

btw, I'm using this so much, I even created a nice multi-resolution icon for it so it shows up on my toolbar and taskbar nicely.
User avatar
boiler
Posts: 1912
Joined: 21 Dec 2014, 02:44

Re: CodeQuickTester

29 Jan 2015, 12:07

Ha, no, it's fine, I guess. But it just looks like a generic AHK script is running. I guess it's really not to be confused because it's not the H on green background.
User avatar
cyruz
Posts: 243
Joined: 30 Sep 2013, 13:31

Re: CodeQuickTester

29 Jan 2015, 13:24

GeekDude wrote:Because that would ruin the lightweight single-file thing I'm going for.


KISS principle!

GeekDude wrote:Besides, you don't actually need the console class unless you want to do crazy stuff. Simple console output can be done in two lines:

Code: [Select all] [Download] GeSHi © Codebox Plus

DllCall("AttachConsole") ; Top of script
FileOpen("CONOUT$", "w").Write("Some text") ; Wherever you want to print


However, this wouldn't really help much, seeing as there's already a pretty good built-in method of showing the user error messages.


Thank you, I forked your version adding a minimal console support, you find it here: https://gist.github.com/cyruz-git/d6078ec6fa6b3c6dedac

So that this code can be used:

Code: [Select all] [Download] GeSHi © Codebox Plus

Loop C:\Windows\*.exe
WriteCon(A_LoopFileName "`n")


You were refering to the AllocConsole function I guess. As it is now, when you close the console the dynamic script is forcefully closed I think, because the icon is still present in the tray. Any advice on how to fix this?
Last edited by cyruz on 27 Feb 2015, 08:28, edited 1 time in total.
ABCza on the old forum.
My GitHub.
GeekDude
Posts: 741
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

29 Jan 2015, 13:30

You could embed the console into your own GUI (where you can then handle the close event manually), as done in my demo code here https://github.com/G33kDude/Console/blo ... /Embed.ahk

Though, it's a slightly silly workaround. I'm not sure how to do it "properly"
User avatar
cyruz
Posts: 243
Joined: 30 Sep 2013, 13:31

Re: CodeQuickTester

29 Jan 2015, 15:38

GeekDude wrote:You could embed the console into your own GUI (where you can then handle the close event manually), as done in my demo code here https://github.com/G33kDude/Console/blo ... /Embed.ahk

Though, it's a slightly silly workaround. I'm not sure how to do it "properly"


Tried, it's nice but too much code gets added to the script.

I found a small workaround using SetConsoleCtrlHandler, so now the script get terminated when clicking on the X button and when pressing CTRL+C.
I updated the code: https://gist.github.com/cyruz-git/d6078ec6fa6b3c6dedac
Last edited by cyruz on 27 Feb 2015, 08:29, edited 1 time in total.
ABCza on the old forum.
My GitHub.
GeekDude
Posts: 741
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

01 Feb 2015, 11:44

Soft wrote:I really like this! good work


You might want to refrain from pasting to IRC under my name. Gets a tad confusing, you know. In fact, you might consider updating to fix the whole "default name is GeekDude" thing
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: CodeQuickTester

04 Feb 2015, 20:11

Nice!, how about making syntax highlight using Scilexer.dll? or am I going too far :D
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
boiler
Posts: 1912
Joined: 21 Dec 2014, 02:44

Re: CodeQuickTester

04 Feb 2015, 23:17

What would be wrong with having a similar tool for those of us that don't use AHK Studio?

Don't get me wrong. I like the tool, but is there a reason to hold back features if they would be useful?
GeekDude
Posts: 741
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

04 Feb 2015, 23:19

Nothing would be wrong, I suppose. However, I'd need to borrow AHK Studio's lexer and a ton of other code from it. Or I could use fincs', but I'm closer to maestrith than fincs. Additionally, it'd be likely to increase the number of bugs greatly, and I don't have an update system like Studio does.
User avatar
boiler
Posts: 1912
Joined: 21 Dec 2014, 02:44

Re: CodeQuickTester

04 Feb 2015, 23:26

Understood. Sometimes "better" is the enemy of "good enough" anyway.

Some intelligent indenting would be nice. That would be more useful to me than the syntax highlighting. Maybe that's the same issue, though. I don't mean it would have to recognize braces and Loop commands and stuff. Just tab over to the same place as the line above it or something like that.
Last edited by boiler on 04 Feb 2015, 23:27, edited 1 time in total.
GeekDude
Posts: 741
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

04 Feb 2015, 23:27

I do want to implement auto-indent, but that's still a while off as I've got other projects I'm working on as well.
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: CodeQuickTester

18 Feb 2015, 07:05

I guess this will help you!

FFAAS - Flicker Free and Anti Shake by szujeq
it blocks flickering gui during user resize window

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus



and add command to your CodeQuickTester script

#Include <FFAAS>

Gui, Main:New, +Resize +LastFound
MainF := WinExist()

Gui, Show, w640 h480, %Title%
FFAAS.Inclue(MainF)
FFAAS.Enable()
return :dance:
AutoHotkey & AutoHotkey_H v1.1.22.07
GeekDude
Posts: 741
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

18 Feb 2015, 09:39

That is just barely over twice as long as the original script, which does not have any significant issues with resizing. Nearly every resizeable program I have has this "issue" that is even present in Windows Explorer. It's normal behavior, and can be mitigated slightly by adding SetBatchLines, -1 to the top of the script.

Additionally, that script (which may be well thought out, I'm not sure) is not particularly well written, and would require me to comb through for problems. Just glancing through, for example, he is not specifying return types for his DllCalls, and he has random bits of extra code commented out everywhere.
User avatar
tomoe_uehara
Posts: 184
Joined: 05 Oct 2013, 12:37
Contact:

Re: CodeQuickTester

19 Feb 2015, 01:08

Will it be possible in the future that you add support for theme?
Probably taken from the currently widely used AHK Editor such as AHK Studio or Scite4AHK (or any other editors), so you don't have to reinvent the wheel..

Image
User avatar
cyruz
Posts: 243
Joined: 30 Sep 2013, 13:31

Re: CodeQuickTester

27 Feb 2015, 08:32

I forked your recent version and added back the console support, but without code in the main section (I added a couple of static vars in the writecon function).

Thanks for keeping updating it!
ABCza on the old forum.
My GitHub.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 20 guests