Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Logic Help - Creating an Ordered list (No HTML)

Logic Help - Creating an Ordered list (No HTML)

Scheduled Pinned Locked Moved C#
databasetutorialhtmlbusinesshelp
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrBic
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • M MrBic

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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++

      M 2 Replies Last reply
      0
      • C Christian Graus

        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++

        M Offline
        M Offline
        MrBic
        wrote on last edited by
        #3

        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

        C 1 Reply Last reply
        0
        • M MrBic

          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

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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++

          M 1 Reply Last reply
          0
          • C Christian Graus

            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++

            M Offline
            M Offline
            MrBic
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • C Christian Graus

              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++

              M Offline
              M Offline
              MrBic
              wrote on last edited by
              #6

              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.

              C 1 Reply Last reply
              0
              • M MrBic

                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.

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                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++

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups