Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with SUBSTR(SYS(2015),3,10)
Message
De
14/07/2003 02:59:02
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
 
À
14/07/2003 02:21:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00809725
Message ID:
00809737
Vues:
46
Hi Jos,

I found this in the VFP7.0 help:
Note:Avoid using this string in CREATE TABLE, CREATE CURSOR, SELECT INTO
CURSOR, and other similar commands. Using this string generates an error
because a valid FoxPro cursor or alias name cannot begin with a number. If
you have used SUBSTR(SYS(2015), 3) to create a unique table or cursor name
without explicitly preceding the string with an underscore, (_), or
alphabetic character, you can fix your code in the following ways:
On a platform that supports long file names
Use SYS(2015) by itself since it always begins with an underscore.
On platforms and networks that support only the DOS 8+3 naming convention
Change your naming expression to explicitly prepend an underscore as in the
following example:
   "_"+SUBSTR(SYS(2015), 4)
I've changed my code to just use SYS(2015).

Regards,
Gavin.

>>Hi All,
>>
>>In the VFP6.0 help for SYS(3) it states the following:
>>
>>
>>SYS(3) may return a non-unique name when issued successionally on a fast
>>computer. Use SUBSTR(SYS(2015), 3, 10) to create unique, legal eight
>>character file name.
>>
>>
>>I use the above technique to create a string which in turns is used as the name for a cursor. As of Today ( 14 July ) using the above method returns a string that starts with 0 ( zero ) which causes an error when creating the cursor as cursor names don't seem to be allowed to start with a numeric. I've worked around the problem by adding a non numeric character to the start of the string and it works fine.
>>
>>I assume the problem has something to do with not being allowed an alias that starts with a numeric.
>>
>>Regards,
>
>Gavin you can also just use SYS(2015) which always produces 10 char valid file names that start with an underscore. No changes required.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform