• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » DS » Basic » How will you explain Record and Record Structure
Next →
← Prev

How will you explain Record and Record Structure

By Dinesh Thakur

Record and record structures : The ::struct::record package provides a mechanism to group variables together as one data structure, similar to a ‘C’ structure. The members of a record can be variables or other records. However, a record can not contain circular record, i.e. records that contain the same record as a member.

This package was structured so that it is very similar to how Tk objects work. Each record definition creates a record object that encompasses that definition. Subsequently, that record object can create instances of that record. These instances can then be manipulated with the cget and configure methods.

The package only contains one top level command, but several sub commands (see below). It also obeys the namespace in which the record was define, hence the objects returned are fully qualified.

record define recordName recordMembers ? instanceName1

instanceName2 … ?

Defines a record. recordName is the name of the record, and is also used as an object command. This object command is used to create instances of the record definition. recordMembers are the members of the record that make up the record definition. These are variables and other record. If optional instanceName args are given, then an instance is generated after the definition is created for each instanceName.

record show record

Returns a list of records that have been defined.

record show instances recordName

Returns the instances that have been instantiated by recordName.

record show members recordName

Returns the members that are defined for record recordName. It returns the same

format as how the records were defined.

record show values instanceName

Returns a list of values that are set for the instance instanceName. The output is a list of key/value pairs. If there are nested records, then the values of the nested records will itself be a list.

record exists record recordName

Tests for the existence of a record with the name recordName.

record exists instance instanceName

Tests for the existence of a instance with the name instanceName.

record delete record recordName

Deletes recordName, and all instances of recordName. It will return an error if the

record does not exist.

record delete instance instanceName

Deletes instance with the name of instanceName. It will return an error if the

instance does not exist.

Record Members : Record members can either be variables, or other records, However, the same record can not be nested witin itself (circular). To define a nested record, you need to specify the record keyword, along the with name of the record, and the name of the instance of that nested record. For example, it would look like this :

# this is the nested record

record define mynestedrecord {

nest1

nest2

}

# This is the main record

record define myrecord {

mem1

mem2

{record mynestedrecord mem3}

}

 

You’ll also like:

  1. What is a record set ? What are its type ? Explain
  2. Explain Arrangement of Files or Concept of directory Structure
  3. What is Software Requirements Specification? Explain Structure and Characteristics of SRS.
  4. What is Boot Record?
  5. What are the steps needed to delete a record from database
Next →
← Prev
Like/Subscribe us for latest updates     

About Dinesh Thakur
Dinesh ThakurDinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps.

Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.


For any type of query or something that you think is missing, please feel free to Contact us.


Primary Sidebar

Data Structure

Data Structure Tutorials

  • DS - Home
  • DS - Sorting
  • DS - Shortest Path Algorithm
  • DS - free() Function
  • DS - Graph Traversals
  • DS - Linear Search
  • DS - Heap Sort
  • DS - Searching
  • DS - Linked Lists
  • DS - Algorithms
  • DS - Bubble Sort
  • DS - Quick Sort
  • DS - Binary Search
  • DS - realloc() Vs free()
  • DS - Steps to Plan Algorithm
  • DS - Record Structure
  • DS - Single Linked List
  • DS - Purpose of realloc()
  • DS - Use malloc()
  • DS - calloc() Vs malloc()

Other Links

  • Data Structure - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2023. All Rights Reserved.