# \`define macros usage

**URL:** <https://verificationacademy.com/forums/t/define-macros-usage/27530>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [September 9, 2011, 11:37pm UTC](https://verificationacademy.com/forums/t/define-macros-usage/27530 "2011-09-09T23:37:53Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![birenkumar](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@birenkumar](https://verificationacademy.com/forums/u/birenkumar)\
**Post date:** [October 21, 2014, 10:56am UTC](https://verificationacademy.com/forums/t/define-macros-usage/27530/16 "2014-10-21T10:56:31Z")

</div>

Hi i am trying to concatenate a macro with a string variable. Below is the code:

`define VAR_LANE0 8'h0000; //MEMORY is kind of storage memory, defined outside and being included in this file. I am not showing that part class my_class; reg [8*8:0] str_var = "LANE0"; // a string variable which can store max 8 characters. // here it is storing "LANE0" string. bit [7:0] local_var1 = MEMORY[`VAR\_LANE0];

```
bit [7:0] local_var2 = MEMORY[`VAR_str_var]; // trying to concatenate the macro with the 
                                             // string. But error is coming.

```

Any solution please. I want to achieve the `VAR_LANE0 by using `VAR\_str\_var, if any other way is there please tell.

---

_[View the full topic](https://verificationacademy.com/forums/t/define-macros-usage/27530)._
