CS 106 Computing Fundamentals II Chapter 71 “Indexing”

Slides:



Advertisements
Similar presentations
List Box in Widget Swap Drop Down Lists in GPE Naming Convention List boxeslst (El Es Tee – not 1 s t) Drop Down Listscbo (for combo box – old name)
Advertisements

1 CS 106, Winter 2009 Class 19, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
An Object-Oriented Approach to Programming Logic and Design Chapter 7 Arrays.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
1 CS 106 Computing Fundamentals II Chapter 16 “Naming In Excel” Herbert G. Mayer, PSU CS Status 7/6/2013 Initial content copied verbatim from CS 106 material.
ECE 103 Engineering Programming Chapter 10 Variables, AKA Objects Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103.
COMPUTER SCIENCE FEBRUARY 2011 Lists in Python. Introduction to Lists Lists (aka arrays): an ordered set of elements  A compound data type, like strings.
1 CS 106 Computing Fundamentals II Chapter 17 “Introduction To VBA” Herbert G. Mayer, PSU CS status 6/30/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 25 “Variables, Assignment Statement” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
1 CS 106 Computing Fundamentals II Chapter 29 “Creating A User Form” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 7 “Showing Developer Tab” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from CS.
Indexing. The Idea of Indexing Indexing means having several data items organized under a single name where the individual items can be referred to by.
1 CS 106 Computing Fundamentals II Chapter 4 “Excel Basics for Mac” Herbert G. Mayer, PSU CS status 6/27/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 34 “Conditionals In Excel” Herbert G. Mayer, PSU CS Status 7/17/2013 Initial content copied verbatim from CS.
ECE 103 Engineering Programming Chapter 61 Abstract Data Types Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
1 CS 106 Computing Fundamentals II Chapter 61 “Loops” Herbert G. Mayer, PSU CS Status 7/29/2013 Initial content copied verbatim from CS 106 material developed.
1 CS 106 Computing Fundamentals II Chapter 32 “Boolean Expressions” Herbert G. Mayer, PSU CS Status 7/14/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 84 “Array Formulae” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
CS 161 Introduction to Programming and Problem Solving Chapter 19 Single-Dimensional Arrays Herbert G. Mayer, PSU Status 10/8/2014 Initial content copied.
1 CS 106 Computing Fundamentals II Chapter 67 “Working With Files” Herbert G. Mayer, PSU CS status 6/24/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 75 “Arrays” Herbert G. Mayer, PSU CS Status 7/31/2013 Initial content copied verbatim from CS 106 material developed.
ECE 103 Engineering Programming Chapter 52 Generic Algorithm Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
CSE 232: C++ memory management Overview of Arrays Arrays are the simplest kind of data structure –One item right after another in memory (“contiguous range”
1 CS 106 Computing Fundamentals II Chapter 23 “Controls And Events” Herbert G. Mayer, PSU CS Status 7/5/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 211 “Coding And Debugging” Herbert G. Mayer, PSU CS status 6/29/2013 Initial content copied verbatim from CS.
1 CS 106 Computing Fundamentals II Chapter 210 “Adding Controls to User Forms” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
Python Programming Lecture II. Data Data is the raw material that programs manipulate. Data comes in different flavours. The basic ones are called “primitive.
1 CS 106 Computing Fundamentals II Chapter 6 “How To Zip & Unzip Files” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from.
CS 161 Introduction to Programming and Problem Solving Chapter 17 Nested Loops Herbert G. Mayer, PSU Status 9/8/2014 Initial content copied verbatim from.
1 CS 106 Computing Fundamentals II Chapter 28 “Scope” Herbert G. Mayer, PSU CS Status 7/14/2013 Initial content copied verbatim from CS 106 material developed.
1 CS 106 Computing Fundamentals II Chapter 42 “Sub Procedures And Functions” Herbert G. Mayer, PSU CS Status 8/5/2013 Initial content copied verbatim from.
1 CS 106 Computing Fundamentals II Chapter 85 “Excel Tables” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
7 - Programming 7J, K, L, M, N, O – Handling Data.
Sections 10.1 – 10.4 Introduction to Arrays
CS 106 Computing Fundamentals II Chapter 5 “Excel Basics for Windows”
Chapter 6: Using Arrays.
Unit 5 Lesson 3: Introduction to Arrays
Arrays: Checkboxes and Textareas
Data Types and Structures
CS 106 Computing Fundamentals II Chapter 35 “Controls For Choices”
CS 106 Computing Fundamentals II Chapter 77 “Algorithm”
CS 106 Computing Fundamentals II Chapter 33 “Conditional Statements”
Chapter 8 Arrays Objectives
Visual Basic .NET BASICS
Introduction to Strings
Chapter 8 Arrays Objectives
CS 106 Computing Fundamentals II Chapter 73 “Ranges”
CS 106 Computing Fundamentals II Chapter 66 “Working With Strings”
Why arrays are cool 4/25/2007.
Topics discussed in this section:
ECE 103 Engineering Programming Chapter 32 Array Parameters
Herbert G. Mayer, PSU CS Status 8/2/2013
Chapter 5: Lists and Arrays
ECE 103 Engineering Programming Chapter 56 Runtime Errors
CS 106 Computing Fundamentals II Chapter 64 “For Loop Variations”
ECE 103 Engineering Programming Chapter 19 Nested Loops
ECE 103 Engineering Programming Chapter 51 Random Numbers
ECE 103 Engineering Programming Chapter 25 C Strings, Part 1
ECE 103 Engineering Programming Chapter 46 argc, argv, envp
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
CS 106 Computing Fundamentals II Chapter 69 “Event Loop”
Chapter 8 Arrays Objectives
Programming Logic and Design Fifth Edition, Comprehensive
ECE 103 Engineering Programming Chapter 35 C Pointers, Part 1
Herbert G. Mayer, PSU CS Status 7/19/2015
To understand what arrays are and how to use them
ECE 103 Engineering Programming Chapter 38 C Pointers, Part 2
Just Basic Lessons Mr. Kalmes.
Working with Arrays in MATLAB
Introduction to Computer Science
Presentation transcript:

CS 106 Computing Fundamentals II Chapter 71 “Indexing” Herbert G. Mayer, PSU CS Status 7/24/2013 Initial content copied verbatim from CS 106 material developed by CS professors: Cynthia Brown & Robert Martin

Syllabus Indexing String Structure Indexing Listboxes Some Useful Properties

Indexing Indexing is the process of selecting one of multiple elements from an aggregate datum: A typical aggregate data structure is the array or string The selection is called “indexing” In simpler languages, the index is an integer numeric value More sophisticated languages allow other index types The index range is contiguous, starting at 0 or 1 It’s like having an address where you need a house number as well as a street name Indexing often “cycles” through all contiguous items in a linear fashion, using a loop

String Structure A string in VBA can be variable length and has an internal structure Each character in the string also has a position number, also called an index The first character in a string however has index 1, etc String “This is a string.” has 17 characters, counting the blanks and period ‘.‘: T h i s a t r n g . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Indexing in Listboxes We used listboxes as a place to print information on a user form But they can also be used as a flexible way to store and access information The workbook called IndexListBox has examples of how to use these features One important fact: indexing in a listbox starts at 0 instead of 1

Some Useful Properties lstName.Listcount is the number of items in list box lstName lstName( anIndex ) is the item in the listbox lstName with index anIndex lstName.ListIndex is the index of the selected item in the listbox

Demo: Index ListBox