Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nice order to create
Message
De
18/03/2016 16:09:32
 
 
À
18/03/2016 07:22:27
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01633318
Message ID:
01633376
Vues:
50
yes, I saw that, but I preferred the resulting ordering, as prefixing with Chr(48) will eliminate any chances to differentiate user entered "3" vs. "03".
Similar to "AA" being later than "A" and "B", "03" is not seen as numeric value but ordered chr().
Thats why I had marked that spot often in my comments, no "right" way IMO, only agreed upon implementation ;-)

>This will fail on the 5;03;10
>
>but I guess I can do it from here. Antonios Code looks very nice for the transform and I will get an idea about the number of chgaracters per group.
>
>Thank you (_ _)
>
>>
>>TEXT TO lcx NOSHOW  
>>1
>>10
>>2
>>03
>>1.1
>>12.R
>>1.1.R
>>1201.1.RBX.250.R.1
>>1.R
>>1.R.1
>>A
>>B
>>AA
>>5.R
>>CDXB
>>ENDTEXT &&lcx 
>>
>>STRTOFILE(lcx,'xyz.tmp')
>>
>>CREATE CURSOR curXYZ (cField c(40), cSortFld c(240))
>>APPEND FROM xyz.tmp DELIMITED WITH TAB
>>DELETE FILE xyz.tmp
>>
>>replace ALL cSortFld WITH IP_Ascii (cField)
>>INDEX on cSortFld TAG cSortFld
>>browse
>>
>>
>>FUNCTION IP_ASCII(tcRow)
>>LOCAL lnColLen, lnMaxCol, lnColCnt, laCols[1], lcErg, lcAdd, luCol
>>lnColLen = 5
>>lnMaxCol = 7
>>lnColCnt = ALINES(laCols, UPPER(tcRow),1,".")
>>lcErg = ""
>>FOR lnCurCol = 1 TO lnMaxCol
>>   lcAdd = IIF(lnColCnt>=lnCurCol,laCols[lnCurCol], "")
>>    lcErg = m.lcErg + PADL(m.lcAdd, m.lnColLen, iif (EMPTY(m.lcAdd), CHR(45), IIF(ISAlpha(m.lcAdd), CHR(64), CHR(47)))) + "." 
>>next
>>RETURN m.lcErg
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform