Leading Zeros get removed

Advanced Macro Recorder/Editor.

Moderator: Pulover

kernelhacker
Posts: 3
Joined: 05 Apr 2018, 01:56

Leading Zeros get removed

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:

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||||
Content of "testvar" is "1"

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
Content of "testvar" is "001"
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: Leading Zeros get removed

05 Apr 2018, 09:04

SetFormat, float,7.0
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
kernelhacker
Posts: 3
Joined: 05 Apr 2018, 01:56

Re: Leading Zeros get removed

09 Apr 2018, 09:38

Hello Tank,
tank wrote:SetFormat, float,7.0
Thx for this try, bit it seems like this is another command that cannot be selected with Pulovers Macro Creator - at least I didn't find a way to use "SetFormat". Am I just blind?

Kind regards,

Stefan

Return to “Pulovers Macro Creator”

Who is online

Users browsing this forum: No registered users and 22 guests