Using Snippets in RDP.
Last Post 17 Jan 2013 08:57 AM by Jason Olson. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Jason Olson
New Member
New Member
Posts:37

--
27 Dec 2012 03:54 PM

Question for the group on using Snippets in RDP. Has anyone figure out a good way to get them to position correctly. Sometimes when I double click the snippet it will past it into the code, but the position is really out of wack. Then I have to take time to fix it. Templates don't seem to suffer from the same problem, but how do you get variables to go into templates?

 

Thanks!

 

Viking
Basic Member
Basic Member
Posts:330
Avatar

--
02 Jan 2013 09:35 AM
I use snippets but I have not experienced the positions shifting. I generally create the snippet initially by copying/pasting from an existing source member (and then making it generic) so the positions are already correct. Of course if it's a piece of free format code that I insert into my program then I might have to move it over a little to keep the indenting correct, but that's easily done with the block-moving feature in RDP.
Jack Callahan
Basic Member
Basic Member
Posts:303

--
02 Jan 2013 12:06 PM

Here's my snippet template for subprocedure blocks. By using the continuation, the fixed elements remain in the correct place:

       //------------------------------------------------------------
       //
       //
     P ${SubprocedureName}...
     P                 B                   EXPORT
     D ${SubprocedureName}...
     D                 PI
      // local data
     D*data            S              1A

      /free

       // TODO: add additional code after here

       return ;

      /end-free
     P                 e                                  

 
Viking
Basic Member
Basic Member
Posts:330
Avatar

--
02 Jan 2013 12:53 PM
Ah yes, if you have a variable value like that on a line that contains fixed-position values as well, then I don't know of any way around that besides what you show above. Alternatively, don't use a substitution variable for the procedure name and instead have a name like myProcName and then just edit it after inserting into your source... takes no more time than typing the substitution variable value.
taherte
Basic Member
Basic Member
Posts:215

--
02 Jan 2013 03:33 PM

The Rational support team submitted a RFE (Request For Enhancement) 29017 for me to address this very issue:

http://www.ibm.com/developerworks/rfe/execute

Please vote for the request if you would like to see this enhancement.

(Sorry if the link doesn't work. You may have to copy and paste it into your browser.)

 

BTW, if you are having trouble with variables or parameters, you can define them with continuation and they are supposed to space properly. I thought it was kind of ugly and didn't try that.

Raymond Everhart
New Member
New Member
Posts:1

--
03 Jan 2013 09:36 AM
Here is the link to the RFE: http://www.ibm.com/developerworks/r...R_ID=29017
Jason Olson
New Member
New Member
Posts:37

--
17 Jan 2013 08:57 AM

Here is what happens. Right now I have two snippets and both are calls to other programs. So when I double click the snippet to have it put into the code it does this,

 

          RunCommand( Command
          : %len(Command)
          : ControlBlock
          : %size(ControlBlock)
          : 'CPOP0100'
          : 'Command'
          : 0
          : 0
          : ErrorDetail2
          )

When what it should do is,

 

RunCommand( Command
          : %len(Command)
          : ControlBlock
          : %size(ControlBlock)
          : 'CPOP0100'
          : 'Command'
          : 0
          : 0
          : ErrorDetail2
          );

Now I know this is minor, but I hate having to go back and adjust these after they are pasted. I am just curious if anyone has seen this before.

 

Jason

You are not authorized to post a reply.

Acceptable Use Policy