Issue Feature Closed

#58817Why does isPositive not handle values like 01010101110 like isGreaterThan does?

Christian Stern 05/15/14, 09:36 updated 03/24/20, 17:52

Description

I was wondering if isPostive could also handle values like 000010000101010101. Or does it makes no sense at all?

I had to check, if any setting was made. Each setting is numeric value inside a LOAD_REGISTER. So I put them all together into one value: 0300040010100110700. My first attempent was to look, if it is a positive.

IsPositive was not working, as expected. So I had to remove all zeros first. But I found out that isGreaterThan works as I need right now.

Example

page >
page = PAGE

page.10 = COA
page.10 {
  1 = LOAD_REGISTER
  1 {
    testme = 0101010101
  }

  10 = TEXT
  10 {
    value = testing isPostive against 0101010101. Result:
    noTrimWrap = || |
  }

  20 = TEXT
  20 {
    value = isPositive

    if.isPositive.data = REGISTER:testme 
  }
}

page.20 = TEXT
page.20.value = <hr>

page.30 = COA
page.30 {
  1 = LOAD_REGISTER
  1 {
    testme.cObject = TEXT
    testme.cObject {
      value = 0101010101
      replacement {
        10 {
          search = 0
          replace = 
        }
      }
    }
  }

  10 = TEXT
  10 {
    value = testing isPostive against 0101010101. But removed all zeros before Result:
    noTrimWrap = || |
  }

  20 = TEXT
  20 {
    value = isPositive

    if.isPositive.data = REGISTER:testme 
  }
}

page.40 = TEXT
page.40.value = <hr>

page.50 = COA
page.50 {
  1 = LOAD_REGISTER
  1 {
    testme = 000000000000000010
  }

  10 = TEXT
  10 {
    value = testing isGreaterThan against 000000000000000010. Result:
    noTrimWrap = || |
  }

  20 = TEXT
  20 {
    value = isGreaterThan 

    if {
      value = 9
      isGreaterThan.data = REGISTER:testme 
    }
  }
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.