![]() |
Gift certificate code |
Post Reply ![]() |
Author | |
cpgmar ![]() Newbie ![]() ![]() Joined: 04-December-2005 Location: United States Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 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 |
![]() ![]() ![]() ![]() ![]() |
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 ![]() |
![]() ![]() ![]() ![]() ![]() |
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 |