Hello Guest it is March 28, 2024, 07:33:59 AM

Author Topic: pInst and pcall  (Read 555 times)

0 Members and 1 Guest are viewing this topic.

Offline Bill_O

*
  •  562 562
    • View Profile
pInst and pcall
« on: May 12, 2020, 01:53:52 PM »
I am looking through some scripts that others have written to see what I can steal or modify.
I came across a script that uses pInst and pcall.
What is the p for?
I understand and have used Inst and call but do not know what they do if p is added.
Hope this is clear enough.

Bill

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: pInst and pcall
« Reply #1 on: May 12, 2020, 07:05:47 PM »
I'm not sure about pinst.  I think that is just a variable name.  But pcall is a LUA "Protected Call", hence the "p" in pcall.  It gives a means to trap and handle errors without bombing out the whole LUA chink that is running.  In other words, it is usually used to handle errors gracefully. 

Steve

Offline Bill_O

*
  •  562 562
    • View Profile
Re: pInst and pcall
« Reply #2 on: May 13, 2020, 08:31:16 AM »
Steve,

Thanks for the information.

Bill