Incorrect "VarSetCapacity" translation
Opened this issue · 5 comments
VarSetCapacity(UTF8, StrPut(Str, "UTF-8"), 0) ; old
UTF8:=BufferAlloc(StrPut(Str,"UTF-8"),0) ; new (incorrect)
UTF8 := Buffer(StrPut(Str, "UTF-8"), 0) ; should be this
v2 Error: This variable appears to never be assigned a value (Specifically: local BufferAlloc)
See: https://lexikos.github.io/v2/docs/objects/Buffer.htm#Call
hmmm, I'm using ahk_H v2,
it's BufferAlloc()
and ahk_L v2, it's Buffer()
thankfully, they're very similar
I could add an option so the user chooses : AHK_H or AHK_L
is there a better way than adding this as a true/false parameter ?
@jNizM , so in this website https://fupeijiang.github.io/ahk_parser.js/
which UI do you want to use to choose between AHK_H or AHK_L ?
-
toggle ? https://www.w3schools.com/howto/howto_css_switch.asp
-
toggle with text inside ? https://stackoverflow.com/questions/39846282/how-to-add-the-text-on-and-off-to-toggle-button#39846603
-
checkbox ? https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_checkbox
-
HOTKEY : ^g ? I see myself using hotkey (javascript addEventListener)
-
2 buttons :
convert to AHK_H
andconvert to AHK_L
, hmmm, this looks good : minimal input from user
I could save state and use this to show which version it's converting to (when you paste into it without using button)
https://stackoverflow.com/questions/309081/how-do-you-create-a-toggle-button#309318
Like the 2 Buttons you got. But put them over the Inputboxes.
- After press the Buttons the default inputbox-text should change to from ahk-h to ahk-l
- After pressing your background changed from white to black. Make also a Button for Light and Night Theme.
But put them over the Inputboxes.
wdym by "over the inputboxes" ?
- After press the Buttons the default inputbox-text should change to from ahk-h to ahk-l
done, now the hotkey is : ^+f to change AHK version.
Make also a Button for Light and Night Theme.
I think it looks good for both, white background: grey button on white, black background: white button on black.
idrk how to theme though
you change the theme and screenshot ? and send me colors HEX ? or tell me how should be themed ? I'll try if I like it more
Just a view ideas
https://gist.github.com/jNizM/ec43a04936612d4c1496f143643d8d8c