Hello Guest it is April 17, 2024, 10:01:50 PM

Author Topic: Mcodes ??  (Read 13643 times)

0 Members and 1 Guest are viewing this topic.

Offline mc

*
  •  382 382
    • View Profile
Re: Mcodes ??
« Reply #30 on: December 02, 2014, 01:23:11 PM »
Do any of you know if there is a way to disable the formatting on a post?

Use code brackets-
Code: [Select]
rc = mc.mcCntlGetLocalVar(inst, hVars, ParameterNumberArray[i])

that's [ code ] & [ /code ] without the spaces

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mcodes ??
« Reply #31 on: December 02, 2014, 02:30:21 PM »
Thanks for the heads up "mc"
fun times
Re: Mcodes ??
« Reply #32 on: December 02, 2014, 02:43:32 PM »
That the reason I always use the code feature, and its viewably compact / and easy to copy.

was unaware of the code character stripping of just pasting code, my lesson for the day
« Last Edit: December 02, 2014, 02:45:04 PM by Ya-Nvr-No »

Offline mc

*
  •  382 382
    • View Profile
Re: Mcodes ??
« Reply #33 on: December 02, 2014, 03:40:05 PM »
was unaware of the code character stripping of just pasting code, my lesson for the day
Anything out with code brackets in a post, will go through the standard forum parser, and be parsed accordingly, which is why the [ i ] get changed to mean italic.
The other major benefit, is the code brackets should cause a fixed width font to be used(typically courier or similar), so the code layout/indentation appears better.
Re: Mcodes ??
« Reply #34 on: December 02, 2014, 03:47:48 PM »
Duh... that makes sense, thanks  8) second lesson for the day  ;)

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Mcodes ??
« Reply #35 on: December 02, 2014, 11:20:11 PM »
OK NOW I got it. Here is a Mcode with Param actually doing something. I can see where this will be VERY handy to use instead of using the G65 which is a licensed function not available to the average Joe (;-)

(;-) TP

---------------------------------------------------
--Brought to you by the: "Grey Headed ChipSlinger"!!
----------------------------------------------------
function M900(hVars)
   
   local Va
   local Vb
   local Vc
   
   local inst = mc.mcGetInstance() -- Get the current instance 
   
   mc.mcCntlSetLastError(inst, "Test Mcode Parameter");
 
          Va = mc.mcCntlGetLocalVar(inst, hVars, mc.VAR_A)
         
          Vb = mc.mcCntlGetLocalVar(inst, hVars, mc.VAR_B)
         
          Vc = mc.mcCntlGetLocalVar(inst, hVars, mc.VAR_C)
       
      mc.mcCntlGcodeExecute(inst, "G0 X"..Va);     
    mc.mcCntlSetLastError(inst, "Test Mcode Complete"); 
         
   end

if (mc.mcInEditor() == 1) then
    M900(0)
end