ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

z-add 0 open

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

  • z-add 0 open

    When converting a program from fixed to free, I had to scratch my head for a bit with this. When I figured it out I found it amusing:

    fixed format:
    Code:
    C                   Z-ADD     0             OPEN
    Free format:
    Code:
     
    OPEN = 0;
    ======> a b
    *RNF5311 30 a 410600 Factor 2 operand is not valid.
    *RNF5507 30 b 410600 A semi-colon is not specified at the end of a free-
    specification.
    I thought I was using open the field not open the op code.

    GLS
    Last edited by GLS400; February 11, 2008, 03:53 PM.
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

  • #2
    Re: z-add 0 open

    open is an opcode. to do that in free format you have to explicitly tell it to eval

    Code:
    eval open = 0;
    to open a file
    Code:
    open myfile;
    that's why the compiler is screaming. it's never a good idea to use an opcode for a field name
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: z-add 0 open

      it's never a good idea to use an opcode for a field name
      One of the advantages of fixed format, eh!

      Comment


      • #4
        Re: z-add 0 open

        Originally posted by arrow483 View Post
        One of the advantages of fixed format, eh!
        umm nope....it's a bad practice regardless of format
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment

        Working...
        X