PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of hScheduledTask variables
  • How to handle the parameters passed to the stored procedure
  • Functions that use the hScheduledTask variables
  • Compatibility
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
hScheduledTask (Type of variable)
In French: hTâchePlanifiée (Type de variable)
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
The hScheduledTask type is used to manage a scheduled HFSQL Client/Server task by programming. The characteristics of this schedule task can be defined and modified by several WLanguage properties.
Note: See Declaring a variable for more details.
Versions 17 and later
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
New in version 17
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
Example
MyTask is hScheduledTask
MyTask..Description = "Scheduled backup"
MyTask..Month = "*"
MyTask..DayOfWeek = "*"
MyTask..DayOfMonth = "*"
MyTime is Time
MyTime = EDT_Time
MyTask..Hour = MyTime..Hour
MyTask..Minute = MyTime..Minute
MyTask..NumberExecution = 1
MyTask..Procedure = "HBackup"
Add(MyTask..Parameter, NameCSDatabase + "/LOG_TASKS.FIC")
Add(MyTask..Parameter, NameCSDatabase + ".ScheduledBackup")
Add(MyTask..Parameter, True)
Add(MyTask..Parameter, MyTask..Description)
nID is int = HAddTask(CSConnection, MyTask)
Remarks

Properties specific to the description of hScheduledTask variables

The following properties can be used to handle a hScheduledTask variable:
Property nameType usedEffect
Versions 20 and later
Enabled
New in version 20
Enabled
Enabled
Boolean
  • True if the task scheduling is enabled,
  • False otherwise.
Versions 23 and later
AtStart
New in version 23
AtStart
AtStart
Integer constantIndicates whether the task must be done when starting the HFSQL server as well as its execution mode:
  • hBlocking: The task is locking. The HFSQL server will not be accessible during the task execution.
  • hBackgroundTask: The task is not locking. The HFSQL server will be accessible during the task execution. The task is run in background task.
  • No: The task must not be run when starting the server (default value).
Description (*)Character stringDescription associated with the scheduled task. The description of scheduled task corresponds to an empty string by default.
This property is optional.
HourCharacter stringExecution time of the scheduled task in UTC format (universal time).
Execution time of scheduled task. If ..TimeUTC is set to True, this time is in UTC format (universal time).
The possible values are:
  • a digit included between 0 and 23.
  • a list of numbers separated by commas: used to specify several hours.
  • an interval. For example, "9-13".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task at every even hour.
Versions 19 and later
TimeUTC
New in version 19
TimeUTC
TimeUTC
Boolean
  • True (default value) if the time is expressed in UTC time, which means in universal time (..Hour and ..Minute),
  • False otherwise.
DayOfWeekCharacter stringNumber of the day for which the scheduled task must be run ("2" for example). This number is included between 1 and 7 (1 = Monday, 2 = Tuesday, ...).
This parameter can also correspond to:
  • a list of numbers separated by commas: used to specify several days.
  • an interval. For example, "1-3" (the task is scheduled for Monday, Tuesday and Wednesday).
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even day of the week.
  • the day of the week in letters ("monday", "tuesday", "wednesday", "thursday", "friday").
DayOfMonthCharacter stringNumber of the day for which the scheduled task must be run ("31" for example). This number is included between 0 and 31.
This parameter can also correspond to:
  • a list of numbers separated by commas: used to specify several months.
  • an interval. For example, "9-13" (the task is scheduled from the 9th to the 13th of the month).
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even day of the month.
DayOfMonthOrDayOfWeekBooleanUsed to manage the execution of a scheduled task by specifying the number of the day in the week or the number of the day in the month. Example: execution every Monday 1st day of month.
This property can correspond to:
  • True to run the scheduled task every Monday AND the first day of the month (cumulated conditions).
  • False to run the task on Monday 1st (exclusive conditions).
MinuteCharacter stringMinutes of the execution time of the scheduled task in UTC format (universal time).
Minutes of the execution time of the scheduled task. If ..TimeUTC is set to True, this time is in UTC format (universal time).
The possible values are:
  • a digit included between 0 and 59.
  • a list of numbers separated by commas: used to specify several minutes.
  • an interval. For example, "9-13".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task at every even minute.
MonthCharacter stringNumber of the execution month of scheduled task ("11" for example). The possible values are:
  • a digit included between 1 and 12.
  • a list of numbers separated by commas: used to specify several months.
  • an interval. For example, "9-11".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even month.
NumberExecutionIntegerNumber of times the task must be run. This property can also correspond to the Infinite constant.
ParameterArrayParameters of the stored procedure that will be run by the scheduled task. See "How to handle the parameters passed to the stored procedure?" for more details.
ProcedureCharacter stringName of the stored procedure that will be run by the scheduled task.
This property has the following format: <Database Name>:<Name of Set of Procedures>.<Name of Stored Procedure>.
To perform a backup, this property must correspond to "HBackup".
Versions 20 and later
User
New in version 20
User
User
Character stringUser who created the scheduled task.
This property is read-only.
Note: These properties can be used with one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>
The properties followed by a star (*) are optional.

How to handle the parameters passed to the stored procedure

The Parameter property of the hScheduledTask variable is an array of strings.
To define the parameters of a stored procedure when triggering a scheduled task, use Add or ArrayAdd. Example:
Add(MyTask..Parameter, gsNameCSDatabase + ".ScheduledBackup")
To handle the parameters, the FOR EACH syntax allows you to browse an array.
To find out the number of array elements, you can use:

Functions that use the hScheduledTask variables

Function nameEffect
HAddTaskAdds a scheduled task on the server defined by the connection. This task was defined by an advanced variable of hScheduledTask type.
HInfoTaskReturns the characteristics of a scheduled task in an advanced variable of hScheduledTask type.
HModifyTaskModifies a scheduled task on the server defined by the connection. This task is found in an advanced variable of hScheduledTask type.

Compatibility

The hScheduledTask type replaces the global hScheduledTask structure available in version 12. This structure is kept for backward compatibility.
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment