![]() |
Gift certificate code |
Post Reply
|
| Author | |
cpgmar
Newbie
Joined: 04-December-2005 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: Gift certificate codePosted: 10-October-2009 at 1:04pm |
|
I need to alter the Gift Certificate code generator to generate a code with only 5 digits with all cap letters (no small letters) Does anyone know how to revise this code below to make it do that?
'--- Start Generating Gift Code - This is just SAMPLE CODE Tn1="" For w=1 to CodeStrLen Randomize myC=Fix(3*Rnd) Select Case myC Case 0: Randomize Tn1=Tn1 & Chr(Fix(26*Rnd)+65) Case 1: Randomize Tn1=Tn1 & Cstr(Fix(10*Rnd)) Case 2: Randomize Tn1=Tn1 & Chr(Fix(26*Rnd)+97) End Select Next '--- Finish Generating GiftCode |
|
|
Cindy
The Tasteful Garden www.tastefulgarden.com |
|
![]() |
|
njessen42
Groupie
Joined: 12-November-2007 Location: Spokane, WA Status: Offline Points: 0 |
Post Options
Thanks(0)
Quote Reply
Posted: 22-October-2009 at 4:29pm |
|
I tried to remove
Case 2: Randomize Tn1=Tn1 & Chr(Fix(26*Rnd)+97) to get 10 digits with all uppercase letters and numbers and it still created lower case. What am I doing wrong. For the above question I think you can change CodeStrLen=10 to 5 and you should get a 5 digit code. I am trying to figure out the lower case letter thing also. |
|
![]() |
|
Guests
Guest
|
Post Options
Thanks(0)
Quote Reply
Posted: 22-October-2009 at 8:47pm |
|
I'm not clear on whether you are wanting just alpha or if the alpha-numeric is OK, but to convert your lower case to upper case you should be able to simply add this after the For . . .Next loop:
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |