Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BYTE Data Type

Status
Not open for further replies.

tekytippy

Programmer
Jan 5, 2004
19
NL
I use VFP 7 to access something called Sage Data Objects made by Sage the accounts company that links to their Line50 Software. It has a data type of BYTE which I cannot access, (I can write to but I cannot read from) each time I do I get an error:- Expression Could Not Be Evaluated.

Sage say they know this is because VFP does not support the BYTE data type.

How can I get round this?

 
You're right of course that VFP can't handle the square brackets in that way, but COM objects can.

Actually, VFP can handle square brackets that way:

Code:
xx=create('brackettest')
?xx.arrprop['one']
?xx.arrprop['two']
?xx.arrprop[1]

DEFINE CLASS BracketTest AS Session
  DIMENSION ArrProp[5]

  FUNCTION ArrProp_Access( nc_Idx )
    do case
      case vartype(nc_idx)='C'
        do case
          case nc_Idx='one'
            return 1
          case nc_Idx='two'
            return 2
          case nc_Idx='three'
            return 3
          case nc_Idx='four'
            return 4
          case nc_Idx='five'
            return 5
        endcase
      case vartype(nc_idx)='N'
        do case
          case nc_Idx=1
            return 'one'
          case nc_Idx=2
            return 'two'
          case nc_Idx=3
            return 'three'
          case nc_Idx=4
            return 'four'
          case nc_Idx=5
            return 'five'
        endcase
    endcase
  ENDFUNC
  FUNCTION ArrProp_Assign( nc_Idx )
    * Do something
  ENDFUNC
ENDDEFINE
( I tested, and this works in vfp6 sp5 )
 
Keith

Yes they were based on a VB Code example. I'll try your suggestions and let you know.

Thanks very much.
 
Keith

Your suggestion of

objHeaderData.type

Throws up an OLE error and won't work. I traid all sorts of combinations and they only work as per my original example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top