Detailed information in the easy language of the data type _ Easy language

Source: Internet
Author: User
Tags numeric

Various data types exist in different storage formats for storage on disk or in memory, so there is a different data type. Understanding the characteristics of various data is very important for programming development.

Programs often do some operations, easy language operations are to use operator recognition processing, and the operation of the expression to complete the operation. The description of the relationship between the data in the program is also done through operators.

1. Easy-language data types

A procedure should include two aspects: 1. Description of the data, 2. Operation steps, that is, the description of the program action.

The data is the object of the program operation, and the result of the operation changes the content of the data. For example, to make a dish, choose the raw material for cooking (that is, describe the data), then start cooking (that is, the operation of the data), and finally do a dish (change the state of the original data, the results of the calculation).

Programming is the same, the program to the operation of some data, before the operation to be manipulated to describe the data, that is, the definition of the relevant data types of variables, and then use the command or method to operate the data, and finally get the results of the operation, the results can be displayed. Chinese programming

The data types of easy language are distinguished from data structure, which can be divided into basic data types and composite data types. Basic data types include numeric, logical, date-time, and so on; composite data types include all user and support library custom data type data types that can be used to describe the types of variables or the types of component properties, and so on.

2. Basic data types

2.1 Understanding Basic data types

There are six basic types of data in an easy language, including numeric, logical, date-time, text, byte set, subroutine pointer type.

The numerical data includes the byte type, the short integer type, the integer type, the long integer type, the decimal type, and the double precision decimal type. This type represents the range of values and the length of the representation in the machine, and you can view the length and bytes of the data type in the length and overflow table of the data type.

Data type name occupies byte value range
BYTE Type 1 0 to 255 Chinese programming
Short integer type 2-32,768 to 32,768
Integer type 4-2,147,483,648 to 2,247,483,647
Long integer type 8-9,223,372,036,854,775,808 to 9,233,372,036,854,775,807
Decimal type 4-3.4e38 to 3.4E38 (7 decimal digits)
Double decimal type 8-1.7e308 to 1.7E308 (15 decimal)
Logical type 2 "true" or "false"
Date-time Type 8 100 year from January 1 to December 31, 9999. In the Yi said [2007-10-24]
Subroutine pointer 4 size is 4 bytes. Some data types of data are used to interact with external programs or operating system APIs, and Chinese programming
Is the address of a subroutine in the store.
The text type consists of a series of characters ending with byte 0. "China Yi au Technology Forum" in the easy to express
The byte set is a piece of byte data. In the easy representation of {2,3,2,4} MP3 and pictures are typical byte set data;

2.2 Comparison of data

In programming, comparisons are often made between various data. Comparison between the same data types can be done directly, and the comparison between different kinds of data, it is necessary to convert the data type, the different types of data type to the same type can be compared, otherwise the program will be wrong.
For example, enter an integer in the edit box to compare whether the content in the edit box is greater than 50. Because the content in the edit box is a text, first convert the contents of the edit box to an integer data, and then compare it by entering the following code:
To Values (edit box 1. Content) > 50

The comparison returns a logical type of data that is greater than 50, returns "true", less than or equal to, and returns "false".

The commands for converting between data types that are commonly used in easy languages are:

To Value () is used to convert a general-purpose data to an integer
to text () to convert a generic data to a the literal
to byte set () is used to convert a general-purpose data to a byte set data
, which is converted from a byte set (,) " Used to convert a byte set type of data to a generic type of data. The second parameter of the command controls the data type that is intended to be converted
to time () to convert a text-type data to a datetime
variable, as well, be sure to note the data type of the variable. Variables of different types of data must be converted to the same type before being compared.

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.