Multiple Starting Values, Ending Values and Step Values in Looping Constructs for Structured Programming Languages

For starters, loop is a repetition structure that enables your program to execute the same statement(s) over and over and over and over and over again.There are several looping constructs that can be used for structured languages such as for, while,do-while,while-until and do-until. It's just so sad that most books showed us to use those statements by using only a single starting value,an ending value, and counter which made us conclude that it isn't possible to use compound loop elements.But did you know that you can use several initializations,loop conditions, and starting values in any looping constructs? You heard me right my friend. Here's how.
Syntax:

startingvalue1;
startingvalue2;
startingvaluen;
while((endingvalue1)&&(endingvalue2)&&(endingvaluen))
{
statement1;
statement2;
statementn;
stepvalue1;
stepvalue2;
stepvaluen;
}
For the sake of example I will be using while statement in PHP.

Example:
<?php
$intcount1=1;
$intcount2=10;
$intcount3=21;
while(($incount1<=10)&&($intcout2>=1)&&($intcount3<=30))
{
echo "$intnum1 $intnum2 $intnum3 
";
$intcount1++;
$intcount2--;
$intcount3++;
}
?>
The script above produces the following outputs:

1 10 21
2 9 22
3 8 23
4 7 24
5 6 25
6 5 26
7 4 27
8 3 28
9 2 29
10 1 30

You can use this as a good alternative for nested loops. Or if you wanted to hit several birds in one stone, that is, several outputs in one looping statement.

Changing the Background and Static Text Color of your MFC Dialog box

By default, VC++ doesn’t have a backcolor or forecolor control properties unlike other visual programming languages such as VB or VFP. But you can change the dialog box text and back color by following these simple steps.

1. Start VC++ by clicking the start button>All Programs>Microsoft Visual Studio 6.0> Microsoft Visual C++ 6.0.
2. Click File>New>Select MFC AppWizard (exe)>Type the Project name>Click Ok>Select Dialog based>Click Finish.
3. Right click your dialog box>In the Class name list box>Select CprojectnameAPP>Double click the InitInstance member function.

The following codes will appear:

CBkColorApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CBkApp initialization
BOOL CBkColorApp::InitInstance()
{
AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
//  the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic();// Call this when linking to MFC statically
#endif
4. Type the following before or after the line AfxEnableControlContainer(). Change the numbers inside the oval brace to create different background or text colors.
SetDialogBkColor(RGB(255,255,255),RGB(255,255,255));
5. The first RGB is for the backcolor and the other one is for the text.
6. Click the run icon to view the result.