Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set century
Message
De
12/05/2005 12:50:25
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01013353
Message ID:
01013498
Vues:
15
>>
>>CLEAR
>>
>>set century TO 19 ROLLOVER 55   && default
>>
>>?SET("century",2)  &&55
>>
>>***************** FABIO *************
>>* Attention, next have a 1..100 range, but rollover's range is 0..99
>>lnyear=VAL(RIGHT(DTOC(DATE()),2))+1
>>
>
>You're right. How can we fix that? Do we need a special code for year 1999?
>
>
>>* Doc
>>* SET CENTURY ON | OFF | TO [nCentury [ROLLOVER nYear]]
>>
>>set century ON at this point the Parser ignored anythings
>>***************** FABIO END ****************
>>
>>set century ON TO 19 ROLLOVER lnyear
>>
>>?SET("century",2)   && still 55, why?
>>
>>for i=1 to 10
>>	?ctod('01/01/'+ transform(m.i))  && rollover 6 does not work
>>NEXT
>>
>>set CENTURY TO 19 ROLLOVER lnyear
>>
>>?SET("century",2)   && now it is 6, because of ON was removed?
>>for i=1 to 10
>>	?ctod('01/01/'+ transform(m.i))   && rollover 6 works
>>NEXT
>>
>>* Try with ON again
>>set CENTURY ON TO 19 ROLLOVER lnyear
>>
>>?SET("century",2)     && it is 6 however, why?
>>for i=1 to 10
>>        ?ctod('01/01/'+ transform(m.i))  && rollover 6 works, and with ON !?
>>NEXT
>>
I not think more, but:
CLEAR

* Doc
* SET CENTURY ON | OFF | TO [nCentury [ROLLOVER nYear]]

set century ON at this point the Parser ignored anythings

SET TEXTMERGE ON NOSHOW
SET TEXTMERGE   TO SYS(2023)+"\test.log"

FOR year=1900 TO 2200
	test(m.year)
next

SET TEXTMERGE TO

MODIFY FILE SYS(2023)+"\test.log"
ERASE SYS(2023)+"\test.log"

PROCEDURE test(lnyear)

\ ********* YEAR   <<lnYear>>

set century TO (m.lnyear+1)/100-1 ROLLOVER (m.lnyear+1)%100 
\  <<SET("century",1)>>,<<SET("century",2)>>
for i=0 to 99
	\ <<ctod('02/02/'+ transform(m.i))>>
NEXT
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform