Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Codigo character mas secuencia numerica
Message
De
20/03/2003 09:38:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00767447
Message ID:
00768043
Vues:
23
>Sólo modificaría en la solución de Hilmar:
>
>>
? left("JIMENEZ", 3) + left("MAYRA", 2) + padl(1, 3, "0")
>
>por:
>
>
? padl( cApellido, 3) + padl( cNombre, 2) + padl( nSerial, 3, "0")
>
>Esto previene el caso -improbable pero posible- de tener un apellido con dos letras, o un nombre con una sola (podría ser que ingresen sólo una inicial).

No lo sugerí, porque si se trabaja con un campo, se tendrían espacios al final. Como no estamos haciendo alltrim... Pero bueno, si estaríamos trabajando con variables, ya tendríamos que considerar esto.

Además, la función correcta para las primeras dos partes no es padl(), sino padr() (que agrega espacios a la derecha).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform