15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

78<br />

Database Programming Languages<br />

different operating systems, you can create a Revolution program that can<br />

run on different operating systems (such as Windows, Linux, and Mac OS X).<br />

Database Programming Languages<br />

Programming languages, such as C++, are general-purpose languages because<br />

they can literally be used to create any type of program from operating systems<br />

and word processors to antivirus utilities and video games. However, in<br />

the business world, the most common type of custom programs needed are<br />

those that store and retrieve data, such as invoices, inventory, customer<br />

in<strong>for</strong>mation, and so on.<br />

Although it’s possible to write a database program in C++, that essentially<br />

doubles the amount of work you need to do.<br />

✦ Write your program’s user interface and commands <strong>for</strong> manipulating<br />

data.<br />

✦ Write commands to store and retrieve data, essentially creating a<br />

database program from scratch.<br />

Rather than rewrite (and test) your own database program, it’s much easier<br />

just to customize an existing database program instead. Many database programs<br />

include their own <strong>programming</strong> language. By using a database <strong>programming</strong><br />

language, you just have to customize the appearance of the<br />

database program by designing a user interface along with commands <strong>for</strong><br />

manipulating data. The database program does all the work of storing,<br />

retrieving, and rearranging the actual data so you can focus on what your<br />

program should do with data and not with the technical details <strong>for</strong> how it<br />

should store data.<br />

The dBASE <strong>programming</strong> language<br />

One of the earliest database <strong>programming</strong> languages <strong>for</strong> personal computers<br />

was dBASE. By using the dBASE language, you could create a user interface,<br />

write commands <strong>for</strong> storing data, and write additional commands <strong>for</strong> retrieving<br />

and manipulating that data.<br />

The following dBASE code creates a simple menu and waits <strong>for</strong> the user to<br />

type in a choice by choosing a number from 1–6.<br />

SET TALK OFF<br />

USE CUSTOMER.DAT<br />

STORE 0 TO choice<br />

STORE “ No. Name Title Address” TO head<br />

DO WHILE choice 6<br />

ERASE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!