DaveSCUSA Posted November 24, 2023 Report Share Posted November 24, 2023 I keep getting this error after a var has been filled: 106890 LUA: Global: DVar = Fuel_L_Bravo OFF 106906 LUA: C:\FSUIPC7\Test_Keys.lua:46 fn: UpdateWnd 106937 LUA: C:\FSUIPC7\Test_Keys.lua:47 fn: UpdateWnd 106953 LUA: C:\FSUIPC7\Test_Keys.lua:48 fn: UpdateWnd 106968 *** LUA Error: C:\FSUIPC7\Test_Keys.lua:48: attempt to concatenate global 'Dvar' (a nil value) Have been over examples, plug-ins. Can't seem to find where it is wrong (my eyes may be getting too old). function UpdateWnd() ipc.writeUD(0x66C2, 5) -- Set Bravo for Message if val == nil then mess = (" T - "..Dvar) ipc.writeSTR(0x3380,mess) else message = (" T - "..Dvar.." Value = "..val) ipc.writeSTR(0x3380,mess) val = nil end end PS - This is a test lua to double check using the events in the aircraft Test_Keys.log Test_Keys.lua Link to comment Share on other sites More sharing options...
John Dowson Posted November 25, 2023 Report Share Posted November 25, 2023 Dvar isn't defined anywhere, so when you declare it in a function I suspect it will be local to that function - try defining DVar at the top of your script, e.g. local DVar = "no value" the variable val used in function UpdateWnd() is also never declared and will always be nil. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now