Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RAND() not very random
Message
De
21/09/2006 07:08:34
 
 
À
21/09/2006 07:03:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01155607
Message ID:
01155878
Vues:
31
>>>>>>>How so, amd why not suggest an alternative? It's just a cheap & cheerful way of generating a (fairly) unigue file name.
>>>>>>
>>>>>>
>>>>>>lcDateStr = ttoc(datetime(), 1)
>>>>>>
>>>>>
>>>>>Thanks Gregory. Then it needs converting to a format readable to a British eye/brain, with "_" separators, etc. It's not that important :-)
>>>>>
>>>>>Terry
>>>>
>>>>Terry,
>>>>
>>>>That's easy
>>>>
>>>>?transform(ttoc(datetime(),1), '@R ####_##_##_##:##:##')
>>>>?transform(ttoc(datetime(),1), '@R ####-##-##_##:##:##')
>>>>
>>>
>>>Aye, but it still goes to reverse order (indexing) date - I'd want it in Brit format, like "21_09_2006_1136"
>>>
>>>See? It's still a faff :-)
>>
>>?strtran(ttoc(datetime()), '/', '_')
>>
>
>I guess that would work, except that I'm a bit chary of using ":" and spaces in a filename, a hang-up to the old DOS days, I guess. You never know when a certain package won't recognise the chars in the filename as legal,


Then put it through another strtran()
?strtran(strtran(ttoc(datetime()), '/', '_'), ':', '_')
Chrtran() is also possible


>At least it's DEFINITELY precise about when the file was created, heh ?-)
>
>Thanks
>
>Terry
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform