mmikeww / AHK-v2-script-converter

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

SB_SetParts results in error #215

Closed andymbody closed 5 months ago

andymbody commented 5 months ago

V1:

SB_SetParts(212, 180, 212, 144, 62)

V2 (Converted):

Error, invalid index 4

V2 (Expected):

SB.SetParts(212, 180, 212, 144, 62)

This is due to SB_SetParts reference in FunctionsToConvertM having improper params. The current params are a copy/paste of SB_SetText. The SB_SetParts function is variadic and can have 1-255 params. I'm not sure what to do in this case. What should the conversion params be set to for variadic functions?

Should it be set to '*', then check for this during conversion and enumerate the params rather than trying to follow a static number of params reflected in FunctionsToConvertM. That is easy enough but wanted to check to see if there is already an established plan of attack for these (there probably is, yes)?

Banaanae commented 5 months ago

Should be an easy fix, I'll merge your pr and fix this

Banaanae commented 4 months ago

Should've added if you ever have a similar issue your correct with adding a * SB_SetParts(Width*)