Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Simple Count Loop URGENT

Posted on 2006-11-20
5
Medium Priority
?
177 Views
Last Modified: 2010-03-05
I am trying to make this simple loop work, but it is not, needed fast, reason for large amount of points.  I want to count from  say 1 to 250 in increments of 1....Below code only spits out tgvz4263001 ....Thanks!

Desired results:
tgvz4263001
tgvz4263002
tgvz4263003
tgvz4263004
and so on........


$client = "0";

for ($client <= 250)
{

$e1=$cient1;
$client1=$e1 + 1;

$id = "tgvz426300$client1";

print <<"PrintTag";
<html><head><title>Reporter</title>
</head><body>
$id<br>
</body></html>
PrintTag

}
0
Comment
Question by:precision
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 17981154
for( 'tgvz4263001' .. 'tgvz4263004' ){
    print <<"PrintTag";
<html><head><title>Reporter</title>
</head><body>
$_<br>
</body></html>
PrintTag
}
0
 
LVL 84

Expert Comment

by:ozo
ID: 17981185
$client = "0";
for ($client <= 250)
is the same as
for( 1 )
you may have meant
for( $client=0; $client <= 250; $client++ ){
or
for $client( 0..250 ){
or
while( $client <= 250 ){
  $e1=$client;
  $client=$e1 + 1;
0
 

Author Comment

by:precision
ID: 17981190
But how do I get the variable change?
when it gets to "100" the variable should be
tgvz426300100
not tgvz426400

see tgvz426300 is fixed, the counter is $client

If that makes any sense....
0
 
LVL 84

Accepted Solution

by:
ozo earned 2000 total points
ID: 17981241
for $client( 1..250 ){
   $id = "tgvz426300$client";
0
 

Author Comment

by:precision
ID: 17981290
YOU THE MAN!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question