Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Structure unknown
Message
From
21/12/2005 08:33:34
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01079709
Message ID:
01079826
Views:
28
>>You can use some "Underground surrogate variables"
>>
>>lparameters tnOption
>>local loMessage, loWait, lcNotify, lcInsertCmd
>>local lnI, lnH, lnM, lnO, lnTotal
>>store 0 to lnI, lnH, lnM, lnO, lnTotal
>>
>>lcNotify = set('notify')
>>set notify on
>>set talk on
>>set talk window
>>
>>with thisform
>>
>>	if not .lSilentMode
>>		loMessage = createobject("cWaitMessage", "Getting Data...")
>>		loWait = createobject("cMessage", "Getting Data...")
>>		.WaitMode(.t.)
>>	endif
>>
>>	do case
>>	case m.tnOption = 1 && by Queue
>>		GetQueuesDistribution()
>>	case m.tnOption = 2 && by Clients
>>		GetClientsDistribution()
>>	case m.tnOption = 3 && by Product Line
>>		GetProductLineDistribution()
>>	case m.tnOption = 4 && by Status
>>		GetStatusDistribution()
>>	endcase
>>
>>	if m.lcNotify = 'OFF'
>>		set notify off
>>	endif
>>	set talk off
>>
>>	.oXTab.RunXTab()
>>
>>	zap in curStats
>>
>>	LOCAL i,h,m,o	&& surrogate fields
>>	STORE 0 TO i,h,m,o
>>	
>>	insert into curStats (cFullName, I, H, M, O, nTotal);
>>		SELECT I,H,M,O, I+H+M+O FROM curStatistics && ONE CHAR FIELD'S NAME is a terrible choice
>>
>>	select curStats
>>
>>	sum I, H, M, O, nTotal ;
>>		to	.txtITotal.value	;
>>		,	.txtHTotal.value	;
>>		,	.txtMTotal.value	;
>>		,	.txtOTotal.value	;
>>		,	.txtTotal.value
>>
>>	go top
>>
>>	.WaitMode(.f.)
>>	.refresh()
>>endwith
>>
>
>I was thinking about it, but didn't want to take a risk.

Every time you use a variable without the m. prefix, you taken the same risk.

> The one letter field names are the result of crosstab. However, my curStats can have any
field names, since I create it. Do you think I_Dept, M_Dept, etc. would be better?

better surely, but not sufficient
"I_" , what is it ?
"M_", what is it ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform