Leading Zeros get removed
Posted: 05 Apr 2018, 05:23
Hi again,
I have a problem with leading zeros that get removed when using "subStr". That only happens when run from within PMC. The exported script runs correctly. What can I do to keep my leading zeros with PMC?
Here is some example Code:
Content of "testvar" is "1"
Content of "testvar" is "001"
I have a problem with leading zeros that get removed when using "subStr". That only happens when run from within PMC. The exported script runs correctly. What can I do to keep my leading zeros with PMC?
Here is some example Code:
Code: Select all
[PMC Code v5.0.5]|||1|Window,2,Fast,0,1,1,InputThenPlay,-1,-1,1|1|Macro1
Groups=Start:1
1|[Assign Variable]|testvar := substr("0000001",-2)|1|0|Variable|Expression||||
2|[MsgBox]|testvar is: %testvar%|1|0|MsgBox|0||||
Code: Select all
; This script was created using Pulover's Macro Creator
; www.macrocreator.com
#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode InputThenPlay
#SingleInstance Force
SetTitleMatchMode 2
AutoTrim On
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1
Macro1:
testvar := substr("0000001",-2)
MsgBox, 0, , testvar is: %testvar%
Return