Leading zeroes for COM values Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Vh_
Posts: 203
Joined: 17 Mar 2017, 22:06

Leading zeroes for COM values  Topic is solved

13 Jul 2018, 11:43

Hi All,

I discovered leading zeroes are being cut off of variables when using the below method. Unfortunately I don't have the time to create an autohotkey.com example, but this is a mach example of what I am doing to produce these results. Any help on this is appreciated!

EDIT: Resolved. Thanks tidbit! :bravo:

Winner!

Code: Select all

My_ID := format("{:07}", My_ID) ;06 if always 7 digits long

Code: Select all

WB:=setWbCom("SSRS Report", "http://internalreporting.intranetsite") ;get pointer to specific window title and domain

ControlGetText, My_ID, Edit1, WinTitle ;My_ID = 0001235  

WB.document.getElementByID("client_ID_123").Value := My_ID

;value set is 1235, cutting off leading zeroes


;***********Function*******************
setWbCom(name=false, url=false) {
    ;   Set web browser COM pointer        ;   eserv_flag sets this.wb_eserv
    if (!name AND !url) {
        ;    Clear COM object
        return false
    }
    ;   Set defaults.  No promises.
    wb:=false
    For wb in ComObjCreate( "Shell.Application" ).Windows {
        Try {
            If ((InStr(wb.locationName, name) AND name) OR (InStr(wb.locationURL, url) AND url)) && InStr(wb.FullName, "iexplore.exe") {
                return wb
            }
        } Catch, e {
            if (e AND this.debug) {
                FileAppend, % "`r`nCOM Error: " . e, % this.debug_file
            }
        }
    }
    if (debug) {
        this.errorWindow("Failed to find web browser.`r`nName:`t" . name . "`r`nURL:`t" . url)
    }
    return false
}

return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, jameswrightesq, mikeyww, RandomBoy, wpulford and 334 guests