# Using block argument

**URL:** <https://www.ruby-forum.com/t/using-block-argument/231741>\
**Category:** GNU Radio\
**Created:** [August 27, 2014, 2:41pm UTC](https://www.ruby-forum.com/t/using-block-argument/231741 "2014-08-27T14:41:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 27, 2014, 2:41pm UTC](https://www.ruby-forum.com/t/using-block-argument/231741/1 "2014-08-27T14:41:58Z")

</div>

hi,  
I have created with gr\_modtool a block in which is assigned as argument  
a  
float, “threshold”.

In the file \_impl.h I have defined another variable called “d\_threshold”  
in  
the private sector, while in the constructor of the file \_impl.cc  
the assignment d\_threshold=threshold;

The problem is that, the constructor make the assignment only one time,  
but  
if I want to change the value of the argument at run time,  
in which way I need to assign this variable “threshold”???

thanks,  
Simone

---

<div class="post-metadata">

**Author:** ![Simone\_Ciccia\_S2106](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Simone\_Ciccia\_S2106](https://www.ruby-forum.com/u/Simone_Ciccia_S2106)\
**Post date:** [August 27, 2014, 3:25pm UTC](https://www.ruby-forum.com/t/using-block-argument/231741/2 "2014-08-27T15:25:15Z")

</div>

Hi Simone,

I thing you have implemented the setter (e.g set\_threshold(float) ), if  
so,  
you must specify it in the corresponding .xml file in the grc directory,  
you can do that using set\_threshold($threshold)

Regards,  
Mohamed

On Wed, Aug 27, 2014 at 2:40 PM, Simone Ciccia S210664 \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> in which way I need to assign this variable “threshold”???
> 
> thanks,  
> Simone
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–

_Graduate Student at Supélec, MSc, Advanced Wireless Communication  
Systems,_  
_Élève ingénieur à l’INPT en mobilité internationale._
