Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PADL?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: PADL?
Divers
Thread ID:
00544373
Message ID:
00544380
Vues:
19
This message has been marked as the solution to the initial question of the thread.
>Hi - I am trying to create incrementing document numbers in the form "DOC000001". I have a stored procedure (GetDocNo) that takes care of generating the value which it returns as a string. I have a character field 9 wide and in the default I have
>"DOC" + PADR(GetDocNo(),6,"0")
>If I run this in the command window its Ok but the field gets "DOC 1" - if I increase the field length to 40+ I get "DOC00 1"
>
>Any ideas?

Try this :
lcNumber = ALLTRIM(GetDocNo())
"DOC" + PADL(lcNumber,7-LEN(lcNumber),"0")
Wine is sunlight, held together by water - Galileo Galilei
Un jour sans vin est comme un jour sans soleil - Louis Pasteur
Water separates the people of the world; wine unites them - anonymous
Wine is the most civilized thing in the world - Ernest Hemingway
Wine makes daily living easier, less hurried, with fewer tensions and more tolerance - Benjamin Franklin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform