Logic Help - Creating an Ordered list (No HTML)
-
I need to create an Ordered List (like the numbered/bulleted list in Word) without using any HTML. I have a Table in a DataBase with an Indent Column (int). 0 - 20 indents allowed. I have a Name Column (VarChar / String). I cannot use Parent / Child relationships. The System would need 5 days of work to support that with the tables I'm pulling this data From. The Data Is in order when retrieved from the DB, so I can just run through a For loop and it will print out fine. I have no idea how to do the numbered lists though. HEre's an example on what it needs (from user requirements) to put out if the user wants it.
1...A Heading 2...Another Heading ...a....this is a sub heading ...b...and another sub heading 3...More headings ...a...One more ......A...Yet again .........1...Oh wait there's more 4...yes there is ......A...I jumped ahead one. 5...Back Down ..........1...I jumped Ahead a lot ......A...Yes you did. .........a...Something Else 6...And back down.
Sorry about the decimals, I use those for spacing. I've been beating my head on this for 2 days now.:mad: Any help would be very appreciated. -- modified at 18:37 Tuesday 25th October, 2005 -
I need to create an Ordered List (like the numbered/bulleted list in Word) without using any HTML. I have a Table in a DataBase with an Indent Column (int). 0 - 20 indents allowed. I have a Name Column (VarChar / String). I cannot use Parent / Child relationships. The System would need 5 days of work to support that with the tables I'm pulling this data From. The Data Is in order when retrieved from the DB, so I can just run through a For loop and it will print out fine. I have no idea how to do the numbered lists though. HEre's an example on what it needs (from user requirements) to put out if the user wants it.
1...A Heading 2...Another Heading ...a....this is a sub heading ...b...and another sub heading 3...More headings ...a...One more ......A...Yet again .........1...Oh wait there's more 4...yes there is ......A...I jumped ahead one. 5...Back Down ..........1...I jumped Ahead a lot ......A...Yes you did. .........a...Something Else 6...And back down.
Sorry about the decimals, I use those for spacing. I've been beating my head on this for 2 days now.:mad: Any help would be very appreciated. -- modified at 18:37 Tuesday 25th October, 2005MrBic wrote:
5...Back Down ..........1...I jumped Ahead a lot ......A...Yes you did. .........a...Something Else
I don't understand how this numbering system works ? Can't you just count the number of indents, and when it increases, start a new numbering sequence ? Christian Graus - Microsoft MVP - C++
-
MrBic wrote:
5...Back Down ..........1...I jumped Ahead a lot ......A...Yes you did. .........a...Something Else
I don't understand how this numbering system works ? Can't you just count the number of indents, and when it increases, start a new numbering sequence ? Christian Graus - Microsoft MVP - C++
I didn't understand at first either. But you got it, Each time the Indent Counts up, I have to indent that many spaces, and then find the letter / number used before hand for it. So if it was: 1. the next would be 2. 1. 2. Indent = 1, a. Right now I know how to manage the INdents, I need to know how to manage the numbering / letering. That's wehere I'm stuck. So Yes, your last statement was correct, but I've been working on this for 2 days and my mind is fried, so any help would be great. Ryan
-
I didn't understand at first either. But you got it, Each time the Indent Counts up, I have to indent that many spaces, and then find the letter / number used before hand for it. So if it was: 1. the next would be 2. 1. 2. Indent = 1, a. Right now I know how to manage the INdents, I need to know how to manage the numbering / letering. That's wehere I'm stuck. So Yes, your last statement was correct, but I've been working on this for 2 days and my mind is fried, so any help would be great. Ryan
I think you need to create a char array, which represents depth. This way, the value at array position 0 represents the last character you used at the lowest depth. Then you can reset the other values when you start a new group at that depth, and increment it while the depth remains the same. Does that make sense ? The array will then remember for you what the last character was that you used, when the depth drops by one or more. Christian Graus - Microsoft MVP - C++
-
MrBic wrote:
5...Back Down ..........1...I jumped Ahead a lot ......A...Yes you did. .........a...Something Else
I don't understand how this numbering system works ? Can't you just count the number of indents, and when it increases, start a new numbering sequence ? Christian Graus - Microsoft MVP - C++
Basically, i look at the Indent, and I indent that many over. THat example is something stupid that customers would never use, though they could. They need the same requirements as MS WOrd, and Word can do that unfortunately. So yes, I just count the number of indents and then start a new sequence. Indenting is easy, it's the sequence I'm having a hard time figuring out.
-
I think you need to create a char array, which represents depth. This way, the value at array position 0 represents the last character you used at the lowest depth. Then you can reset the other values when you start a new group at that depth, and increment it while the depth remains the same. Does that make sense ? The array will then remember for you what the last character was that you used, when the depth drops by one or more. Christian Graus - Microsoft MVP - C++
What I get from this, is that char array will stay 0. WHen the Indent is increased, the char is set to the lowest of that Indent, say 'a'. if there are 3 headings on that indent, that char will always be 'a' so the system knows it's on that level of indentation, and it will use that charset.
-
What I get from this, is that char array will stay 0. WHen the Indent is increased, the char is set to the lowest of that Indent, say 'a'. if there are 3 headings on that indent, that char will always be 'a' so the system knows it's on that level of indentation, and it will use that charset.
MrBic wrote:
What I get from this, is that char array will stay 0.
It gets set before you start to represent the maximum number of indents, and what they will start with. Christian Graus - Microsoft MVP - C++