Announcement

Collapse
No announcement yet.

evaluating an expression with mixed data types

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    Code:
    LOCAL tDate AS QUAD
      tDate = VAL(sTransitionDate) 
      lTranstion = (tDate * %workPeriod - qfbasedate) \ %WorkPeriod
    Probably what the compiler is doing internally anyway, except I doubt it does VAL as a quad, so there's probably an extra numeric conversion going on in the expression.

    So beat the rush and control it yourself this way?

    MCM

    Leave a comment:


  • Bern Ertl
    started a topic evaluating an expression with mixed data types

    evaluating an expression with mixed data types

    I have to implement the following :

    Code:
    %WorkPeriod = 3000000000&&
    LOCAL lTransition AS LONG, sTransitionDate AS STRING, qfBaseDate AS QUAD
    
    ...
    
    lTransition = (VAL( sTransitionDate) * %WorkPeriod - qfBaseDate) \ %WorkPeriod
    The expression should be evaluated as a QUAD and then assigned to a LONG variable (QUAD upper limit > expression > LONG upper limit will be true before the last division). Is it necessary (or more optimal/efficient) to use CQUD at any point? Like so:

    lTransition = (CQUD(VAL( sTransitionDate)) * %WorkPeriod - qfBaseDate) \ %WorkPeriod
Working...
X