Programming
All tutorials in Programming
Sort By:    Name   Rating   Views  Comments    Date 
Browse Pages :    <<  <  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  >  >> 
Class Methods
Submitted 29 April 2008

A method is a procedure or function that performs an operation on an object. A class method is a method that operates on a class reference instead of an object reference. If you read between the lines, you will find that class methods are accessible even when you haven't created an instance of the class (the object).

Views: 284 Comments: 0
FUNCTIONS AND PROCEDURES
Submitted 29 April 2008

Subroutines are an important part of any programming language, and Object Pascal is no exception. In Delphi, there are generally two types of subroutines: a function and a procedure. The usual difference between a function and a procedure is that a function can return a value, and a procedure generally will not do so. A function is normally called as a part of an expression.

Views: 345 Comments: 0
STRING TYPES IN DELPHI
Submitted 29 April 2008

As like in any programming language, in Delphi, variables are placeholders used to store values; they have names and data types. The data type of a variable determines how the bits representing those values are stored in the computer's memory.

Views: 334 Comments: 0
Loops in Delphi
Submitted 29 April 2008

When the for statement begins running the counter variable is set to the starting value. Delphi than checks whether the value for the counter is less than the ending value. If the value is greater, nothing is done (program execution jumps to the line of code immediately following the for loop code block). If the starting value is less than the ending value, the body of the loop is executed (here:...

Views: 279 Comments: 0
WORKING WITH COMPONENTS-Delphi
Submitted 29 April 2008

First of all, let's distinguish components from controls. Simply putt controls are those components that the user can see. Furthermore, Delphi distinguishes between windowed and nonwindowed (graphical) controls. The major distinction is that windowed controls can receive the focus and nonwindowed controls cannot. The distinction between windowed and graphical controls can be important when you...

Views: 453 Comments: 0
VARIABLE SCOPE - Delphi
Submitted 29 April 2008

he term scope refers to the availability of a variable or constant declared (or used) in one part of a program to other parts of a program. Unless we specify otherwise, changing the value of a variable named, let's say, SomeNumber in one procedure (function) will not affect another variable with the same name in another procedure (function). Since Delphi requires us to declare variables, it's a...

Views: 510 Comments: 0
The Truth about Declarations
Submitted 29 April 2008

NAMES ARE FUNDAMENTAL TO PROGRAMMING, as I said a few chapters ago. There are a lot of details involved in declaring and using names. I have been avoiding some of those details. In this section, I'll reveal most of the truth (although still not the full truth) about declaring and using variables in Java. The material under the headings "Combining Initialization with Declaration" and...

Views: 333 Comments: 0
More on Program Design - Java
Submitted 29 April 2008

UNDERSTANDING HOW PROGRAMS WORK IS ONE THING. Designing a program to perform some particular task is another thing altogether. In Section 3.2, I discussed how stepwise refinement can be used to methodically develop an algorithm. We can now see how subroutines can fit into the process. Stepwise refinement is inherently a top-down process, but the process does have a "bottom," that is, a...

Views: 695 Comments: 0

AS COMPUTERS AND THEIR USER INTERFACES have become easier to use, they have also become more complex for programmers to deal with. You can write programs for a simple console-style user interface using just a few subroutines that write output to the console and read the user's typed replies. A modern graphical user interface, with windows, buttons, scroll bars, menus, text-input boxes, and so on,...

Views: 486 Comments: 0
Return Values - Java
Submitted 29 April 2008

A SUBROUTINE THAT RETURNS A VALUE is called a function. A given function can only return a value of a specified type, called the return type of the function. A function call generally occurs in a position where the computer is expecting to find a value, such as the right side of an assignment statement, as an actual parameter in a subroutine call, or in the middle of some larger expression. A...

Views: 420 Comments: 0
Parameters - Java
Submitted 29 April 2008

IF A SUBROUTINE IS A BLACK BOX, then a parameter provides a mechanism for passing information from the outside world into the box. Parameters are part of the interface of a subroutine. They allow you to customize the behavior of a subroutine to adapt it to a particular situation.

Views: 364 Comments: 0

EVERY SUBROUTINE IN JAVA MUST BE DEFINED inside some class. This makes Java rather unusual among programming languages, since most languages allow free-floating, independent subroutines. One purpose of a class is to group together related subroutines and variables. Perhaps the designers of Java felt that everything must be related to something. As a less philosophical motivation, Java's designers...

Views: 345 Comments: 0
Introduction to Applets and Graphics
Submitted 29 April 2008

FOR THE PAST TWO CHAPTERS, you've been learning the sort of programming that is done inside a single subroutine. In the rest of the text, we'll be more concerned with the larger scale structure of programs, but the material that you've already learned will be an important foundation for everything to come.In this section, before moving on to programming-in-the-large, we'll take a look at how...

Views: 291 Comments: 0
The switch Statement-Java
Submitted 29 April 2008

THE SECOND BRANCHING STATEMENT in Java is the switch statement, which is introduced in this section. The switch is used far less often than the if statement, but it is sometimes useful for expressing a certain type of multi-way branch. Since this section wraps up coverage of all of Java's control statements, I've included a complete list of Java's statement types at the end of the section.

Views: 432 Comments: 0
The if Statement-Java
Submitted 29 April 2008

Now, an if statement is, in particular, a statement. This means that either statement-1 or statement-2 in the above if statement can itself be an if statement. A problem arises, however, if statement-1 is an if statement that has no else part. This special case is effectively forbidden by the syntax of Java. Suppose, for example, that you type

Views: 341 Comments: 0
Browse Pages :    <<  <  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  >  >>