Position ; if FileStream1. The "Value" data for these changeable memory allocation variables is a 4 Byte numeric Pointer address, and has nothing to do with the "Data" like text in String and PChar for these variables. OS : Windows 7 64 bit Laz: Lazarus 1.
Free; end; end; finally FileStream1. But if you are getting errors in your file reads, then most likely you have some data length or data position error in your code. In the while loop, the SegID is tested and code is executed to read a string, a bitmap or an icon.In the while loop, the SegID is tested and code is executed to read a string, a bitmap or an icon. In this next example, a Dynamic Array of String arrayString is used and it's Length is set to 4, but you can set it's length to another amount and the code will still work. Using Data Segment IDs to Separate Data If you need to create a file with several different types of data in it and you want have a different number of segments in each file, you can use a "Data Segment ID" method. I have added a String, Str1, which is used to put the Integer values into text, so you can display this string in a TLabel. It will add this description and the width of the bitmap to ListBox1, so the user can choose the bitmap to load from ListBox1. Just set your file position to that data and rewrite it. The function accepts a string, other functions that accept a string know not to use the first char string or the management block ANSIstring. If you use the soFromBeginning in the Origin parameter, then the Seek function is the same as the Position property. But you would not have the separate strings that you put into the file, you would have just One string with all of the strings in it. No, after each write the FileStream position is Advanced to where the last write ended, so the Int2 is added on the end of the file, which would be byte number 5, Also, when you use the FileStream write the file size is automatically increased to the size needed for that write. For many variable types with unchanging data length you can use the SizeOf function.
If the bytes written are incorrect, then it shows an error message and returns False, so the code progression will stop and exit.