Announcement

Collapse
No announcement yet.

Procedure Call in Free (Conversion)

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

  • Procedure Call in Free (Conversion)

    What's the conversion here? I'm not getting the same thing...

    (Ven# is defined as 6-Packed Decimal)

    From:

    PHP Code:
          B004 C     *IN05         IFEQ      '1'                                          HIT CF5
         C                   EXSR      VSRCH                                        VEN SRCH
    X004 C                   
    ELSE
         
    C                   EXSR      PENTER                                       PENTER
    E004 C                   END
    E003 C                   END
    E002 C                   END
    X001 C                   
    ELSE
         
    C                   Z-ADD     A#            VEN#
         
    C                   EXSR      PENTER
    E001 C                   END

    ...

    BGSR C     VSRCH         BEGSR
         C                   Z
    -ADD     0             VEN#
         
    C                   CALL      'VND030R '
         
    C                   PARM      'Y'           INQ               1
         C                   PARM                    VEN
    #
         
    C                   SETOFF                                       05
    EDSR C                   ENDSR 
    To:

    PHP Code:
          Vendor Search
         D Vend_Search     PR                  ExtPgm
    'VND030R' )
         
    D   INQ                          1
         D   Ven
    #                         6
    ...

                         If *
    In05;                          // Hit F5
                            
    Inq   'Y';
                            
    Ven#  = *Zeros;

                            
    Vend_SearchInq Ven# );

                            
    *In05 = *Off;
                         Else;
                            
    ExSR PENTER;                    // Pressed ENTER
                         
    EndIF; 
    -Rick

    _____________________________

    Need a Managed File Transfer Solution -OR- iSeries Encryption?
    GoAnywhere and Crypto Complete by Linoma Software


  • #2
    Re: Procedure Call in Free (Conversion)

    in your prototype you have the VEN# defined as 6 alpha
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Procedure Call in Free (Conversion)

      Thanks Tom!

      It's the small things in life ..eh? DOH!!!

      I'm so happy that I don't have to keep that OLD RPGIV code around. (Now, I'm just hoping I don't get in trouble for converting it)
      -Rick

      _____________________________

      Need a Managed File Transfer Solution -OR- iSeries Encryption?
      GoAnywhere and Crypto Complete by Linoma Software

      Comment


      • #4
        Re: Procedure Call in Free (Conversion)

        Yeah, I've taken it upon myself to rewrite a couple things in /free. I had a question about something the other day and the guy that has been doing this the longest looked at the code and went..."Oh, thats that free format stuff, i don't know anything about it" and turned away... haha!

        So I sure hope he never has to maintain anything I've written

        Ohhh, and we have these 2 russian guys that we hire out to do our AS/SET coding and to monitor the system on the weekends and holidays. And every now and then if a program blows up they'll try to go in and fix it. I just hope none of my new stuff blows up
        Your future President
        Bryce

        ---------------------------------------------
        http://www.bravobryce.com

        Comment


        • #5
          Re: Procedure Call in Free (Conversion)

          FWIW...it's a good practice(or habit) to add the data type to the D spec...even if it's alpha. it just makes it easier to spot things like that.
          Code:
               D Vend_Search     PR                  ExtPgm( 'VND030R' )
               D   INQ                          1a
               D   Ven#                         6p 0
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: Procedure Call in Free (Conversion)

            i didn't know you COULD define an alpha without that little 'a' in there. I always assumed the compiler would slap you on the knuckles with a ruler if you tried...
            Your future President
            Bryce

            ---------------------------------------------
            http://www.bravobryce.com

            Comment


            • #7
              Re: Procedure Call in Free (Conversion)

              nope it assumes it's character and numerics without a data type will be assumed to be packed decimal
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment


              • #8
                Re: Procedure Call in Free (Conversion)

                It aslo assumes you dont drink & Drive and have some idea where the lines in the road ARE
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment


                • #9
                  Re: Procedure Call in Free (Conversion)

                  it also assumes you can spell aslo...
                  I'm not anti-social, I just don't like people -Tommy Holden

                  Comment


                  • #10
                    Re: Procedure Call in Free (Conversion)

                    Originally posted by bryce4president View Post
                    I just hope none of my new stuff blows up
                    Same sentiment - different meaning over here

                    GC
                    Greg Craill: "Life's hard - Get a helmet !!"

                    Comment


                    • #11
                      Re: Procedure Call in Free (Conversion)

                      Same sentiment - different meaning over here
                      I bet I can guess your favorite animal....

                      DUCK!


                      give me a break, its monday!
                      Your future President
                      Bryce

                      ---------------------------------------------
                      http://www.bravobryce.com

                      Comment


                      • #12
                        Re: Procedure Call in Free (Conversion)

                        nope it assumes it's character and numerics without a data type will be assumed to be packed decimal
                        Unless its in a data structure. Then a numeric is assumed to be zoned decimal (unpacked). Another reason to follow Tom's suggestion of defining all work fields.

                        Comment

                        Working...
                        X