Which Variable Data Types Are Stored in Sequential Order in Visual Basic?
How Data is Stored Sequentially
- Sequential access allows for the use of three operations: "Input," "Output" and "Append". Input reads a file, while Output writes data sequentially to the file. Append adds data to the end of a sequential file. Output and Append are the "data storing" operations. When using the Output operation, a file can already be open or Visual Basic will create a new file and open it for the storing of data. To use the Append operation to add data to a file, that file must be open or Visual Basic will create a new file.
Numeric Data Types
- Visual Basic has ten numeric data types: "Currency," "Decimal," "Double," "Integer," "Long," "Short," "Single," "UInteger," "ULong," and "UShort." Currency, Decimal, Double, and Single support signed numeric values and the use of a decimal point. Integer, Long and Short support signed whole-number values. UInteger, ULong and UShort support unsigned whole-number values. You can use any of these data types with the Output or Append operations.
The "String" Data Type
- The "String" data type inputs text and can be variable length or fixed length. You must still enclose String in double quotation marks, but these marks will not be written as part of the file's record. If you need to write the double quotation marks as part of the field, then you need to enclose the text with the double quotation marks in an additional pair of double quotation marks. For example, when you declare variable "quote" as type String, you would enter " ""Quote"" " as your field to include the double quotation marks as part of the file.
The "Date" Data Type
- Visual Basic uses the "Date" data type to denote both date and time. When using the Date data type with a variable in a sequential file, the Date field must be enclosed within two number signs. For example, when you declare variable "DOB" as type Date you would enter the field as "DOB = #12/06/85#." When the Date field is used for time, it must also use the two number signs. For example, when you declare variable "ApptTime" as type "Date," you would enter the field as either "ApptTime = #1:30:00 PM#" or "ApptTime = #13:30:00#."