20th Chapter-Development Delphi Object Type Data management function (III.) (3)

Source: Internet
Author: User
Tags count
Properties and methods of 20.2.2.1 Twriter objects

1. Position Properties
Statement: Property position:longint;
The Position property of the Twriter object represents the current position to write in the associated stream, TReader
Objects also have this property, but unlike the Treader object, the value of the position of the Twriter object is smaller than the position value of the stream, which is clear from the realization of the property.
2. Rootancesstor Properties
Statement: Property rootancestor:tcomponent;
The Rootancestor property represents the ancestor of the part that the root attribute refers to. If root
is an inherited form, the writer object compares the form owning part to the corresponding part in the ancestor form, and then writes only those parts that are different from the ancestors.
3. Write method
Statement: Procedure Write (const BUF; Count:longint);
The Write method writes count bytes from the BUF to the stream associated with the writer.
4. Writelistbegin method
Statement: procedure Writelistbegin;
The Writelistbegin method writes the project list start flag to the stream of the write object, which means that a series of items are stored behind it. Reader object, when reading this series of items, first call the Readlistbegin method to read the flag bit, and then use Endoflist to determine whether the list ends and read the project with a circular statement. The Writelistend method Write list end flag must be called after the call to the Writelistbegin method, and the corresponding Readlistend method reads the end flag in the reader object.
5. Writelistend method
Statement: procedure Writelistend;
The Writelistend method is written to the end of the list of items in the stream, which is the method that matches the Writelistbegin.
6. Writeboolean method
Statement: Procedure Writeboolean (Value:boolean);
The Writeboolean method writes the Boolean value passed by value to the stream.
7. Writechar method
Statement: Procedure Writechar (Value:char);
The Writechar method writes the characters in value to the stream.
8. Writefloat method
Statement: Procedure Writefloat (value:extended);
The Writefloat method writes value into the stream of floating-point numbers.
9. Writeinteger method
Statement: Procedure Writeinteger (Value:longint);
The Writeinteger method writes integers in value to the stream.
WriteString method
Statement: Procedure WriteString (const value:string);
The WriteString method writes the string in value to the stream.
Writeident method
Statement: Procedure writeident (const ident:string);
The Writeident method writes ident incoming identifiers to the stream.
Writesignature method
Statement: procedure Writesignature;
Writesignature method will be Delphi
The Filer object tag is written to the stream. The Writerootcomponent method invokes the Writesignature method to write the filer tag before the part is written to the stream. The reader object calls the Readsignature method to read the label before reading the part to guide the read operation.
Writcomponent method
Statement: Procedure writecomponent (component:tcomponent);
The Writecomponent method invokes the WriteState method of the parameter component to write the part to the stream. Before calling WriteState, Writecomponent also resets the Componetnstate property of component to cswriting. Clears the cswriting when the WriteState is returned.
Writerootcomponent method
Statement: Procedure writerootcomponent (root:tcomponent);
The Writerootcomponent method sets the writer object root property to the value of the parameter root, and then calls the Writesignature method to write the Filer object tag to the stream. Finally, the Writecomponent method is called to store the root part in the stream.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.