Fltbuff7197 Posted September 21, 2022 Report Posted September 21, 2022 (edited) *** Moved from FAQ sub-forum to main support forum *** Apparently chars vs numbers cause issue when dealingg with strings... I wanted to grab text from the end of ipc.readSTR(0x0130, 256) which is the loaded flight plan .pln file zzz = ipc.readSTR(0x0130, 256) xyz = string.sub (zzz, -22) abc=ipc.ask("here" .. xyz, WHITE) returns nothing... but if I hardcode zzz with "data within double quotes" last 22 chars are returned how do i make this work in a simple solution ? Edited September 21, 2022 by John Dowson Moved to main support forum
John Dowson Posted September 21, 2022 Report Posted September 21, 2022 First, you posted in the FAQ sub-forum where it explicitly states NOT for support requests. Please take care to post in the correct forum for support, which is here or in the FSUIPC7 / MSFS sub-forum. I am not sure what your issue is, but sounds like the offset being read is empty. Why don't you try logging the value after it has been read, e.g. zzz = ipc.readSTR(0x0130, 256) ipc.log("String read from 0x0130: " .. zzz) xyz = string.sub (zzz, -22) ipc.log("Last 22 chars: " .. xyz) 18 minutes ago, Fltbuff7197 said: Apparently chars vs numbers cause issue when dealingg with strings... I don't know what you mean by this - you are not using any lua numbers...but if you want to use a string as an integer, you can use the lua tonumber(string) function.
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