Default Location of accessing macros

I have been practicing some functions of root and new to the language. However I have been having trouble as in where should I save the macro files so that .x macroname.C executes the macro directly. I have tried various locations including root folder, and root>macros folder.

What is weird is that sometimes I can access the macro by directly executing it “.x” and sometimes I have to load it first “.L” but never have both of them worked for me at the same time.

The error is shows mainly is the file was not found in the macros folder even though the file is right there and I can load it or execute it. ___
Please read tips for efficient and successful posting and posting code

ROOT Version: 16.08/04
Platform: Windows
Compiler: Not Provided


Hi
here a snippet from

$ROOTSYS/etc/system.rootrc
# Path used to find macros.
# Paths are different for Unix and Windows. The example shows the defaults
# for all ROOT applications for either Unix or Windows.
#Unix.*.Root.MacroPath:      .:$(ROOTSYS)/macros
#WinNT.*.Root.MacroPath:     .;$(ROOTSYS)/macros

For the use of resource files (.rootrc) consult:

https://root.cern/doc/master/classTEnv.html

Otto

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.