Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Property mysteriously changes its value
Message
From
11/01/2007 06:18:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01184314
Message ID:
01184480
Views:
17
Here is my assign method for pnrunningjobid property:
LPARAMETERS vNewVal
LOCAL lcFileName, lcProgramName
IF m.vNewVal = 0
	lcFileName = 'c:\jobidzeroed' + '_' + STRTRAN(DTOC(DATE()), '/', '') + '_' + STRTRAN(TIME(), ':', '') + '.txt'
	lcProgramName = PROGRAM(PROGRAM(-1) - 1)
	STRTOFILE(ALLTRIM(STR(THIS.pnrunningjobid)) + ', ' + lcProgramName, lcFileName)
ENDIF	
THIS.pnrunningjobid = m.vNewVal
as you can see I want to create a file when pnrunningjobid gets set to zero.
I have some files being created for that event but only when that property was set to zero in the code according to the program logic and user's actions. I also have another debugging information that shows that a SP was called three times with that property being equal zero. I have no files created for these calls. So, how that can be?

>>I have a form's property that gets wrongly changed and I can't find where. How can I use Assign method do trace the unwanted change?
>>
>>Thanks
>
>#define CRLF CHR(13)+CHR(10)
>
>****MyProperty_Assign method:
>LPARAMETERS tAssign
>LOCAL aStck[1]
>ASTACKINFO(aStck)
>lcStr = CRLF+[New value ] + TRANSFORM(tAssign)
>FOR lnFor = 1 TO ALEN(aStck,1)
>    lcStr  = lcStr + CRLF +;
>             [Stack Level     ] + TRANSFORM(aStck[lnFor,1])+CRLF+;
>             [Current program ] + TRANSFORM(aStck[lnFor,2])+CRLF+;
>             [Object          ] + TRANSFORM(aStck[lnFor,3])+CRLF+;
>             [Object source   ] + TRANSFORM(aStck[lnFor,4])+CRLF+;
>             [Line number     ] + TRANSFORM(aStck[lnFor,5])+CRLF+;
>             [in the source   ] + TRANSFORM(aStck[lnFor,6])
>NEXT
>STRTOFILE(lcStr, [c:\TestLog.log], 1)
>
>(not tested)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform