Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alexandre: One more question about safe vars.
#1
Hi Alexandre,    (all others please feel free to comment too)

In my application, in the many forms it consist of, I use a number of data manipulation functions. Like a functions to return a part of a string after a certain character in the string, or special formatting routines and so on. All small functions that only manipulates what they get, and never hold onto any data.

Over time I have built up quite a collection of functions, and with the ease of adding such a "toolbox" unit to the uses clause, and having all them functions available in the code, I must admit i have being holding on to a lot of those, instead of using the newer Windows equivalents. I have adapted many to use newer windows standards, but still keep the ease of having a function at hand, instead of writing it the windows way directly in code, every time it needed.

Some of these functions I also use in my IW application, and I have added such a unit to the uses clause of a number of the forms in the application.

My question regarding safe vars in this context is: Since these units are formless, and as such not created specifically by the form, how safe are they then ?

And if they are not safe, how do I make them safe ?

I do not want to add every one of the functions I use to the Form Class def. in every form where it is used, if I can avoid it, but will of course if I have to. In that case it would likely be as an .inc file and compiler directive.

I have attached a small example to maybe better understand what I'm referring to, though I'm pretty sure you know very well what I'm talking about.

The attached file should have been LFunks.pas but the extension was not allowed as attachment, so I renamed it LFunks.txt.

Regards
Soren


Attached Files
.txt   LFunks.txt (Size: 2.93 KB / Downloads: 8)
Reply


Messages In This Thread
Alexandre: One more question about safe vars. - by SorenJensen - 02-12-2020, 10:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)