# Basic Logic

Page 1 of 1

## 1 Replies - 546 Views - Last Post: 05 October 2012 - 02:25 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=294364&amp;s=3868c50ab43ca1d36b5effeeaae58b05&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 kikee122

Reputation: 0
• Posts: 2
• Joined: 05-October 12

# Basic Logic

Posted 05 October 2012 - 02:02 AM

Hello, I am new to basic programming and wasn't sure which thread this should go in.

I have a little program which I need to write which essentially does the below:

I have a data set for example:

103848291
29381
3208019
392791145

They need to be formatted based on a predefined data range. So, for example:

PC0000029381
QQQ103848291

Based on whether the number falls between a certain range, I need it to be prefixed by either PC or QQQ and based on the range, I need to assign a certain number of zero's

So, for example

LOWER RANGE:
QQQ00192284

UPPER RANGE:
QQQ00039947

So based on the dataset (at the top of the tread) I need to say:

29381 falls between this range. So it should have

QQQ and three 0's in front of the number.

I have started trying to code this out; and have managed to use an if statement to clear out unwanted data, but really have no idea where to start on this part of the script.

It seems like I need to remove the first few letters from the ranges (e.g. QQQ and then compare the data?)

Any and all help would be greatly appreciated!

Is This A Good Question/Topic? 0

## Replies To: Basic Logic

### #2 kikee122

Reputation: 0
• Posts: 2
• Joined: 05-October 12

## Re: Basic Logic

Posted 05 October 2012 - 02:25 AM

As added information. The data list is in an Excel file and could be updated frequently.