Information générale
Catégorie:
Code, syntaxe and commandes
>Thanks, Viv, for pointing me in the right direction.
>I finally got to that step this AM.
>Other restraints in the system limit the number of versions to 10, starting with "A", so I just needed to increment it.
>
>Here's another question:
>
>This works
> private void buttonCreatenewversion_Click(object sender, EventArgs e)
> {
> char c = Convert.ToChar(CurrentVersion);
> c++;
> string newversion = c.ToString();
>
> } // key down
>
>
>This gives me the existing version. Why is that??
>
> private void buttonCreatenewversion_Click(object sender, EventArgs e)
> {
> char c = Convert.ToChar(CurrentVersion);
> string newversion = c++.ToString();
>
> } // key down
Like Bonnie said: use (++c).ToString();
c++ will increment c *after* using the value.
++c will increment c *before* using the value.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement