# Error using macro on root

**URL:** <https://root-forum.cern.ch/t/error-using-macro-on-root/36188>\
**Category:** Newbie\
**Created:** [September 30, 2019, 3:21pm UTC](https://root-forum.cern.ch/t/error-using-macro-on-root/36188 "2019-09-30T15:21:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TaeNyFan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/taenyfan/32/19890_2.png) [@TaeNyFan](https://root-forum.cern.ch/u/TaeNyFan)\
**Post date:** [September 30, 2019, 3:21pm UTC](https://root-forum.cern.ch/t/error-using-macro-on-root/36188/1 "2019-09-30T15:21:57Z")

</div>

I am using ROOT 6.18/02 on Windows 10 with Visual Studio 2019.

I have a macro file formula1.C with the following lines of code:

> {  
> f = new TF1(“f”,“sin(x)”,0,5);  
> f-\>Draw();  
> }

When I run .x formula1.C in ROOT, I get the following error:

> Assertion failed: content[posOpenCurly] == ‘{’ && “No curly at claimed position of opening curly!”, file C:\build\ws\BUILDTYPE\Release\LABEL\windows10\V\6-18\root\interpreter\cling\lib\MetaProcessor\MetaProcessor.cpp, line 431

Thereafter ROOT exits.

What is wrong here?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [September 30, 2019, 3:38pm UTC](https://root-forum.cern.ch/t/error-using-macro-on-root/36188/2 "2019-09-30T15:38:19Z")

</div>

Try to use a named macro containing a function being the same name than the file name:

```auto
void formula1()
{
   auto f = new TF1("f","sin(x)",0,5);
   f->Draw();
}

```

---

<div class="post-metadata">

**Author:** ![TaeNyFan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/taenyfan/32/19890_2.png) [@TaeNyFan](https://root-forum.cern.ch/u/TaeNyFan)\
**Post date:** [September 30, 2019, 3:53pm UTC](https://root-forum.cern.ch/t/error-using-macro-on-root/36188/3 "2019-09-30T15:53:47Z")

</div>

That worked like a charm. Thanks!
