Here's one approach. Expr( ... ) marks the value you need to cast in stone when the button is created. Eval Expr( ... ) searches for Expr and evaluates it; the result in this example is the expression Button Box( "press", Show( "path\ right \ext" ) ). Eval( ... ) evaluates the Button Box expression. All three are needed and work together.
x = "right";
New Window( "test", Eval( Eval Expr( Button Box( "press", (Show( Expr( "path\ " || x || " \ext" ) )) ) ) ) );
x = "wrong";
Print( "test the button" );
Your example might look like this:
Data_button = V List Box(
Eval( Eval Expr( Button Box( "OPEN RAW DATA " || variable || "",
Open( Expr( "\filepath\File_" || variable || "report.txt" ) ) ) ) )
);
Open is not inside the expr; you don't want to do the open until the button is pressed.
Button Box doesn't evaluate its script until you press the button. This is one way you can build the button script with the file name already cast in stone, not in a variable, so when the script does run the variable isn't needed.
Craige