if a chr = a then move it to b if b then c

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working with a treeView. Tree view keys must start with an alpha
charactor and does not allow you to use the same key twice in the treeview.

My key field is a numeric field that I am appending an "a" to like this:

set treekey = "a" & strTreeKey

becuase my tree can have duplicates, I pick up the error and change the "a"
to "b" with a statement in my err trapping like this:

if left(treekey,1) = "a" then
treelkey = "b" & strTreekey
elseif left(treekey,1) = "b" then
treelkey = "c" & strTreekey
and keep repeating the logic at least until I get to i.

Is there a way to test a alpha value and then get the next letter?
 
aWs said:
I am working with a treeView. Tree view keys must start with an alpha
charactor and does not allow you to use the same key twice in the treeview.

My key field is a numeric field that I am appending an "a" to like this:

set treekey = "a" & strTreeKey

becuase my tree can have duplicates, I pick up the error and change the "a"
to "b" with a statement in my err trapping like this:

if left(treekey,1) = "a" then
treelkey = "b" & strTreekey
elseif left(treekey,1) = "b" then
treelkey = "c" & strTreekey
and keep repeating the logic at least until I get to i.

Is there a way to test a alpha value and then get the next letter?

some_character = Chr(Asc(some_character) + 1)

You might want to give some thought to the case where some_character = "z",
though...
 
Thank you. It was the nugget I was looking for. There is an outside chance
the program my go past "z" so if that happens I have it starting again at "A".

Treeview treats case differances as separate keys
 
Back
Top