# Changing Existing Custom Blocks Argument List

**URL:** <https://www.ruby-forum.com/t/changing-existing-custom-blocks-argument-list/241585>\
**Category:** GNU Radio\
**Created:** [April 16, 2015, 11:29pm UTC](https://www.ruby-forum.com/t/changing-existing-custom-blocks-argument-list/241585 "2015-04-16T23:29:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [April 16, 2015, 11:29pm UTC](https://www.ruby-forum.com/t/changing-existing-custom-blocks-argument-list/241585/1 "2015-04-16T23:29:57Z")

</div>

Hello all,

I created a C++ block using gr\_modtool in which I declared one variable  
in  
the argument list initially. I now want to update this block to take  
more  
arguments. What is the recommended way of going about this?

My current flow in this situation is to start over. Make a new block  
with  
gr\_modtool and copy paste the existing code into the new block files  
with  
updates to the arguments. This is error prone.

How do you experienced developers handle this?

v/r,  
Rich

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [April 17, 2015, 12:51am UTC](https://www.ruby-forum.com/t/changing-existing-custom-blocks-argument-list/241585/2 "2015-04-17T00:51:09Z")

</div>

Just add the new variable to each file:

/lib/coolblock\_xx\_impl.cc (3 places, make, new and constructor)  
/lib/coolblock\_xx\_impl.h (1 place, constructor)  
/include/project/coolblock\_xx.h (1 place, make)  
/grc/project\_coolblock\_xx.xml (1 place, )

Super important step! Delete your entire build directory with rm -rf \*  
and do a clean cmake before you rebuild.

Ron
