ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

H spec

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

  • H spec

    Hi,

    What do I put in the H spec if I want to always see my source code in debug mode.

    I think it is the following:

    H NOMAIN OPTION(*NODEBUGIO: *SRCSTMT: *NOSHOWCPY)

    Let me know what other programmers place in their H spec for optimization and debug method.

    Thanks,

    DAC

  • #2
    Re: H spec

    Here is mine:

    Code:
      // Standard H-Specs Copy Member                                 
    H Copyright('(c) 2013 My Company, Inc. All rights reserved.')
    H BndDir('MYLIB/MYBNDDIR')                                         
    H Option(*NoDebugIO:*SrcStmt) CopyNest(10)                             
    H AlwNull(*Usrctl)                                                     
    H ExtBinInt(*Yes)                                                      
    H OpenOpt(*InzOfl)                                                     
     /If Defined(*CRTBNDRPG)                                               
    H DftActGrp(*No) ActGrp(*Caller)                                       
     /EndIf

    Comment


    • #3
      Re: H spec

      To see your source when debugging you need to set the DBGVIEW parameter of the compile command to *LIST or *SOURCE. We have our default set to *LIST - this allows you to see the actual source the program was compiled with even if that source is not available or has been changed since.

      Comment


      • #4
        Re: H spec

        Also, here is the defaul H spec's we put in from our template

        *** Modify actgrp depending on use *new, QILE, *caller, and add
        *** bnddir as needed.
        h dftactgrp(*no) actgrp(*new)
        h Option(*SrcStmt : *NoDebugIO : *noshowcpy : *nounref)

        Comment


        • #5
          Re: H spec

          ...to always see my source code...
          Can you clarify that?

          Are you asking how to avoid ever seeing a *LIST view? Do you only want the *SOURCE view available? Do you want a way to see the "source" even if the original source member is lost? (The *SOURCE view works only if the associated source file still has the associated source member on the system.)

          Tom
          Tom

          There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

          Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

          Comment


          • #6
            Re: H spec

            I would not put OPTION(*NOSHOWCPY) in the H spec without some conditioning. If you do someday want to see the copy files in the listing, maybe due to an error in the copy file, it will be very annoying to have to edit the source to remove that option from the H spec or change it temporarily to *SHOWCPY.

            Code:
            H OPTION(*SRCSTMT
             /if not defined(SHOWCPY)
            H    : *NOSHOWCPY
             /endif
            H  )
            With that H spec, it will default to *NOSHOWCPY, but you can compile with
            Code:
            CRTBNDRPG ... DEFINE(SHOWCPY)
            if you want to see the copy files in the listing for some reason.

            Comment

            Working...
            X