Airbuspilot Posted July 20, 2016 Report Posted July 20, 2016 Hello Folks, again i will ask for a little Help. With those Lines of Code Monat, Tag = ipc.readStruct(0x0244, "2SB") Jahr = ipc.readSW(0x024A) Flugdatum = (string.format("%02d.%02d.%02d", Tag, Monat, Jahr)) Try to read out the Local Date Values. For Month and Year this works fine. But the Day doesn't fit the Day of the actual Date. Tried some other ReadValues like "2UW", "2UB", "2SW". It leads all to the same Result. Month and Year are correct, Day is not. I would be very glad, if someone could help. Thanks in Advance. Joachim
Thomas Richter Posted July 22, 2016 Report Posted July 22, 2016 Hi, "Monat, Tag =" defines two variables not a struct, just read both Offsets into each variable. You need to read the 1Byte Offset for each variable, 0x0244 for Month and 0x245 for Tag. Thomas
Pete Dowson Posted July 23, 2016 Report Posted July 23, 2016 Actually, just to correct Thomas (sorry, Thomas), Monat, Tag = ipc.readStruct(0x0244, "2SB") should certainly get the Month in "Monat" and the day of the Month in "Tag", though of course "2UB" would be more appropriate than "2SB" since the month and day cannot be negative (not that it matters with this range of values). So, what exactly are you getting for the day of the month? (Remember, this is the date in FS, which is often being set by the last flight you loaded -- it isn't necessarily your computer system date). I'll check this here ... [LATER] Ah! it looks like it s getting the Day of the Week in 0245 instead of the day of the month. I'm just checking to see if it's a bug in FSUIPC or in FS ... Pete
Pete Dowson Posted July 23, 2016 Report Posted July 23, 2016 Ooops! It's an outright error in a table in FSUIPC! It IS reading the day of the week, not month! It's been that way since those offset values were added, some 10 years ago! Seems like you are the first person to use that one, or at least the first to have bothered reporting it! So thanks! Would you need an interim update, or just wait for the next release? Pete
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