ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Generate sequential serial numbers

<< < (2/7) > >>

skwire:
Yeah, I know.   :-[

pagebooks:
At age 79 I admit that I struggle with contemporary technology, but I have skwire's script up and running and I'm very pleased with the results. Thanks, I'll make a donation.

Josh

skwire:
Great to hear.   :up:   I'm glad we were able to help you out.  =]

MilesAhead:
I still don't quite get what SubStr() is doing, but from a forum snippet I added the "6 digit" part


--- ---
mySerial := 1
myFactor := 2

^g:: ; Ctrl+G, change to whatever you want.
{
mySerial := SubStr("000000" . mySerial, -5)
    SendInput, % mySerial
    mySerial += myFactor
}
Return

Ruffnekk:
I still don't quite get what SubStr() is doing, but from a forum snippet I added the "6 digit" part


--- ---
mySerial := 1
myFactor := 2

^g:: ; Ctrl+G, change to whatever you want.
{
mySerial := SubStr("000000" . mySerial, -5)
    SendInput, % mySerial
    mySerial += myFactor
}
Return


-MilesAhead (June 12, 2012, 02:51 PM)
--- End quote ---

I don´t know AHK very well, but I can imagine SubStr() is Substitute String. Which brings me to the next point, that you are effectively converting your integer to a string. The proper way do it is converting the return value and leaving the integer alone:


--- ---
mySerial := 1
myFactor := 2

^g:: ; Ctrl+G, change to whatever you want.
}
    SendInput, % SubStr("000000" . mySerial, -5)
    mySerial += myFactor
}
Return


I don´t know if AHK cares about it, but it´s good practice in programming and other languages would not accept such an implicit conversion. ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version