- This topic has 24 replies, 4 voices, and was last updated 17 years ago by Admin.
-
AuthorPosts
-
October 24, 2005 at 3:04 am #191508DepartureMember
Im thinking to my self to start and learn Delphi, I have played with Delphi for the last 5 years and made some very simple apps but i never got right into it.
Would anyone on this forum be interested to go down that path of learning a truly e-lite programming language with me? it better to have more than one person learning that way the ideas and procedures can be shared between us.
The reason i dont choose C++ is because i feel its very common , Delphi is not and can be used to make fast but very powerful apps. BTW i am talking about the older delphi and not the .net version
Post back if anyone is interested in learning or can already program with delphi..
October 24, 2005 at 12:57 pm #191532AdminAdministratorLol man I gain too, I wanna learn all the languages, hey in delphi do people needs to download extra files 🙂 thas the only thing I hate about vb they need to get supportitng files.
October 24, 2005 at 1:10 pm #191531DepartureMembernope thats the whole point about delphi , the output.exe is larger but all dependentcys are in the final output.exe which means no extra files ect…
Plus i have read on this forum all good crackers, hackers ect… use C++ … thats a lie!!! just about all good crackers use delphi and asm assembly, and as for hackers they normaly use script such as cgi and perl ect…
When people talk about hackers using C++ they forget to mention that its not the hacker using C++ its the Programmer who make hacking tools that is using it. there is a big diffrence!!!Anyway Vb runtime files come as a standard with windows XP and there is allways a API call you can use instead of addin uncommon componates to your project
October 24, 2005 at 7:28 pm #191530AdminAdministratoryeps most of the cool trojans are made in delphi, so there must be something real good about it that the trojan makers are using it 🙂
October 26, 2005 at 7:28 am #191529AdminAdministratori can help you with Delphi if you need help i coded 3 programs in delphi before. 8)
April 15, 2006 at 6:32 am #191528BattleStar-GalacticaMemberI installed my delphi5 a few minute ago.
if you have any trick about delphi, i’m very happy to learn your tricklike this function to hide start button of destop
ShowWindow(GetWindow(FindWindow(‘Shell_traywnd’, NiL), 5), 0);
and here it’s to show start button of destope
ShowWindow(GetWindow(FindWindow(‘Shell_traywnd’, NiL), 5), 9);
8) 😆 I started delphi just a few minutes ago lol. everything and every trick i’m interesting
April 15, 2006 at 8:33 am #191527DepartureMembernanomachine007 we can learn together mann, i have been waiting for someone to take on delphi for a long time, there is only a limited number resources on the net to learn from :O( … but im going to try and find some good resource site so i can start learning…….. I know it will take atleast 6 months to 1 year before i can write any decent apps in delphi but im willing to hang out for that long…
Im sick of VB and paltalk, inspeak was written in delphi :O) you could never write something like that with Vb6,
April 15, 2006 at 3:23 pm #191526BattleStar-GalacticaMemberok let’s learning delphi together, but on what forum we can post ours problem to solve. loco don’t learn delphi, so i think he is not interesting about ours post on his forum
first i will try to discover le typecast in delphi,array,loop statement etc…
i must have some basic thing and after i will attack api 😆
April 15, 2006 at 3:30 pm #191525DepartureMemberheres my first delphi app, it a simple registry thing, I found that playing with the registry in delphi is ALOT easyer than Vb
this app just get the current Paltalk username
Very simple but yet very affective to make other apps with.
this will work with Delphi 5, im using Delphi 6 but the most is the same
April 15, 2006 at 3:37 pm #191524BattleStar-GalacticaMemberok let i check how it work 😆
April 15, 2006 at 3:49 pm #191523BattleStar-GalacticaMemberI dont know why i can not run your project code directly with my delphi5, it has an error about file not found something like that but i just have copy your function in my new delphi5 project and add registry library and do copy&past your code and it work perfect thanks.
April 15, 2006 at 4:17 pm #191522DepartureMemberi am not sure why you got hat error, it could because im using Delphi 6 enterprise edition, which might have some extra componates, so might be declaired at run time, but im thinking Vb when i say this, so im not really sure, but the main thing is you got it to work and you see how easy it is to play with the registry with Delphi :O)
April 15, 2006 at 11:31 pm #191521BattleStar-GalacticaMemberok i found what makes that error, cuz you used variants type in your app and i think maybe delphi5 that library does not exist. I removed your variant tye library and it’s all ok, now i can run your app.
delphi it’s easyer to learn then other language like MFC or Win32 100 times 😆
it’s easy like when u start vb hehhehe.
April 16, 2006 at 1:11 am #191520DepartureMember“File Not Found: Variants.dcu” Solution
Remove Variants from uses in Unit1.pasDelphi 6 or higher auto generates Variants in uses
yeah found this out also…..
And yes delphi is alot easyer than i thought it would be to learn, maybe because of the Vb knowlage that it makes it a bit easyer
April 16, 2006 at 5:43 am #191519BattleStar-GalacticaMemberhere it’s some basic thing in delphi i judge the beginer must now 😆
//////////messagebox multiline procedure TForm1.Button1Click(Sender: TObject); begin MessageBox(handle, 'First line'+#10+#13+'Second line'+#10+#13+'Third line', 'Multiline MessageBox', MB_OK); end; /////////////////////end messagebox multiline ////////////loop for procedure TForm1.Button1Click(Sender: TObject); var i : Integer; begin for i := 0 to 3 do begin showmessage('test...' + IntToStr(i)); end; end; //////////////////end loop for ///////loop while procedure TForm1.Button1Click(Sender: TObject); var i : Integer; begin i :=0; while i < 4 do begin showmessage('test' + IntToStr(i)); i := i + 1; end; end; ///////////end loop while ///////////////////array declaration procedure TForm1.Button1Click(Sender: TObject); const Digits: array[0..9] of Char = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); var i : Integer; begin for i:=0 to High(Digits) do showmessage(Digits); end; ///////////end array declaration ////////////dynamic array test procedure TForm1.Button1Click(Sender: TObject); var A : array of Integer; begin SetLength(A, 1); A[0] :=10; showmessage(IntToStr(A[0])); end; //////////end dynamic array test //function make string function MakeStr(const Args: array of const): string; const BoolChars: array[Boolean] of Char = ('F', 'T'); var I: Integer; begin Result := ''; for I := 0 to High(Args) do with Args do case VType of vtInteger: Result := Result + IntToStr(VInteger); vtBoolean: Result := Result + BoolChars[VBoolean]; vtChar: Result := Result + VChar; vtExtended: Result := Result + FloatToStr(VExtended^); vtString: Result := Result + VString^; vtPChar: Result := Result + VPChar; vtObject: Result := Result + VObject.ClassName; vtClass: Result := Result + VClass.ClassName; vtAnsiString: Result := Result + string(VAnsiString); vtCurrency: Result := Result + CurrToStr(VCurrency^); vtVariant: Result := Result + string(VVariant^); vtInt64: Result := Result + IntToStr(VInt64^); end; end; //end function make string //use this function like bellow procedure procedure TForm1.Button1Click(Sender: TObject); var mystr: string; begin mystr := MakeStr(); showmessage(mystr); end; ////////////function declaration function Calc(X, Y: Integer): Integer; begin Calc := X + Y; end; type TFunction = function(X, Y: Integer): Integer; const MyFunction: TFunction = Calc; ///////end function declaration //test this function procedure TForm1.Button1Click(Sender: TObject); begin showmessage(IntToStr(MyFunction(5, 7))); end; //or procedure TForm1.Button1Click(Sender: TObject); begin showmessage(IntToStr(Calc(5, 7))); end; ///////////end test this function ///////out parameter procedure procedure GetInfo(out Info: string); begin Info := 'my value to be return'; end; /////////end out parameter procedure procedure TForm1.Button1Click(Sender: TObject); var mystr: string; begin GetInfo(mystr); showmessage(mystr); end; ////////////read text file procedure TForm1.Button1Click(Sender: TObject); var myFile : TextFile; text : string; begin AssignFile(myFile, 'Test.txt'); // Reopen the file for reading Reset(myFile); // Display the file contents while not Eof(myFile) do begin ReadLn(myFile, text); ShowMessage(text); end; // Close the file for the last time CloseFile(myFile); end; //////////end read text file //////write text file procedure TForm1.Button1Click(Sender: TObject); var myFile : TextFile; text : string; begin // Try to open the Test.txt file for writing to AssignFile(myFile, 'Test.txt'); ReWrite(myFile); // Write a couple of well known words to this file WriteLn(myFile, 'Hello'); WriteLn(myFile, 'World'); // Close the file CloseFile(myFile); // Reopen the file for reading Reset(myFile); // Display the file contents while not Eof(myFile) do begin ReadLn(myFile, text); ShowMessage(text); end; // Close the file for the last time CloseFile(myFile); end; //////////end write text file ///////write append text file procedure TForm1.Button3Click(Sender: TObject); var myFile : TextFile; text : string; begin AssignFile(myFile, 'Test.txt'); Append(myFile); WriteLn(myFile, 'my append string'); WriteLn(myFile, 'my other append string'); CloseFile(myFile); end; //////////end write append text file /////////write binary file procedure writebf(); type TCustomer = Record name : string[20]; age : Integer; male : Boolean; end; var myFile : File of TCustomer; // A file of customer records customer : TCustomer; // A customer record variable begin // Try to open the Test.cus binary file for writing to AssignFile(myFile, 'Test.cus'); ReWrite(myFile); // Write a couple of customer records to the file customer.name := 'Fred Bloggs'; customer.age := 21; customer.male := true; Write(myFile, customer); customer.name := 'Jane Turner'; customer.age := 45; customer.male := false; Write(myFile, customer); // Close the file CloseFile(myFile); // Reopen the file in read only mode FileMode := fmOpenRead; Reset(myFile); // Display the file contents while not Eof(myFile) do begin Read(myFile, customer); if customer.male then ShowMessage('Man with name '+customer.name+ ' is '+IntToStr(customer.age)) else ShowMessage('Lady with name '+customer.name+ ' is '+IntToStr(customer.age)); end; // Close the file for the last time CloseFile(myFile); end; //////////end write binary file ////////readwriteblock binary file procedure readwriteblockbf(); var myFile : File; byteArray : array[1..8] of byte; oneByte : byte; i, count : Integer; begin // Try to open the Test.byt file for writing to AssignFile(myFile, 'Test.byt'); ReWrite(myFile, 4); // Define a single 'record' as 4 bytes // Fill out the data array for i := 1 to 8 do byteArray := i; // Write the data array to the file BlockWrite(myFile, byteArray, 2); // Write 2 'records' of 4 bytes // Fill out the data array with different data for i := 1 to 4 do byteArray := i*i; // Value : 1, 4, 9, 16 // Write only the first 4 items from the data array to the file BlockWrite(myFile, byteArray, 1); // Write 1 record of 4 bytes // Close the file CloseFile(myFile); // Reopen the file for reading only FileMode := fmOpenRead; Reset(myFile, 1); // Now we define one record as 1 byte // Display the file contents // Start with a read of the first 6 bytes. 'count' is set to the // actual number read ShowMessage('Reading first set of bytes :'); BlockRead(myFile, byteArray, 6, count); // Display the byte values read for i := 1 to count do ShowMessage(IntToStr(byteArray)); // Now read one byte at a time to the end of the file ShowMessage('Reading remaining bytes :'); while not Eof(myFile) do begin BlockRead(myFile, oneByte, 1); // Read and display one byte at a time ShowMessage(IntToStr(oneByte)); end; // Close the file for the last time CloseFile(myFile); end; /////////end readwriteblock binary //////////reverse text file procedure reversetextfile(); var fileData : TStringList; saveLine : String; lines, i : Integer; begin fileData := TStringList.Create; // Create the TSTringList object fileData.LoadFromFile('Test.txt'); // Load from Testing.txt file // Reverse the sequence of lines in the file lines := fileData.Count; for i := lines-1 downto (lines div 2) do begin saveLine := fileData[lines-i-1]; fileData[lines-i-1] := fileData; fileData := saveLine; end; // Now display the file for i := 0 to lines-1 do ShowMessage(fileData); fileData.SaveToFile('Test.txt'); // Save the reverse sequence file end; ////////end reverse text file
next time i’ll attack ado and socket
if you have any trick about that, i’m happy to learn -
AuthorPosts
Related
- You must be logged in to reply to this topic.