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

[Clip] Re: Searching variables with regex?

Expand Messages
  • diodeom
    ... No, the remote possibility of getting 4, just like 0 in my previous take, definitely exists. For a quick (and dirty but fair ) fix I d go back to CEIL and
    Message 1 of 35 , Oct 6, 2010
    • 0 Attachment
      Sheri <silvermoonwoman@...> wrote:
      >
      > Your Floor solution seems ok, but are you certain there is no absolutely
      > no possibility the outcome would ever be 4 in the same circumstance
      > (i.e., where the range of options is (or at least should be) 3?
      >

      No, the remote possibility of getting 4, just like 0 in my previous take, definitely exists. For a quick (and dirty but "fair") fix I'd go back to CEIL and test for zero:

      ^!Set %n%=^$Calc(CEIL(RND(^%ar0%)))$
      ^!If %n%=0 ^!Inc %n%

      ... until something more straightforward pops (hopefully with a big "duh") to mind.

      Well, it just did:

      ^!Set %n%=^$Calc(INT(RND(^%ar0%)+1))$
    • Paul
      See? There s always someone ready to apply the rules even when I thought I was doing something harmless?!! sry bout that.. point taken. will visit
      Message 35 of 35 , Oct 11, 2010
      • 0 Attachment
        See? There's always someone ready to apply the rules even when I thought I was doing something harmless?!! <ahem> sry 'bout that.. point taken. will visit over there.....

        --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
        >
        > Paul wrote:
        > > I only stiffly object to copied work when it is purported to be
        > > ones own work. In the early stages of professional development
        > > I advocate reprimand and retraining.
        >
        > This is beginning to drift off the topic od clips, My answer certainly
        > is, which is why I just posted it to the off-topic list.
        >
        > Axel
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.