Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PEMSTATUS() Function
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00827554
Message ID:
00827616
Views:
14
>I'm testing your code and I'm seeing the object passad to the CLASS or DLL are not received correctly.
> What's wrong? AMEMBERS is returning 0
>

I don't know, I've expanded my code to this, passing in the object and returning it. I'm not understanding this, AMEMBERS documentation in VFP 8 suggests this should be working.
loT = CREATEOBJECT('empty')
ADDPROPERTY(loT,'cName','OLE Test')

DELETE FILE 'c:\members.txt'
loM = CREATEOBJECT("recobj.members") && DLL name . class name
loR = loM.TestMembers(loT)
clear
?loT.cName
loT.cName = 'Fred'
?loR.cName
loM.TestPemStatus(loT)
loM = NULL

ADDPROPERTY(loT,'cName','PRG Test')
loM = CREATEOBJECT('members')
loM.TestMembers(loT)
loM.TestPemStatus(loT)

MODIFY FILE 'c:\members.txt'

DEFINE CLASS members AS Custom OLEPUBLIC
   PROCEDURE TestMembers ( toIn AS Object ) AS Object
      LOCAL lnLoop, lcOut
      lcOut = TTOC(DATETIME()) + CHR(13)+CHR(10)
      IF TYPE('toIn.cName') = 'C'
         lcOut = lcOut + toIn.cName + CHR(13) + CHR(10)
         toIn.cName = 'argh!'
      ENDIF
      FOR lnLoop = 1 TO AMEMBERS(laMem, toIn, 3)
         lcOut = lcOut + laMem[lnLoop, 1] + ',' + laMem[lnLoop, 2] + CHR(13) + CHR(10)
      NEXT
      STRTOFILE(lcOut, 'c:\members.txt', 1)
      RETURN toIn
   ENDPROC
   PROCEDURE TestPemStatus ( toIn AS Object ) AS Logical 
      LOCAL lcOut
      lcOut = TTOC(DATETIME()) + CHR(13)+CHR(10)
      lcOut = 'PemStatus result = ' + TRANSFORM(PEMSTATUS(toIn, 'cName', 5)) + CHR(13) + CHR(10)
      STRTOFILE(lcOut, 'c:\members.txt', 1)
   ENDPROC
ENDDEFINE
Tracy
Previous
Reply
Map
View

Click here to load this message in the networking platform