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
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now