Posts

Showing posts with the label Pchar

Pointers In Delphi

Every data we use in an application is stored somewhere in the computer's memory. And a Pointer is a variable that stores a address of memory piece  where we store data, like in Delphi "a string is really just a pointer" or "an object is really just a pointer" or "event  handler such as OnClick is actually a pointer to a procedure". They allow direct access to memory, enabling complex data structures to be built and navigated. The advantages are: We can set that memory size as per our requirement In case of copy value of a variable from one to another we just need to change a pointer to point to a different address of memory which saved lots of time When we use Pointers The most common use for pointers in Delphi is when calling Windows APIs. Windows API functions use a number of data types that may be unfamiliar to the Delphi programmer. Most of the parameters in calling API functions are pointers to some data type.  Most of the t...

STRING / PCHAR / CHAR in Delphi

STRING / PCHAR / CHAR in Delphi --------------------------------------------- Char ------- Char is a data type that holds only one character as value. Ansi Characters are used to store single byte ansi characters. Unicode characters are used to store 2byte characters that is to cupport foreign languages like chinese, japanese etc. var    chr1 : Char;        // Holds a single character, alphabet    chr2 : WideChar;    // Holds a single character, International alphabet // for Unicode support    chr3 : AnsiChar;    // Holds a single character, alphabet NON-PRINTING OR CONTROL CHARACTERS, NOT USED IN THIS CLASS, INCLUDED FOR INTEREST ONLY   0 Null (nothing)  7 Bell  8 Back space  9 Tab 10 Line feed (new line at present column) 13 Carriage return (return to beginning of line) 26 End of file 27 [Esc] (Escape key) ASCII CHARACTER CODES 32 [space]   64 @ ...