Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with incrementing strings
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Problems with incrementing strings
Divers
Thread ID:
00991021
Message ID:
00991021
Vues:
46
Hi.
I am trying to increment a string and am having problems, mostly to do
with the synstax of Int and Char functions.

I have a sring with two letters in it e.g. 'CF'
I want to 'Increment' the string by 1
e.g. Old string New string
CF CG
CZ DA etc

IN VFP I would do the following:

IF SUBSTR(MyString,2,1) = "Z"
MyString = CHR(ASC(SUBSTR(MyString,1,1)) + 1) + "A"
ELSE
MyString = SUBSTR(MyString,1,1) + CHR(ASC(SUBSTR(MyString,2,1)) + 1)
ENDIF

Any ideas on how to do this in .Net
(I've use a combinarion of Int and Char and Substr but am getting syntax errors)

regards,

Gerard
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform