Code: Select all
If InpurVar=1NE
gosub 2NE
Code: Select all
gosub InpurVar=(%1%+1)NE
Code: Select all
If InpurVar=1NE
gosub 2NE
Code: Select all
gosub InpurVar=(%1%+1)NE
Code: Select all
InpurVar := "1NE"
gosub, % SubStr(InpurVar,1,1)+1 "NE"
Code: Select all
#SingleInstance, Force
Try, GoSub, % (InpurVar = "1NE" ? "2NE" : "")
return
2NE:
MsgBox, Test
return
Code: Select all
InpurVar := "1NE"
Gosub, % (RegExReplace(InpurVar, "([A-Z]+)")+1) . RegExReplace(InpurVar, "(\d+)")
return
2NE:
MsgBox, Hello
return
boiler you predicted correct in that I need it generic. RegExReplace looks so useful. I would also need a fit ofboiler wrote: ↑11 Dec 2019, 09:30In case you need it more generic, this will add 1 to whatever the number is (even if it's double digits) and follows it with whatever the letters are in case they're not "NE".Code: Select all
InpurVar := "1NE" Gosub, % (RegExReplace(InpurVar, "([A-Z]+)")+1) . RegExReplace(InpurVar, "(\d+)") return 2NE: MsgBox, Hello return
Code: Select all
"([A-Z]+)")+1) (But if>3, then -=2 to give one)
Code: Select all
Gosub, % ((n:=RegExReplace(InpurVar, "([A-Z]+)"))+(n>=3?-2:1)) . RegExReplace(InpurVar, "(\d+)")
Thank you. Yes, mistake with arithmetic. Should have wrote if>3 then -3boiler wrote: ↑11 Dec 2019, 10:09Sounds like you want it when it's >=3 (greater or equal to 3)
Code: Select all
Gosub, % ((n:=RegExReplace(InpurVar, "([A-Z]+)"))+(n>=3?-2:1)) . RegExReplace(InpurVar, "(\d+)")
Code: Select all
f2::
InpurVar := "1NFE"
Gosub, % ((n:=RegExReplace(InpurVar, "([A-Z]+)"))+(n>3?-3:1)) . RegExReplace(InpurVar, "(\d+)")
Code: Select all
Gosub, % ((n:=RegExReplace...
Code: Select all
InpurVar := "1NE"
F2::
RegExMatch(InpurVar, "(\d+)(.+)", Match)
Gosub, % (InpurVar := Match1 . Match2)
InpurVar := (++Match1 = 4 ? 1 : Match1) . Match2
return
1NE:
ToolTip, This is the 1NE subroutine
return
2NE:
ToolTip, This is the 2NE subroutine
return
3NE:
ToolTip, This is the 3NE subroutine
return
Esc::ExitApp
Code: Select all
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;~ #Persistent ; ~~~not required because this script has hotkeys
#SingleInstance Force
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetBatchLines, -1
SetControlDelay -1
SetTitleMatchMode, REGEX
DetectHiddenWindows, On
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen
SetNumLockState, On
#InstallKeybdHook
#InstallMouseHook
ActiveHwnd := WinExist("A")
Winactivate 102
3Set=1HG
Sleep 1000
;gosub ActivateMenu
; return <-------------------------------- this one
InpurVar:="1NE"
F2::
RegExMatch(InpurVar, "(\d+)(.+)", Match)
Gosub, % (InpurVar := Match1 . Match2)
InpurVar := (++Match1 = 4 ? 1 : Match1) . Match2
return
1NE:
ToolTip, This is the 1NE subroutine
return
2NE:
ToolTip, This is the 2NE subroutine
return
3NE:
ToolTip, This is the 3NE subroutine
return
Users browsing this forum: Bing [Bot] and 143 guests