예제 #1
0
        public static int ReadMacro(ushort handle, short macroLocation)
        {
            FocasLibBase.ODBM odbm = new FocasLibBase.ODBM();
            int ret = FocasLib.cnc_rdmacro(handle, macroLocation, 10, odbm);

            if (ret == 0)
            {
                if (odbm.mcr_val == 0 && odbm.dec_val == -1)
                {
                    return(-1);
                }
                else
                {
                    return((int)(odbm.mcr_val / Math.Pow(10.0, odbm.dec_val)));
                }
            }
            else
            {
                Logger.WriteErrorLog("cnc_rdmacro() failed. return value is = " + ret);
            }
            return(-1);
        }