Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design question - how to interrupt process
Message
From
02/06/2005 11:24:14
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01018971
Message ID:
01019410
Views:
19
Your welcome. And thanks for the tip. I will keep that in mind.

>Thanks, Greg. This seems to work nicely.
>
>However, I'm getting TRY/CATCH/FINALLY/ENDTRY mismatch error. Why is that?
>
>UPDATE. Found the answer in this Re: Try/Catch/Finally/Endtry mismatch, error #2058 Thread #811323 Message #1019355
>==================================================================
>Here is my code. If there is an error, it works good, but if there are no errors, it goes to catch to loErr and gives an error about mismatch. In some of my procedures there is try endtry block too.
>
>
>*---------------------- Location Section ------------------------
>*   Library: 	Aqueueprocess.vcx
>*   Class: 		AassignQueues
>*   Method: 	RunProcess()
>*----------------------- Usage Section --------------------------
>*)  Description:
>*)
>
>*   Scope:      Public
>*   Parameters:
>*$  Usage:
>*$
>*   Returns:
>*--------------------- Maintenance Section ----------------------
>*   Change Log:
>*       CREATED 	06/01/2005 - NN
>*		MODIFIED
>*----------------------------------------------------------------
>lparameters tcQueue_Name_From, tcQueue_Name_To, ;
>	tcDepartment_Code, tcUser, tnNumberOfDays
>
>local ltStartProcessTime, loErr
>ltStartProcessTime = datetime()
>
>#define START_TIME 28800 && 8 hours
>with this
>	try
>		.CreateLogfile()
>
>** We want to have a clear log of everything
>		.WriteToLogFile("Started to run assigning queues process")
>
>		.SetDepartment(m.tcDepartment_Code)
>		.SetNumberOfDays(m.tnNumberOfDays)
>		.SetQueueNameFrom(m.tcQueue_Name_From)
>		.SetQueueNameTo(m.tcQueue_Name_To)
>
>		.GetUsers(m.tcUser)
>
>		.GetProfiles()
>
>		.GetAlreadyScheduled()
>
>* Find the FK of the UNASSIGNED QUEUE
>		local lnQueue, lcQueue_Names_Fk, lnI
>		lnQueue = ascan(.arrQueues, .cDepartment_Code, 1, alen(.arrQueues,1), 1)
>		lcQueue_Names_Fk = .arrQueues [m.lnQueue, 2] && FK is the second element in the array
>
>		private gcUserID
>		gcUserID = GetUserID()
>
>		for lnI = 1 to .nNumberOfDays
>
>			ldScheduled_Date = ttod(.arrQDates[m.lnI])
>			ltScheduled_Time = dtot(m.ldScheduled_Date) + START_TIME
>
>			select c_Users
>			go top && Very important !
>
>			scan
>				this.Assign_Accounts_To_User(m.lcQueue_Names_Fk, ;
>					.cQueue_Name_To, c_Users.cDepartment_Code, ;
>					c_Users.cUserID, c_Users.iUserID, ;
>					m.ltScheduled_Time)
>			endscan
>		next
>
>		.WriteToLogFile("Finished to run assigning queues process")
>		
>	catch to m.loErr
>		.CustomError(m.loErr)
>	endtry
>
>endwith
>
>
>
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform