First off, decide which function in unit1 you want to "share". For instance... Then add those to the "interface" section, but only the header (first line with name and params).
Then, in the "using" unit, add a uses clause (if it's not already there). uses unit2; Now you can use the functions defined in the interface of unit1 as if they were defined in unit2. The same goes for types, constants and global variables. Hit ctrl-enter on someone else's unit name in your uses clause to view it's source and see how others do it.
interface //this is the part you "share" with other4 units, or the "public" part
//You can have a uses clause here, if you're using types or constants from other units in your interface section.
//If you only use things in the implementation, don't add the uit to your interface. This is bad coding...
//That has to do with circular references...
//Units cannot refer to [I]each other[/I] in the interface sections, but one can refere to the other in the interface, and the other can refer back, but only in its implementation...
//Try it and see you get a "circular unit reference" error.
implementation //this is where the stuff is that is hidden from anyone that "uses" this unit
uses SysUtils; //stuff units you use here is only available from here on down...
result:=IntToStr(param.Num1+param.Num2); //this is just a silly test...
uses Dialogs,[B]unit1[/B]; //here I'm "stating" that I wanna use the stuff in unit1's interface section...
//To call this proc, you must use this unit in a unit that actually does something... :)
ShowMessage(test(param)); //"ShowMessage" is defined and implemented in the "Dialogs" unit, used above...
This is written off the top of my head, so if it doesn't work don't kill me. I didn't compile to see if I misspelled anything... or forgot something...
This will display your text. If you want to "run" text, this text must be source code. This source code must be accompanied by a compiler or interpreter. You must then instruct the appropriate compiler or interpreter to either compile or interpret it using the appropriate controls and or commands available in such a compiler or interpreter according to the manual that comes with it, or the online documentation, or the newsgroups that provide such information. Please be advised that the langauge used in the txt file must match the language used by the compiler or interpreter. (Much like you need to be able to understand English to understand this post).
To fire up notepad, use ShellExecute. Type "ShellExecute" in your delphi code editor and hit F1. If any terms seem unfamiliar in the manual/help, click on the underlined words (these are hyperlinks). Hope this helps.
well, not quite sure what's up here. But it seems your #100 may be 100b, as in binary, which equals 4. Then when you mul 10000h by this, you get 40000h. If you now have a 16bit limit, this may be split into 4h in one register and 0000h in another.
This seems to be the case.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download