Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_memberdata in Forms
Message
From
22/07/2005 11:29:52
 
 
To
22/07/2005 10:57:18
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01035124
Message ID:
01035136
Views:
16
This message has been marked as the solution to the initial question of the thread.
Hi Greg.

>Does anyone know the logic in the _memberdata assignment when hacking the FORM table.

It's not just _memberdata; the format for any property over 255 bytes is different than those that are less.

The new format uses 517 CHR(1) characters as padding, followed by eight bytes containing the length of the property value, followed by the actual property value.

Here's some code, taken from the MemberData Editor, that extracts the value of the _memberdata property from the current Properties memo field in a VCX or SCX file. It could, of course, be modified to work with any property.
#define ccPROPERTIES_PADDING_CHAR  chr(1)
  * the padding character used for properties with values > 255 characters
#define cnPROPERTIES_PADDING_SIZE       517
  * the size of the padding area for properties with values > 255 characters
#define cnPROPERTIES_LEN_SIZE             8
  * the size of the length structure for properties with values > 255 characters

lnPos = at('_memberdata = ', PROPERTIES)
if lnPos > 0
  lnPos = lnPos + 14
  if substr(PROPERTIES, lnPos, 1) = ccPROPERTIES_PADDING_CHAR
    lnLen        = val(alltrim(substr(PROPERTIES, ;
      lnPos + cnPROPERTIES_PADDING_SIZE, ;
      cnPROPERTIES_LEN_SIZE)))
    lcMemberData = substr(PROPERTIES, lnPos + ;
      cnPROPERTIES_PADDING_SIZE + cnPROPERTIES_LEN_SIZE, ;
      lnLen)
  else
    lcMemberData = strextract(substr(PROPERTIES, lnPos), ;
      '', ccCR)
  endif substr(PROPERTIES, lnPos, 1) = ccPROPERTIES_PADDING_CHAR
...
Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform