mmikeww / AHK-v2-script-converter

AHK v1 -> v2 script converter
https://autohotkey.com/boards/viewtopic.php?f=6&t=25100
The Unlicense
578 stars 43 forks source link

Error: Parameter #1 of RegExMatch requires a String, but received a VarRef. #284

Closed grandich closed 3 months ago

grandich commented 3 months ago

When I try to launch QuickConvertorV2.ahk, I get this error:

Error: Parameter #1 of RegExMatch requires a String, but received a VarRef.

    ---- C:\Users\Admin\Desktop\AHK-v2-script-converter-master\Convert\MaskCode.ahk
    312: trail := tagChar . '#'
    314: pos := 1
▶   315: While (pos := RegExMatch(code, pattern, &m, pos))
    316: {
    317: mCode := m[]

Call stack:
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\Convert\MaskCode.ahk (315) : [RegExMatch] While (pos := RegExMatch(code, pattern, &m, pos))
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\Convert\MaskCode.ahk (315) : [PreMask.MaskAll] While (pos := RegExMatch(code, pattern, &m, pos))
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\Convert\MaskCode.ahk (505) : [maskMLStrings] MLSTR.MaskAll(&code, 'MQS', gMQSPtn)
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\ConvertFuncs.ahk (63) : [Before_LineConverts] maskMLStrings(&code)
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\ConvertFuncs.ahk (25) : [Convert] Before_LineConverts(&ScriptString)
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\QuickConvertorV2.ahk (128) : [AddSubFoldersToTree] TextV2Converted := StrReplace(StrReplace(Convert(TextV1), "
", "
"), "
", "
")
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\QuickConvertorV2.ahk (154) : [AddSubFoldersToTree] DirList := AddSubFoldersToTree(A_LoopFilePath, DirList, ItemID)
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\QuickConvertorV2.ahk (636) : [GuiTest] DirList := AddSubFoldersToTree(TreeRoot, Map())
C:\Users\Admin\Desktop\AHK-v2-script-converter-master\QuickConvertorV2.ahk (99) : [] GuiTest(TempV1Script)
> Auto-execute

image

grandich commented 3 months ago

I was running an old AHK version 2.0.4

Banaanae commented 3 months ago

~~Any reason for closing? And did this error occur just when running or when converting a script~~