Some progrtamming questions lazarus / 8-Other ---------------------------------------------------------------------- Rave · 2009-05-03 21:14 Hello. I would to ask how to: 1. Handle "file", not "file of", just "file" files? I mean when I expecting data sequence string-integer-string could I put read(str) read(int) read(str) and i'll got the same data as I saved before? 2. Let's say that I have name of procedure or function as string. How to get procedure address of that function/proc and then execute it (normally I will use proc(parameters), but how with calling by proc address?). I do not want to checking it in long if..else, because procedures will be lot. ---------------------------------------------------------------------- Leledumbo · 2009-05-04 03:21 QuoteI mean when I expecting data sequence string-integer-string could I put ... and i'll got the same data as I saved before?No. Untyped files should be handled specially using BlockRead / BlockWrite routines. For instance, if you want to read it as string-integer- string, you can do: Code: [Select]var   InputFile: File;   Buffer,String1,String2: String;   AnInteger: Integer; ... // do Assign & Reset SetLength(String1,String1Len); // You MUST know the length BlockRead(InputFile,String1,String1Len); BlockRead(InputFile,AnInteger,SizeOf(Integer); SetLength(String2,String2Len); // Again, you MUST know the length BlockRead(InputFile,String2,String2Len); ... // Close, and you have the data now (actually, you already have after every BlockRead call QuoteLet's say that I have name of procedure or function as string. How to get procedure address of that function/proc and then execute itIf it resides in a dynamic library, then GetProcAddress should suffice. You can then typecast it to a compatible procedural type and assign it to a variable. Execute it as how you would execute a procedure from a procedural variable. ---------------------------------------------------------------------- Rave · 2009-05-04 06:43 Quote from: Leledumbo on May 04, 2009, 05:21:50 amQuoteI mean when I expecting data sequence string-integer-string could I put ... and i'll got the same data as I saved before?No. Untyped files should be handled specially using BlockRead / BlockWrite routines. For instance, if you want to read it as string-integer-string, you can do: [/quote] So I can read first length as integer then string itself. Quote from: Leledumbo on May 04, 2009, 05:21:50 amQuoteLet's say that I have name of procedure or function as string. How to get procedure address of that function/proc and then execute itIf it resides in a dynamic library, then GetProcAddress should suffice. You can then typecast it to a compatible procedural type and assign it to a variable. Execute it as how you would execute a procedure from a procedural variable. Nope. The procedure will exist only in main app code. This is not right thing for creating a library that will be used only in one application? How to execute proc from procedure viariable?