redefine

How do I declare an array when I don't know the length until run time?

谁说胖子不能爱 提交于 2019-11-27 12:20:51
I originally had an array[1..1000] that was defined as a global variable. But now I need that to be n, not 1000 and I don't find out n until later. I know what n is before I fill the array up but I need it to be global therefore need a way to define the size of a global array at run time. Context is filling an array with a linear transformation of the bytes in a file. I don't know how big the file is until someone wants to open it and the files can be of any size. As of Delphi 4, Delphi supports dynamic arrays . You can modify their sizes at run time and they will retain the data you stored in

Redefine Class Methods or Class

只谈情不闲聊 提交于 2019-11-26 10:31:47
Is there any way to redefine a class or some of its methods without using typical inheritance? For example: class third_party_library { function buggy_function() { return 'bad result'; } function other_functions(){ return 'blah'; } } What can I do to replace buggy_function() ? Obviously this is what I would like to do class third_party_library redefines third_party_library{ function buggy_function() { return 'good result'; } function other_functions(){ return 'blah'; } } This is my exact dilemma: I updated a third party library that breaks my code. I don't want to modify the library directly,

Redefine Class Methods or Class

无人久伴 提交于 2019-11-26 02:21:47
问题 Is there any way to redefine a class or some of its methods without using typical inheritance? For example: class third_party_library { function buggy_function() { return \'bad result\'; } function other_functions(){ return \'blah\'; } } What can I do to replace buggy_function() ? Obviously this is what I would like to do class third_party_library redefines third_party_library{ function buggy_function() { return \'good result\'; } function other_functions(){ return \'blah\'; } } This is my