Link to home
Start Free TrialLog in
Avatar of IrDuck
IrDuck

asked on

using text as counter


Hi,

Dont realy know how to explain it but

in the old clipper days we could use "aaa" + 1 would be like "aab"  now i get like "aaa1" Errr

is there somthing in VB 2005 that can do the same?

Yelp etc





Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

you have to write a function that does this for you, which also respects the limits (i assume a-z)

so, the function would check the last character, and increment it (use the ascii functions and chr())
if that character however is already the last one, call the function recursively on the left part of the string (without the last character), and append 'a' to the output
if the function is called with empty string, return 'a' as output.

Avatar of doobdave
doobdave

Is this to perform some kind of loop?

If so, it begs the question "why do you want to use text as a counter?"

David
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IrDuck

ASKER

Thx idle

Yet another Example on why i like clipper so much more

/me Goes Addept code
Avatar of IrDuck

ASKER


Dooddave if you have only 3 spaces for  counter and you want to maximize the time the counter reuses the same id

well if you use only numbers it is 10*10*10 = 1000 if you use letter it will be 26*26*26 = 17576 and that is without the numbers you can add

above that


once again thx idle_mind