mmikeww / AHK-v2-script-converter

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

Negative starting position for SubStr,InStr,RegEx(Match|Replace) #2

Closed mmikeww closed 2 years ago

mmikeww commented 7 years ago

from
https://autohotkey.com/v2/v2-changes.htm

A negative StartingPos for InStr, SubStr, RegExMatch and RegExReplace is interpreted as a position from the end, starting at 1. Position -1 is the right-most character (in v1 this was position 0), and position 0 is invalid.

mmikeww commented 7 years ago

what about if a single line needs multiple changes? SubStr() needs to check for negative starting pos but a nested InStr() would need to check for it as well

mmikeww commented 7 years ago

there is discussion with lexikos in the original thread for how to handle this: https://autohotkey.com/board/topic/65333-v2-script-converter/