Reset

Clears data from a control or object. The syntax you choose depends on the target object.

For syntax for DataWindows and DataStores, see the Reset method for DataWindows in the section called “Reset” in DataWindow Reference.

To

Use

Delete all items from a list

Syntax 1

Delete all the data (and optionally the series and categories) from a graph

Syntax 2

Return to the beginning of a trace file

Syntax 3


Syntax 1: For list boxes

Description

Deletes all the items from a list.

Applies to

ListBox, DropDownListBox, PictureListBox, and DropDownPictureListBox controls

Syntax

listboxname.Reset ( )

Argument

Description

listboxname

The name of the ListBox control from which to delete all items


Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If listboxname is null, Reset returns null. The return value is usually not used.

Examples

This statement deletes all items in the ListBox portion of ddlb_Actions:

ddlb_Actions.Reset()

See also

DeleteItem

Syntax 2: For graphs

Description

Deletes the data, the categories, or the series from a graph.

Applies to

Graph controls in windows and user objects and graphs within a DataWindow object with an external data source.

Does not apply to other graphs within DataWindow objects because their data comes directly from the DataWindow.

Syntax

controlname.Reset ( graphresettype )

Argument

Description

controlname

The name of the graph object in which you want to delete all the data values or all series and all data values

graphresettype

A value of the grResetType enumerated datatype specifying whether you want to delete only data values or all series and all data values:

  • All! -- Delete all series, categories, and data in controlname

  • Category! -- Delete categories and data in controlname

  • Data! -- Delete data in controlname

  • Series! -- Delete the series and data in controlname


Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, Reset returns null. The return value is usually not used.

Usage

Use Reset to clear the data in a graph before you add new data.

Examples

This statement deletes the series and data, but leaves the categories, in the graph gr_product_data:

gr_product_data.Reset(Series!)

See also

AddData

AddSeries

Syntax 3: For trace files

Description

Goes back to the beginning of the trace file so you can begin rereading the file contents.

Applies to

TraceFile objects

Syntax

instancename.Reset ( )

Argument

Description

instancename

Instance name of the TraceFile object


Return value

ErrorReturn. Returns one of the following values:

  • Success! -- The function succeeded

  • FileNotOpenError! -- The specified trace file has not been opened

Usage

Use this function to return to the start of the open trace file and begin rereading the contents of the file. To use the Reset function, you must have previously opened the trace file with the Open function. You use the Reset and Open functions as well as the other properties and functions provided by the TraceFile object to access the contents of a trace file directly. You use these functions if you want to perform your own analysis of the tracing data instead of using the available modeling objects.

Examples

This example returns execution to the start of the open trace file ltf_file so that the file's contents can be reread:

TraceFile ltf_file
string ls_filename
 
ltf_file = CREATE TraceFile
ltf_file.Open(ls_filename)
...
ltf_file.Reset(ls_filename)
...

See also

Open

NextActivity

Close

Syntax 4: For MimeMessage object

Description

Resets the MimeMessage information.

Applies to

MimeMessage object

Syntax

mimemessage.Reset({ integer resettype})

Argument

Description

mimemessage

A MimeMessage object identifying the email message in which you want to reset MimeMessage information.

resettype (optional)

Specifies the values of the reset type. Values are:

0 -- (Default) Reset all the following types

1 -- Reset Recipients

2 -- Reset Ccs

3 -- Reset Bccs

4 -- Reset Attachments

5 -- Reset LinkedResources

6 -- Reset Sender


Return value

Integer.

Returns 1 if it succeeds and -1 if it fails.

Examples

The following example resets the recipient.

lnv_SmtpClient.Message.AddRecipient("Tester1@gmail.com" )
lnv_SmtpClient.Message.AddRecipient("Tester2@gmail.com", "Tester2Name" )
lnv_SmtpClient.Message.Reset(1) 

The following example resets the attachment.

lnv_SmtpClient.Message.AddAttachment("test02.docx")
lnv_SmtpClient.Message.Reset(4) 

The following example resets the recipient, Cc, Bcc, attachment, linked resources and sender.

lnv_SmtpClient.Message.Reset(0) 

See also

AddAttachment

AddBcc

AddCc

AddLinkedResource

AddRecipient

GetSender

SetSender