Announcement

Collapse
No announcement yet.

Compiler slips.

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

  • Compiler slips.

    This line of code gave no compile error, but a run time error 9:

    Code:
    If Rcvd&(dtlItm&>0) Or itmFlg&(dtlItm&)>0 Then
    - should be --

    Code:
    If Rcvd&(dtlItm)&>0 Or itmFlg&(dtlItm&)>0 Then
    Roll on, upgraded/updated Editor ... !


    ------------------

  • #2
    Dieny,

    That's because the first line is perfectly valid syntax -
    Code:
      Rcvd&(dtlItm&>0)
    ...will evaluate to Rcvd&(%TRUE) or Rcvd&(%FALSE) at run-time, which may or may not be
    sensible, depending on what these things mean. The compiler is correct. The upgrade
    you seek is the #DoWhatIMean directive, which I also eagerly await

    Regards,

    Paul

    ------------------
    http://www.zippety.net
    mailto[email protected][email protected]</A>
    Zippety Software, Home of the Lynx Project Explorer
    http://www.zippety.net
    My e-mail

    Comment


    • #3
      Paul is correct - the typo created a boolean evaluation for the subscript value - a perfectly valid syntax.
      - should be --
      Code:
      If Rcvd&(dtlItm[b])&>0[/b] Or itmFlg&(dtlItm&)>0 Then
      Er, I assume the "corrected line" was a typo? ")&>0" is a real syntax error.




      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        Thanks, Paul and Lance. I'd no idea such code might be valid
        syntax; it makes little sense to me, though possibly in some
        other context it has application.

        Er - yes, Lance, that was a typo.

        ------------------

        Comment

        Working...
        X