Jump to content
The simFlight Network Forums

ipc.CalcCode("code") error (Can't figure out why)


DaveSCUSA

Recommended Posts

Dear John,

I am receiving Lua errors on several (or all) ipc.CalcCode("code") statements and can't figure out why. I double checked the ipc code, event syntax and compared the coding to similar code in the events.txt file. Please help.

Following is the log error and Lua code for a couple of examples:

132562 *** LUA Error: C:\FSUIPC7\MSFSLua\DA62_12Keys.lua:68: attempt to call field 'CalcCode' (a nil value)
68                  ipc.CalcCode("1 (>K:SET_STARTER1_HELD)")
128500 *** LUA Error: C:\FSUIPC7\MSFSLua\DA62_12Keys.lua:120: attempt to call field 'CalcCode' (a nil value)
120                  ipc.CalcCode("1 (>K:ENGINE_MASTER_1_TOGGLE)")        
130234 *** LUA Error: C:\FSUIPC7\MSFSLua\DA62_12Keys.lua:149: attempt to call field 'CalcCode' (a nil value)
149                  ipc.CalcCode("1 (>K:ENGINE_MASTER_2_TOGGLE)")    

Sample events I looked are:

PA24_250_Magneto_Both#3 (>K:MAGNETO1_SET)
PA24_250_Magneto_Left#2 (>K:MAGNETO1_SET)
PA24_250_Magneto_Off#0 (>K:MAGNETO1_SET)
PA24_250_Magneto_Right#1 (>K:MAGNETO1_SET)

For the life of me I can't figure out why.

Thanks  

DA62_12Keys.log DA62_12Keys.lua FSUIPC7.ini FSUIPC7.log

Link to comment
Share on other sites

1 hour ago, DaveSCUSA said:

Duh, thank you.

That's why in progtramming one has walksthru. Or better error descriptions in compilers.

Well, the error description is spot on. ipc is a table and "execCalcCode" is a field in this table.. Look at this, both syntaxes are valid:

 

ipc.execCalcCode("1 (>K:SET_STARTER1_HELD)")

ipc["execCalcCode"]("1 (>K:SET_STARTER1_HELD)")

The error message tells you that there is no table entry with key "CalcCode" (there is no field named "CalcCode") in table ipc.

 

Karl

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.