pascal

How to receive a message with TidIRC in Delphi?

家住魔仙堡 提交于 2019-12-12 02:57:30
问题 I have the following code so far: procedure TForm1.FormCreate(Sender: TObject); begin FIRC.Host:= '192.168.1.48'; FIRC.Port := 61289; FIRC.Username:= 'test'; FIRC.Nickname:= 'Test'; FIRC.RealName:= 'TEst'; FIRC.Connect; FIRC.Join('#Test'); end; And it will connect fine, but I cannot find on google how to actually receive a message on the channel. How can that be done? 回答1: TIdIRC has OnPrivateMessage and OnNotice events (amongst many other events). 来源: https://stackoverflow.com/questions

I have duplicated InitializeSetup in INNO SETUP how can i solve it?

心已入冬 提交于 2019-12-12 02:47:14
问题 Hello i am trying to make an installer using INNO SETUP, when i started to use ISSkin Code Inno setup send me an error mesage DUPLICATE IDENTIFIER 'INITIALIZESETUP' I would like to know what i have to change to my code to make it work. I was reading at internet and i found a program called IS Script Joiner, i used it but it doesnt work. Here is my Inno Code: ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define

Delphi -drawgrid shows multiple instance of painted cells when any arrow key is pressed. how to correct it

不羁岁月 提交于 2019-12-12 00:25:27
问题 when I press the button selected cells get painted in Delphi drawgrid. but when I press any arrow key the painted cells appear multiple times. the picture shows 3 blocks. the blue one is the actual and the 2 aqua ones are the ones painted after pressing any arrow key the current (or some date) date is passed when calling the create_env procedure. unit bookings2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl

How to run a procedure after user clicks on it with mouse [Pascal]

ε祈祈猫儿з 提交于 2019-12-11 18:39:09
问题 I need to run a procedure when user selects it with mouse click. Program will display: decimal to binary binary to decimal Exit If person clicks on decimal to binary then it runs dectobin procedure, if on binary to decimal then it runs bintodec procedure and if he clicks on Exit then it quits program. After the Menu procedure is executed, what do I have to type in IF statement to get this to work? program menu_with_mouse; uses crt,mouse,mmsystem; var n: byte; var menu_element: array [1..3] of

Getting a file version number in the [Registry] section

六眼飞鱼酱① 提交于 2019-12-11 13:55:58
问题 I am creating an installer for a visual studio project using inno setup. I am getting an error for "Parameter ValueData has invalid value" for this code: [Code] function GetVersion(AppVersion: String): String; var Version: String; CharIndex: integer; c: char; begin for CharIndex := 1 to Length(AppVersion) do begin c := AppVersion[CharIndex]; if (c <> '.') then Version := Version + c; end; Result := Version; end; [Registry] Root: HKCU; Subkey: "MyCompany\Product"; ValueType: DWORD ; ValueName:

Pascal: Get field from LPSYSTEMTIME record

人走茶凉 提交于 2019-12-11 10:30:12
问题 I'm using the Win32 api to get date and time of a file. I have a LPSYSTEMTIME structure, and I'm trying to print its wYear variable. I've got a function (GetFileDate): function GetFileDate : LPSYSTEMTIME var CheckFile: Long; FileTime: LPFILETIME; FileTimeReturn: LPFILETIME; SystemTimeReturn: LPSYSTEMTIME; begin CheckFile := CreateFile(PChar('main.pas'), GENERIC_READ, FILE_SHARE_READ, NIL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); GetFileTime(CheckFile, FileTime, NIL, NIL);

InnoSetup, Convert tasks to Radiobuttons?

痞子三分冷 提交于 2019-12-11 06:47:06
问题 I've asked something similar before in this question: InnoSetup, prevent installation if any task is selected But this situation is a little bit different because only one of both tasks should be selected, then how I could transform the selection beetwen two tasks to two new selectable Radiobuttons? PS: If that is not the best approach then please suggest me another. An image to explain: 回答1: You are missing the exclusive flag: [Tasks] Name: hidden; Description: Hidden mode; GroupDescription:

Pascal strings in C#

孤人 提交于 2019-12-11 06:32:25
问题 I'm working on an audio library in C# and am working on the WAVE file format ATM. According to the very informative website that I am using, WAVE using Pascal style strings. I have been Googling for over 20 minutes and have come up only with a C to Pascal converter. I know how Pascal and C strings compare (C code): char *cStr = "Test"; // C - produces {'T', 'e', 's', 't', '\0'} char pascal[] = {4, 'T', 'e', 's', 't'}; // Pascal If it helps, I am using System.IO.BinaryReader to parse the file.

Saving and loading jpeg images to database not working DELPHI

北城余情 提交于 2019-12-11 05:27:37
问题 I'm trying to make a program that saves images in a database. I've pulled together some info on the net and wrote up code that I think is supposed to work, but fails in a completely unique way on either side (the saving and the loading). Here's my code, could you tell me what I'm doing wrong? Load from Database, gives me a memory address access violation error: procedure TfrmMain.btnAddPickT4Click(Sender: TObject); var S : TMemoryStream; ikode : integer; begin if cbxDeelnemerT4.ItemIndex < 0

Recursive permutation

血红的双手。 提交于 2019-12-11 04:17:17
问题 So I'm trying to permute all possible n digit long numbers out of x long array/set of elements. I've come up with a code that does that, however the digits are the same, how do I prevent that from happening. Here's my come(Pascal): program Noname10; var stop : boolean; A : array[1..100] of integer; function check( n : integer ) : boolean; begin if n = 343 // sets the limit when to stop. then check := true else check := false; end; procedure permute(p,result : integer); var i : integer; begin