Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this VFP code be faster? (File Expansion)
Message
From
22/11/2005 01:32:21
 
 
To
15/11/2005 14:28:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01068953
Message ID:
01071061
Views:
44
>************************
>PROCEDURE Hex2Dec
>************************
>* Convert Hex 00 - FF to decimal 0 - 255
>PARAMETER hexvalue2
>RETURN (DECIVALUE(LEFT(hexvalue2,1))*16)+DECIVALUE(RIGHT(hexvalue2,1))
>
>************************
>PROCEDURE DECIVALUE
>************************
>* Convert single hex number into decimal
>
>PARAMETER hexvalue1
>RETURN AT(hexvalue1,'0123456789ABCDEF')-1
>
>PROCEDURE abortall
>llabortall = .T.
>RETURN


Cant you just do instead of using Hex2Dec and decivalue:
EVALUATE("0x" + hexvalue)
I will bet thats much faster than calling a function that calls another function 2 times.

Also, from the Help File:

"VARTYPE( ) is similar to the TYPE( ) function, but VARTYPE( ) is faster and does not require quotation marks to enclose the expression for which the data type is returned."

Just my 2 cents.

Carlos
Previous
Reply
Map
View

Click here to load this message in the networking platform