Sharing code in libraries
Let's begin with a simple Windows FireMonkey application that hides a string. Create a blank multi-device application, and add a label for a prompt, an edit box for input, a button to take action on the entered text in the edit box, and another label to display the hidden text. Your form should look something like this:
Add a function that takes a string and returns another with the original string hidden in some way. Here's a simple example:
function TfrmHideStrMain.HideString(const MyString: string): string; begin // manipulate the string to hide its original contents for var i := 1 to Length(MyString) do Result := Result + Chr(Random(26) + Ord('A')) + MyString[i]; end;
Now, call that function from the button's OnClick
event and display the results in the result...