Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting months to digits
Message
From
08/04/2014 09:54:38
 
 
To
08/04/2014 08:52:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01598233
Message ID:
01598263
Views:
59
>>
>>mymonth = 'APR' (or any)
>>WAIT WINDOW CHRtran(mymonth,'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC','01,02,03,04,05,06,07,08,09,10,11,12')
>>
>>
>>the above code obviously does not work. What does? thanks, Randy
>
>If you need to do this a lot, I suggest creating a cursor or table to hold the data and using a look-up.
>

If you need to consider other natural languages as well, your suggestion is probably the least maintainance-intensive and one of the fastest. But cursors/tables do have a footprint, and using such resources where in other computer languages a hashtable would be used I sometimes mis-use a class and properties with getpem(). And - for larger apps - no problems accessing memory vs. data sessions needing a service class layer accessing service tables in common/special DS.

YMMV

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform