Wordlist generator.
Moderators: JRL, Dorian (MJT support)
Wordlist generator.
I need to generate automaticaly a secuential word list. Words might be 9 characters long. Characters to be used are all numbers and "a" to "z". I can do it with numbers, but not with other characters.
Thanks.
Thanks.
real words, or just a random selection of letters up to 9 long?
For real words would need some kind of database to compare to.
But creating random strings up to 9 chars long is no problem.
For real words would need some kind of database to compare to.
But creating random strings up to 9 chars long is no problem.
MJT Net Support
[email protected]
[email protected]
Wordlist generator
Not real words,
example:
starting at: 111111111
next: 111111112
next: .........
next: DB2FR52GF
next: .........
next: F64K7J25TR
next: .........
end: ZZZZZZZZZ
With numbers its easy.
Thanks.
example:
starting at: 111111111
next: 111111112
next: .........
next: DB2FR52GF
next: .........
next: F64K7J25TR
next: .........
end: ZZZZZZZZZ
With numbers its easy.
Thanks.
Wordlist generator
It´s intended for sequentially numbering documents as invoices and keep them archived.
Thanks again.
Thanks again.
Hi,
This isn't random. As it starts with 111111111 and ends with ZZZZZZZZZ there must be a sequence.
But if you do want a random string generator, here's a subroutine I just knocked up which gives you a random alphanumeric string of 9 characters length:
SRT>MakeRandomString
Let>LengthOfString=9
Let>ChrArray=A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z
Separate>ChrArray,;,Chars
Let>c=0
Let>theword=
Repeat>c
Let>c=c+1
//Let's flip a coin to see if we get a char or a number
Random>2,CharOrNum
If>CharOrNum=0,number,character
Label>number
Random>9,thenumber
Let>theword=%theword%%thenumber%
Goto>next
Label>character
Random>26,rndcharnum
Let>rndcharnum=rndcharnum+1
Let>thischar=Chars_%rndcharnum%
Let>theword=%theword%%thischar%
Label>next
Until>c,LengthOfString
END>MakeRandomString
This returns a variable called 'theword' containing the random string.
An example to show the subroutine in operation:
Label>start
GoSub>MakeRandomString
MessageModal>theword
Goto>start
Hope this helps.
This isn't random. As it starts with 111111111 and ends with ZZZZZZZZZ there must be a sequence.
But if you do want a random string generator, here's a subroutine I just knocked up which gives you a random alphanumeric string of 9 characters length:
SRT>MakeRandomString
Let>LengthOfString=9
Let>ChrArray=A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z
Separate>ChrArray,;,Chars
Let>c=0
Let>theword=
Repeat>c
Let>c=c+1
//Let's flip a coin to see if we get a char or a number
Random>2,CharOrNum
If>CharOrNum=0,number,character
Label>number
Random>9,thenumber
Let>theword=%theword%%thenumber%
Goto>next
Label>character
Random>26,rndcharnum
Let>rndcharnum=rndcharnum+1
Let>thischar=Chars_%rndcharnum%
Let>theword=%theword%%thischar%
Label>next
Until>c,LengthOfString
END>MakeRandomString
This returns a variable called 'theword' containing the random string.
An example to show the subroutine in operation:
Label>start
GoSub>MakeRandomString
MessageModal>theword
Goto>start
Hope this helps.
MJT Net Support
[email protected]
[email protected]
Hi,
Looking at your post again I don't think you mean random. You actually have a sequence I think where each bit of the string goes from A..Z then 1..9. Am I right? In which case that's easier. You just need to keep a record, maybe in an INI file of the last sequence used. And just increment. No need to use random at all.
Looking at your post again I don't think you mean random. You actually have a sequence I think where each bit of the string goes from A..Z then 1..9. Am I right? In which case that's easier. You just need to keep a record, maybe in an INI file of the last sequence used. And just increment. No need to use random at all.
MJT Net Support
[email protected]
[email protected]
Let>Alphabet=abcdefghijklmnopqrstuvwxyz
Let>ac=0
Let>RandomString=
Label>RGenerator
Add>ac,1
Random>Pos,26
MidStr>Alphabet,%Pos%,1,Char
ConCat>RandomString,%Char%
If>acDone
MessageModal>%RandomString%
-----
Well less sophisticated as what has been provided by MJT's support, but maybe usefull for Macro Scheduler novices and those who had to work with a previous release of Macro Scheduler (without that Array thang)
Please check the command syntax, was a quik brain dump and therefore could be wrong
and I had no chance to test it 
Let>ac=0
Let>RandomString=
Label>RGenerator
Add>ac,1
Random>Pos,26
MidStr>Alphabet,%Pos%,1,Char
ConCat>RandomString,%Char%
If>acDone
MessageModal>%RandomString%
-----
Well less sophisticated as what has been provided by MJT's support, but maybe usefull for Macro Scheduler novices and those who had to work with a previous release of Macro Scheduler (without that Array thang)

Please check the command syntax, was a quik brain dump and therefore could be wrong


Wordlist generator
Wow! very nice forum and quick answer...
Yes, you are wright, dont need random. It´s a sequence. My problem was setting the characters to use and how to calculate the following step.
example:
take AA5GTR45A
and then get AA5GTR45B
adding the next number or letter following the numerical order and then the alphabetical order.
Thanks.
Yes, you are wright, dont need random. It´s a sequence. My problem was setting the characters to use and how to calculate the following step.
example:
take AA5GTR45A
and then get AA5GTR45B
adding the next number or letter following the numerical order and then the alphabetical order.
Thanks.
Every customer have his unique (cryptic) identifier with an incremental invoice number ?
But whats the trigger?
How to identify that the following invoice has to be for another customer (and therefore needs a new naming) ?
-----
Assuming you're saving the previously used InvoiceName in an INI file (and the counter is numeric) ...
ReadINIFile>...
MidStr>PrevInv,1,7,Name
MidStr>PrevInv,8,2,Counter
Ask>Following invoice for: %Name%[%Counter%] ?,Answer
If>Answer=NO,CreateNewInvoiceIdentifier
Add>Counter,1
WriteINIFile>C:\Invoice.ini
WriteLine>C:\%Name%%Counter%.txt, ...
.
Label>CreateNewInvoiceIdentifier
.
.
.
-----
MacroScheduler > 7.x works with the GoSub command - so feel free to create some spagethi code
But whats the trigger?
How to identify that the following invoice has to be for another customer (and therefore needs a new naming) ?
-----
Assuming you're saving the previously used InvoiceName in an INI file (and the counter is numeric) ...
ReadINIFile>...
MidStr>PrevInv,1,7,Name
MidStr>PrevInv,8,2,Counter
Ask>Following invoice for: %Name%[%Counter%] ?,Answer
If>Answer=NO,CreateNewInvoiceIdentifier
Add>Counter,1
WriteINIFile>C:\Invoice.ini
WriteLine>C:\%Name%%Counter%.txt, ...
.
Label>CreateNewInvoiceIdentifier
.
.
.
-----
MacroScheduler > 7.x works with the GoSub command - so feel free to create some spagethi code

Sorry for my english, I´m fighting with it.
The job is as follows:
I have created an invoice model in Word.
When I open the document I need to autocomplete the field invoice number. (As you know invoices need to be correlatively numbered.)
Numerically it´s easy (a=a+1), simply take the last number wich was stored in an ini file and add 1.
Then send the result to the invoice field.
Till here I have the code of the macro and runnig.
Here comes the problem: how to use alphanumeric characters instead of only numeric characters?, and keep correlatively numbered.
Thanks

The job is as follows:
I have created an invoice model in Word.
When I open the document I need to autocomplete the field invoice number. (As you know invoices need to be correlatively numbered.)
Numerically it´s easy (a=a+1), simply take the last number wich was stored in an ini file and add 1.
Then send the result to the invoice field.
Till here I have the code of the macro and runnig.
Here comes the problem: how to use alphanumeric characters instead of only numeric characters?, and keep correlatively numbered.
Thanks
If you've to work with MSWord on a daily basis it would make sense to have a look at its already implemented macro functionality (VBA aka Visual Basic for Applications). Or you've the option to create a formula for that specific field!
I'm pretty sure that Support would be able to point to some VBS (aka Visual Basic Script) functions you can use from within Macro Scheduler.
Based on my suggestion (see above): you could check for the character (which you've taken from the INI) in the string variable "Alphabet" with the Position> command for its position and afterwards add 1 (to get the next character).
I'm pretty sure that Support would be able to point to some VBS (aka Visual Basic Script) functions you can use from within Macro Scheduler.
Based on my suggestion (see above): you could check for the character (which you've taken from the INI) in the string variable "Alphabet" with the Position> command for its position and afterwards add 1 (to get the next character).
Ey, its that easy ...
Once you've identified a character (and his position from the string var "Alphabet") save both informations in the INI.
So you've to add 1 to that "historic" char pos to get the next char from the string var. Done. Well very basic style. Who cares - it should work.
Let>Alphabet=abcdefghijklmnopqrstuvwxyz
Invoice.INI
[Invoice]
Name=AA5GTR45
CounterChar=b
CounterCharPos=2
Once you've identified a character (and his position from the string var "Alphabet") save both informations in the INI.
So you've to add 1 to that "historic" char pos to get the next char from the string var. Done. Well very basic style. Who cares - it should work.
Let>Alphabet=abcdefghijklmnopqrstuvwxyz
Invoice.INI
[Invoice]
Name=AA5GTR45
CounterChar=b
CounterCharPos=2