Package com.stata.sfi

Class Macro


  • public final class Macro
    extends Object
    This class provides access to Stata macros.

    Example:

    Local macros are a convenient tool for passing command options to Java.

    	public static int getOptions(String[] args) {
    		// options filename and level are passed through local macros
    		String fileName = Macro.getLocal("filename");
    		if (fileName == null) {
    			return (198);
    		}
    		int level = 95;
    		try {
    			level = Integer.parseInt(Macro.getLocalSafe("level"));
    		}
    		catch (NumberFormatException e) {}
    		SFIToolkit.displayln("filename: " + fileName);
    		SFIToolkit.displayln("level: " + level);
    		return 0;
    	}