Increment a count

  • Thread starter Thread starter bthumber
  • Start date Start date
B

bthumber

I had an application method that counts the total number of records that like
for example buffal. From 0-99 things work find, see the code:

int count = (int)Session["hostCount"];

if ((count >= 0) && (count <= 98))
{
count++;

SequenceNumbers sn = new SequenceNumbers();
lblSubStr.Text = sn.GetNumberSequence(count);
}

// first record would be buffal01, last record buffal99, next record should
be buffala1.

If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 and the
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:

else if ((count >= 0) && (count <= 233))

{// got to increment this somewhere
count = 0;

AlphaNumberSeq ans = new AlphaNumberSeq();
lblSubStr.Text = ans.GetAlphaNumberSeq(count);

}

How can I start the AlphaNumberSeq to zero and increment the count each time?
 
I had an application method that counts the total number of records that like
for example buffal. From 0-99 things work find, see the code:

        int count = (int)Session["hostCount"];

        if ((count >= 0) && (count <= 98))
        {
            count++;

            SequenceNumbers sn = new SequenceNumbers();
            lblSubStr.Text = sn.GetNumberSequence(count);
        }

// first record would be buffal01, last record buffal99, next record should
be buffala1.

If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 andthe
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:

        else if ((count >= 0) && (count <= 233))

        {// got to increment this somewhere
            count = 0;

            AlphaNumberSeq ans = new AlphaNumberSeq();
            lblSubStr.Text = ans.GetAlphaNumberSeq(count);

        }

How can I start the AlphaNumberSeq to zero and increment the count each time?

Hi,

It's not clear what you want from your post.
 
I had an application method that counts the total number of records that like
for example buffal. From 0-99 things work find, see the code:

        int count = (int)Session["hostCount"];

        if ((count >= 0) && (count <= 98))
        {
            count++;

            SequenceNumbers sn = new SequenceNumbers();
            lblSubStr.Text = sn.GetNumberSequence(count);
        }

// first record would be buffal01, last record buffal99, next record should
be buffala1.

If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 andthe
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:

        else if ((count >= 0) && (count <= 233))

        {// got to increment this somewhere
            count = 0;

            AlphaNumberSeq ans = new AlphaNumberSeq();
            lblSubStr.Text = ans.GetAlphaNumberSeq(count);

        }

How can I start the AlphaNumberSeq to zero and increment the count each time?

Hi,

It's not clear what you want from your post.
 
bthumber said:
I had an application method that counts the total number of records that like
for example buffal. From 0-99 things work find, see the code:

int count = (int)Session["hostCount"];

if ((count >= 0) && (count <= 98))
{
count++;

SequenceNumbers sn = new SequenceNumbers();
lblSubStr.Text = sn.GetNumberSequence(count);
}

// first record would be buffal01, last record buffal99, next record should
be buffala1.

If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 and the
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:

else if ((count >= 0) && (count <= 233))

{// got to increment this somewhere
count = 0;

AlphaNumberSeq ans = new AlphaNumberSeq();
lblSubStr.Text = ans.GetAlphaNumberSeq(count);

}

How can I start the AlphaNumberSeq to zero and increment the count each time?

Are SequenceNumbers and AlphaNumbersSeq classes that you wrote? I cannot
find anything about them.

Mike
 
bthumber said:
I had an application method that counts the total number of records that like
for example buffal. From 0-99 things work find, see the code:

int count = (int)Session["hostCount"];

if ((count >= 0) && (count <= 98))
{
count++;

SequenceNumbers sn = new SequenceNumbers();
lblSubStr.Text = sn.GetNumberSequence(count);
}

// first record would be buffal01, last record buffal99, next record should
be buffala1.

If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 and the
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:

else if ((count >= 0) && (count <= 233))

{// got to increment this somewhere
count = 0;

AlphaNumberSeq ans = new AlphaNumberSeq();
lblSubStr.Text = ans.GetAlphaNumberSeq(count);

}

How can I start the AlphaNumberSeq to zero and increment the count each time?

Are SequenceNumbers and AlphaNumbersSeq classes that you wrote? I cannot
find anything about them.

Mike
 
bthumber said:
I had an application method that counts the total number of records that
like
for example buffal. From 0-99 things work find, see the code:

int count = (int)Session["hostCount"];

if ((count >= 0) && (count <= 98))
{
count++;

SequenceNumbers sn = new SequenceNumbers();
lblSubStr.Text = sn.GetNumberSequence(count);
}

// first record would be buffal01, last record buffal99, next record
should
be buffala1.

If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the
"count"
is 99. If I start the count at 99 then increment if by it will be 100 and
the
sequence will start at l2, so I need to reset the count to start at 0 so
that
the next record buffala1, see code:

else if ((count >= 0) && (count <= 233))

{// got to increment this somewhere
count = 0;

AlphaNumberSeq ans = new AlphaNumberSeq();
lblSubStr.Text = ans.GetAlphaNumberSeq(count);

}

How can I start the AlphaNumberSeq to zero and increment the count each
time?

Just let count keep going up, and use ans.GetAlphaNumberSeq(count-100) ?
 
Back
Top