conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Extend record passing test to function returning record\n"
},
{
"from": "human",
"value": "program recpass;\n\n(* Record passing, assignment of records, etc *)\n\ntype\nr = record\n x : integer;\n y : real;\n z : boolean;\n end;\n\n\nvar\n c :... | pascal | chosen |
[
{
"from": "system",
"value": "Simplify the `hello-world` exercise's stub. The goal of this is to make things easier for students to get started and to introduce as little syntax as possible.\n"
},
{
"from": "human",
"value": "unit uHelloWorld;\n\ninterface\n\n function Hello: string;\n\nimpleme... | pascal | chosen |
[
{
"from": "system",
"value": "Add methods to get used memory by the app\n\n"
},
{
"from": "human",
"value": "unit KM_CommonShellUtils;\n{$I KaM_Remake.inc}\ninterface\n\n function OpenPDF(const aURL: string): Boolean;\n\nimplementation\nuses\n {$IFDEF MSWindows}Windows, {$ENDIF}\n Forms\n {$... | pascal | chosen |
[
{
"from": "system",
"value": "Add missing KaM_Remake.inc to a new unit\n\n"
},
{
"from": "human",
"value": "unit KM_MapUtilsExt;\ninterface\nuses\n KM_Maps;\n\n function TryOpenMapPDF(aMap: TKMapInfo): Boolean;\n\nimplementation\nuses\n KM_CommonShellUtils;\n\n\nfunction TryOpenMapPDF(aMap: T... | pascal | chosen |
[
{
"from": "system",
"value": "Make test try to detect when it's used wrong\n"
},
{
"from": "human",
"value": "program cfuncname;\n\n(* Test to ensure we don't have name collisions with C function names *)\n\n(* Use an arbitrary C function name to do something completely different in Pascal *)\nf... | pascal | chosen |
[
{
"from": "system",
"value": "Add a join method to all macro drivers.\n"
},
{
"from": "human",
"value": "(* **************************************************************** *)\n(* Copyright (C) 1999-2010, Jon Gentle, All right reserved. *)\n(* ********************************************... | pascal | chosen |
[
{
"from": "system",
"value": "Implement check for header row in FPC\n"
},
{
"from": "human",
"value": "program gc;\n \nuses\n Sysutils;\n \nvar\n FastaFile: TextFile;\n CurrentLine: String;\n GCCount: LongInt;\n ATCount: LongInt;\n TotalBaseCount: LongInt;\n c: Char;\n GC... | pascal | chosen |
[
{
"from": "system",
"value": "Correct resource include in demo project's main form\n"
},
{
"from": "human",
"value": "unit uMainForm;\n\n{$IFDEF FPC}{$MODE Delphi}{$ENDIF}\n\ninterface\n\nuses\n Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,\n Dialogs, Menus, StdCtr... | pascal | chosen |
[
{
"from": "system",
"value": "Create unit output directory if it doesn't yet exist.\n\nThis reduces compiler failing at compile time, and is a handy\nfeature to have.\n"
},
{
"from": "human",
"value": "unit BuilderThread;\n\n{$mode objfpc}{$H+}\n\ninterface\n\nuses\n Classes, SysUtils;\n\ntype\... | pascal | chosen |
[
{
"from": "system",
"value": "Add ReportMemoryLeaksOnShutdown to the test app\n"
},
{
"from": "human",
"value": "program DelphiASTTest;\n\nuses\n Vcl.Forms,\n uMainForm in 'uMainForm.pas' {Form2};\n\n{$R *.res}\n\nbegin\n Application.Initialize;\n Application.MainFormOnTaskbar := True;\n Ap... | pascal | chosen |
[
{
"from": "system",
"value": "Hide minimize and maximize buttons in title bar\n"
},
{
"from": "human",
"value": "object FormMain: TFormMain\n Left = 0\n Top = 0\n BorderStyle = bsSingle\n Caption = 'VolBalCon'\n ClientHeight = 201\n ClientWidth = 171\n Color = clBtnFace\n Font.Charset = ... | pascal | chosen |
[
{
"from": "system",
"value": "Update for changes to ide tester\n"
},
{
"from": "human",
"value": "program MarkdownTestProgram;\r\n\r\n{$IFDEF FPC}{$MODE DELPHI}{$ENDIF}\r\n\r\nuses\r\n {$IFDEF MSWINDOWS} Windows, {$ENDIF}\r\n Interfaces, SysUtils, Forms, idetester_console,\r\n CommonTestBase,... | pascal | chosen |
[
{
"from": "system",
"value": "Use LongInt in fibonacci test\n"
},
{
"from": "human",
"value": "function fib_(x: Integer; var fib_2: Integer): Integer;\nvar\n a, b, c, d: Integer;\nbegin\n if x = 0 then\n begin\n fib_ := 0;\n fib_2 := 1;\n end\n else\n begin\n ... | pascal | chosen |
[
{
"from": "system",
"value": "[Developer] Use keepalive to improve web server performance\n"
},
{
"from": "human",
"value": "object modWebHttpServer: TmodWebHttpServer\n OldCreateOrder = False\n OnCreate = DataModuleCreate\n OnDestroy = DataModuleDestroy\n Height = 150\n Width = 215\n obje... | pascal | chosen |
[
{
"from": "human",
"value": "Solve Salary with Bonus in pascal\n"
},
{
"from": "gpt",
"value": "Uses sysutils;\n\nVar a : String;\n b : Double;\n c : Double;\n\nbegin\n read(a);\n read(b);\n read(c);\n\n WriteLn(Format('TOTAL = R$ %.2f', [b + round((c * 0.15) * 100) / 100]));\n... | pascal | chosen |
[
{
"from": "human",
"value": "Add calculator words example app.\n"
},
{
"from": "gpt",
"value": "program calcwords;\n\nvar\n longest : string;\n word\t : string;\n\nprocedure readword(var w :string );\n\nbegin\n w := '';\n while not eoln do\n begin\n w := w + input^;\n get(i... | pascal | chosen |
[
{
"from": "human",
"value": "Add record to hold CLI arguments\n\nSigned-off-by: Thimo Braker <81bfa4fbcc33c34000a101187e0eab22befba451@gmail.com>\n"
},
{
"from": "gpt",
"value": "unit ValidatorTypes;\n\ninterface\ntype\n TCLIParamRecord = record\n ScriptFile: string;\n GraphicMode,\n ... | pascal | chosen |
[
{
"from": "human",
"value": "Add file to compile with fpc.\n"
},
{
"from": "gpt",
"value": "unit UBackGround_FPC;\n\ninterface\n\nuses\n IniFiles, DefineUi;\n\ntype\n TBackGround = class\n Image : string;\n constructor Create(aDefault : TBackground);\n procedure LoadIni(iniFile ... | pascal | chosen |
[
{
"from": "human",
"value": "Test for floating point literals\n\nIgnore-this: d5729af8dc167f70f445d1b845a0e25a\n\ndarcs-hash:20140228154607-ece1f-92026014bd56fc3b6fd86a01c105e95149c7ddc8\n"
},
{
"from": "gpt",
"value": "var\n\ta: Integer;\n\tb: Real;\nbegin\n\ta := 30 + -5 + +7;\n\tWriteLn(a);\n... | pascal | chosen |
[
{
"from": "human",
"value": "Add minimal exe to run any script\n"
},
{
"from": "gpt",
"value": "Program Run;\n\nUses\n SysUtils,\n Windows,\n ShellApi;\n\n{ $R *.RES}\n\nConst Exts='js;vbs;bat;cmd;lnk;url';\n\nProcedure runLink;\nVar\n X, R: String;\n i: Integer;\nBegin\n R:=Exts;\n Repea... | pascal | chosen |
[
{
"from": "human",
"value": "Add bublesort program that repeats itself 10 times\n"
},
{
"from": "gpt",
"value": "program bubble;\nvar arr : array [1..10000] of integer;\nvar n, i, j : integer;\nvar tmp : integer;\nvar sorted: boolean;\nvar swaps : integer;\nvar runs : integer;\nbegin\n{run the p... | pascal | chosen |
[
{
"from": "human",
"value": "Add a new test case.\n"
},
{
"from": "gpt",
"value": "const x=20;\r\nvar y, z, a: integer;\r\n\r\nfunction xel(var arg1, arg2: integer): integer;\r\nbegin\r\n z := 2;\r\n\targ1 := arg1 + arg2 + x\r\nend;\r\n\r\nbegin\r\n y := 10;\r\n z := 9;\r\n a := xel(... | pascal | chosen |
[
{
"from": "human",
"value": "Solve Area of a Circle in pascal\n"
},
{
"from": "gpt",
"value": "Uses sysutils;\n\nVar n : Double;\n\nbegin\n read(n);\n\n WriteLn(Format('A=%.4f', [n * n * 3.14159]));\nend.\n"
}
] | pascal | chosen |
[
{
"from": "human",
"value": "Solve Average 1 in pascal\n"
},
{
"from": "gpt",
"value": "Uses sysutils;\n\nVar a : Double;\n b : Double;\n\nbegin\n read(a);\n read(b);\n\n WriteLn(Format('MEDIA = %.5f', [(a * 3.5 + b * 7.5) / 11.0]));\nend.\n"
}
] | pascal | chosen |
README.md exists but content is empty.
- Downloads last month
- 6