Skip to main content
1 of 2
Jagra
  • 14.6k
  • 1
  • 39
  • 82

Since it seems like you want constants accessible from a number of applications, why not create a package of constants and start each application by calling the constants you need. You would then change the constants only in the package should they ever need changing.

    (* Mathematica Package *)

    BeginPackage["CONSTANTS`"]
    (* Exported symbols added here with SymbolName::usage *)  
    
    constant1::usage = "some text"
    constant2::usage = "some text"
    constant3::usage = "some text"
    
    Begin["`Private`"] (* Begin Private Context *) 
    
    constant1[]: = 22;
    constant2[]: = "myConstant";
    constant3[]: = 0.618;
    
    End[] (* End Private Context *)
    
    EndPackage[]

See: Package development Place package in an appropriate director so Mathematica can see it.

To give your notebooks access to the constants:

Needs["CONSTANTS`"]

constant1[]
constant2[]
constant3[]

22
"myConstant"
0.618

Just a sketch but this should give you the idea.

Jagra
  • 14.6k
  • 1
  • 39
  • 82