Jump to content
The simFlight Network Forums

How can I create a variable in one lua program and evaluate it in another lua program.


rozelc

Recommended Posts

 

 

I have lua program that sets a variable to 1.  VarOut.lua.

 

In the attached FSUIPC.log shows “18156 LUA.3: Global: Var1 = 1”.

I have another lua program that I hoped would read and evaluate Var1 = 1. VarIn.lua

Var1 is however only evaluated as == nil

Usually when I have problems like this it’s typo error of syntactical error.

 Thanks for looking

Rozel

VarIn.lua VarOut.lua FSUIPC7.log

Link to comment
Share on other sites

3 hours ago, rozelc said:

The VarOut.lua I attached does as I expected but the VarIn.lua doesn't seem to get a nul only.

But the ipc.set in your VarOut.lua doesn't set anything:

ipc.set("Var1")

The syntax as documented is 

ipc.set(“name”, value)

You are setting no value, same as nul.

Pete

 

Link to comment
Share on other sites

Just a quick follow up on my original post.

Using a modification or the TripleUse.lua that senses the push button of a rotary switch and a couple of other lua programs that sense CW or CCW of that rotary switch I can control the range of the mfd map, range of the pfd map and the barometric setting, in the G1000 nxi.

Thank you so much for your help

Rozel

RngBaroDEC.lua PB_RotaryRange.lua INITIALIZE_VARS.lua FSUIPC7.ini RngBaroINC.lua

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.