Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluate([0h] + ... )
Message
From
06/11/2018 14:00:03
 
 
To
06/11/2018 13:29:19
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01663078
Message ID:
01663171
Views:
68
>Rick, I'm sure you know the effect of the leading 0h... but can you confirm what you see from this:

I modified it to this:
m.string="{557cf406-1a04-11d3-9a73-0000f81ef32e}"

*- string (38) to guid (q16)
aa=evaluate(;
    "0h"+;
    substr(m.string,8,2)+;
    substr(m.string,6,2)+;
    substr(m.string,4,2)+;
    substr(m.string,2,2)+;
    substr(m.string,13,2)+;
    substr(m.string,11,2)+;
    substr(m.string,18,2)+;
    substr(m.string,16,2)+;
    substr(m.string,21,4)+;
    substr(m.string,26,12);
    )

? aa
? TYPE("aa")
It shows "Q" which is Varbinary.

I don't remember seeing where it's documented in VFP that "0h" + such a string results in a converted value, but now that I see the type "Q" there I looked up Varbinary and it is documented that binary strings can be encoded that way with a prefix of "0h". I never knew that about VFP, and have never seen it before.

I run into things like this every so often, things which shake my "comprehensive" knowledge of VFP. But, I'm not so arrogant to think I know everything about it. Marco Plaza and Tore's solution recently with the access_this() was something I've never seen before. Visual FreePro, Jr. would not have initially supported it as a result. :-)

I enjoy learning such things from people and their code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform