GetFullState

Description

Retrieves the complete state of a DataWindow or DataStore as a blob.

This method is used primarily in distributed applications.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataStore object

Web ActiveX

DataWindow control

Syntax

PowerBuilder

long dwcontrol.GetFullState ( blob dwasblob )

Web ActiveX

number dwcontrol.GetFullState ( )

Argument

Description

dwcontrol

A reference to a DataWindow control or DataStore.

dwasblob

A variable into which the returned DataWindow will be placed.

For the Web ActiveX, call GetFullStateBlob to get the value instead of using the reference variable.

Returns

Returns the number of rows in the DataWindow blob if it succeeds and –1 if an error occurs. GetFullState will return –1 if the DataWindow control or DataStore does not have a DataWindow object associated with it.

If any argument value is null, in PowerBuilder and JavaScript the method returns null.

Usage

GetFullState retrieves the entire state of a DataWindow or DataStore, including the DataWindow object specification, the data buffers, and the status flags. When you call SetFullState to apply the blob created by GetFullState to another DataWindow, the target DataWindow has enough information to recreate the source DataWindow.

Because the blob created by GetFullState contains the DataWindow object specification, a subsequent call to SetFullState will overwrite the DataWindow object for the target DataWindow control or DataStore. If the target of SetFullState does not have a DataWindow object associated with it, the blob will assign one. In this case, SetFullState has the effect of setting the DataObject property for the target.

When you use GetFullState and SetFullState to synchronize a DataWindow control on a client with a DataStore on a server, you need to make sure that the DataWindow object for the DataStore contains the presentation style you want to display on the client.

Examples

Example 1

These statements retrieve data into a DataStore and use GetFullState to retrieve the complete state of the DataStore into a blob:

// Instance variables:

// datastore ids_datastore

// blob blb_data

long ll_rv


ids_datastore = create datastore

ids_datastore.dataobject = "d_emplist"

ids_datastore.SetTransObject (SQLCA)

ids_datastore.Retrieve()

ll_rv = ids_datastore.GetFullState(blb_data)

See also