Loading ...
Sorry, an error occurred while loading the content.

Re: [BUG] Missing spells on character sheet

Expand Messages
  • merton_monk@yahoo.com
    I think you ve got it right. -Bryan
    Message 1 of 30 , Nov 1, 2001
    • 0 Attachment
      I think you've got it right.

      -Bryan

      --- In pcgen@y..., "Mark Hulsman" <hulsmanm@p...> wrote:
      > Well I've finished the code that parses all the loops in the sheet
      > and I just thought of one thing I forgot. Should the loop be
      > for(x = min; x <= max; x += step)
      > or
      > for(x = min; x < max; x += step)
      >
      > I think its the first one so I'll code it that way, if it should be
      > the second its a minor change that I'll make when I know for sure.
      >
    • Scott Ellsworth
      Very good ideas overall, but I had one suggestion - escape your variable names in the text rather than having them sit alone after the %. ... Make it ...
      Message 2 of 30 , Nov 1, 2001
      • 0 Attachment
        Very good ideas overall, but I had one suggestion - escape your variable
        names in the text rather than having them sit alone after the %.

        At 03:50 AM 11/1/2001 +0000, Mark Hulsman wrote:
        >Basically what I would do is call a function that loops through all
        >the enclosed text and anywhere it finds a % it would replace it with
        >the current loop number.

        Make your life easier - require the variable to be escaped:

        >|FOR.min,max|
        >Anything you want here.
        >|ENDLOOP|

        Make it
        |FOR.min,max,number|
        Anything you want here.
        |ENDLOOP|

        Example:
        |FOR.1,2,0|
        Outer. %{0}
        |FOR.3,4,1|
        Inner 0. %{0}
        Inner 1. %{1}
        |ENDLOOP|
        |ENDLOOP|


        Outer. %{1}
        Inner 0. %{1}
        Inner 1. %{3}
        Inner 0. %{1}
        Inner 1. %{4}
        Outer. %{2}
        Inner 0. %{2}
        Inner 1. %{3}
        Inner 0. %{2}
        Inner 1. %{4}

        Why put the name in braces rather than just saying %0? Because somebody is
        going to want to have

        %file
        and
        %filepath
        in the text, and it is a pain to disambiguate them.

        It is trivially easy to know how to substitute %{file} and %{filepath}

        (I know - I wrote a language that was based on the DOS batch language,
        which then became a real compiled language, and this was a tremendous pain.

        Whatever you do, do NOT put the variable name in the for declaration in the
        same form as the escaped text:

        FOR %{x},1,2
        ENDFOR

        You will end up having to carefully escape each and every item in the line,
        rather than just doing a text replacement before parsing it.

        Scott
        Scott Ellsworth
        scott@...
      • Scott Ellsworth
        ... See my most recent post - you would be happier having the loop control variable look different in declaration than in use. Otherwise, you parse code
        Message 3 of 30 , Nov 1, 2001
        • 0 Attachment
          At 05:24 AM 11/1/2001 +0000, Mark Hulsman wrote:
          >I used commas since periods usually aren't used for seperating stuff
          >like that and I put the % in there so that people would realise that
          >was the variable when they see the exact same thing below it.

          See my most recent post - you would be happier having the loop control
          variable look different in declaration than in use. Otherwise, you parse
          code becomes confusing. (I was a compiler engineer at one point, and I
          made exactly this mistake in design once, and spent three years regretting
          it later.)

          Scott
          Scott Ellsworth
          scott@...
        • Greg Bezoff
          Is there a problem with nested FOR loops in Java? Or do you just not like to code them? If there is a problem with Java handling them, you can always emulate
          Message 4 of 30 , Nov 1, 2001
          • 0 Attachment
            Is there a problem with nested FOR loops in Java? Or do you just not
            like to code them? If there is a problem with Java handling them, you can
            always emulate them. I have emulated nested FOR loops in assembly language
            many times. You just need a vector of loop controls (instead of a single
            set of loop controls) and a piece of logic for each set of loop controls
            in the vector. No big deal, really, though it may not be the prettiest
            code around. In effect, you have one FOR loop for the outer set of loop
            controls and one or more IF/THEN/ELSE blocks for each of the inner sets of
            loop controls. And, of course, the last piece of the FOR statement has to
            be nilpotent (ie i = i + 0), so that the outer control variable is adjusted
            by the first inner IF/THEN/ELSE block when the first inner control variable
            falls off the end of its range. But I'm sure you know all this.

            --------------------
            Greg

            "Life is like a sewer. What you get out of it depends on what you put into
            it."
          • Mark Hulsman
            There is no problem with nested anything in java, there was just the problem with the way we coded them. The way they were coded in PC Gen they could only
            Message 5 of 30 , Nov 1, 2001
            • 0 Attachment
              There is no problem with nested anything in java, there was just the
              problem with the way we coded them. The way they were coded in PC
              Gen they could only have 1 line of stuff inside them so there was no
              way to put another loop inside them. But now you can. And speaking
              of IF/THEN/ELSE blocks, do you think it would be a good idea for me
              to recode them a little so that they can contain multiple lines of
              stuff like FOR loops now can? The way I set up FORs it would be
              simple to code that. And then IFs could also have FORs inside them.

              > Is there a problem with nested FOR loops in Java? Or do you
              just not
              > like to code them? If there is a problem with Java handling them,
              you can
              > always emulate them. I have emulated nested FOR loops in assembly
              language
              > many times. You just need a vector of loop controls (instead of a
              single
              > set of loop controls) and a piece of logic for each set of loop
              controls
              > in the vector. No big deal, really, though it may not be the
              prettiest
              > code around. In effect, you have one FOR loop for the outer set of
              loop
              > controls and one or more IF/THEN/ELSE blocks for each of the inner
              sets of
              > loop controls. And, of course, the last piece of the FOR statement
              has to
              > be nilpotent (ie i = i + 0), so that the outer control variable is
              adjusted
              > by the first inner IF/THEN/ELSE block when the first inner control
              variable
              > falls off the end of its range. But I'm sure you know all this.
            Your message has been successfully submitted and would be delivered to recipients shortly.