Additional procedures
Procedures described below will be available in a program if PT4Main module is added to the program
(any template project created for task solving on Visual Basic contains this module).
Public Sub Task(ByVal Name As String)
This procedure initializes a task named Name. It must be called at the beginning of the Solve
procedure that contains task solution.
If the Solve procedure does not contain the Task procedure call then the program output the error
message "The Task procedure is not called at the beginning of the program".
A task name must contain a name of a task group and an
order number (for example, "Begin3").
If the group name is invalid then the program output the error message with the list
of all available groups. If the task number is invalid then the program output
the error message with information about the range of the available task numbers for this group.
The symbol "?" placed after the task name (for example, "Begin3?")
means that the program will be run in the demo mode.
Starting from the version 4.7, the Task procedure may be also used for creating and displaying an html-page
containing a description of a task or a task group.
In this case the name of the required task or the task group ended by the "#" symbol must be used for the Name parameter,
for example, "Begin3#" or "Begin#".
All subsequent calls of the Task procedure are ignored with the following exception:
if several calls are used for creation of an html-page containing a description of various tasks
or task groups then all these calls will be taken into account.
Public Sub GetB(ByRef A As Boolean)
Public Sub GetN(ByRef A As Integer)
Public Sub GetD(ByRef A As Double)
Public Sub GetS(ByRef A As String)
These procedures must be used to input initial data values in the program.
They must be called after the Task procedure, otherwise the program output the error message
"The Task procedure is not called at the beginning of the program".
Each input procedure must correspond to the type of data item,
otherwise the program output the following message: "Invalid type is used for an input data item" .
For example, this message will be output if GetN procedure will be called for input a string.
The GetS procedure must be used for both string and character input, because Visual Basic has no special
type for characters.
In the case of input of more data than the task requires, the program output
the error message "An attempt to input superfluous data".
In the case of input of less data than the task requires, the program output
the error message "Some required data are not input".
Public Sub PutB(ByVal A As Boolean)
Public Sub PutN(ByVal A As Integer)
Public Sub PutD(ByVal A As Double)
Public Sub PutS(ByVal A As String)
These procedures must be used to output results on the screen and compare obtained results with control data
(i.e., correct results).
They must be called after the Task procedure, otherwise the program output the error message
"The Task procedure is not called at the beginning of the program".
Unlike the Get-procedures, parameters of the Put-procedures can be expressions
(in particular, constants of a corresponding type). The used procedure should
correspond to output data item, otherwise the program output the error message
"Invalid type is used for an output data item".
The PutS procedure must be used for both string and character output.
In the case of output of more data than the task requires, the program output
the error message "An attempt to output superfluous data".
In the case of output of less data than the task requires, the program output
the error message "Some data are not output".
|