View func.lua
function lua_function_string(s)
return "るあ " .. s;
end
function lua_function_int(i)
return 5050 + i;
end
View uCreateProcesses.pas
unit uCreateProcesses;
interface
uses
Winapi.Windows;
type
TCreateProcesses = class(TObject)
private
FstCommand: String;
View FCheckRename.dpr
program FCheckRename;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, System.IOUtils, Winapi.Windows;
var
source_filename: String;
View delphi_parameter_tobject_method.cpp
//C++ Builder XE8 shared_ptrで作成したインスタンスを
//他のclass methodに引数として渡す場合。
void __fastcall TForm1::SListMethod(TObject* value)
{
//引数から来たvalueをキャスト
TStringList *s = (TStringList*)value;
if (s->Count > 0)
{
Caption = s->Strings[0];
}
View unit1.pas
procedure TForm1.Idle(Sender: TObject; var Done: Boolean);
begin
Invalidate();
end;
View ole_Excel_test.cpp
#include "System.Win.ComObj.hpp"
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
#define DEF_EXCEL_OLENAME "Excel.Application"
#define XLS_FILE L"\\あいうえお.xlsx"
Variant ExcelApp = CreateOleObject(DEF_EXCEL_OLENAME);
try
{
WideString FileName2 = ExtractFileDir(ParamStr(0)) + XLS_FILE;
View factorization_bcb_xe8_32bit.cpp
#pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
View main_form_template_test.cpp
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TStringList *sl;
TStringList **sl1;
TFoo<TStringList> foo2;
TFoo<aho<int> > *foo = new TFoo<aho<int> >;
try
{
aho<int> *a = foo->test();
a->itest = 100; //TFooで作ったahoクラスに実態が操作できているかテスト;
View cpp11_vector_for_ tried.cpp
std::vector<std::shared_ptr<TFmxObject> > list;
int iCount = 0;
//TFmxObjectを安全に100個作ります。
for (int i = 0; i < 100; i++)
{
std::shared_ptr<TFmxObject> obj(new TFmxObject(this));
list.push_back(obj);
list[i]->Parent = this;
}
View meta_ recursive_call.cpp
//---------------------------------------------------------------------------
/*
C++Builder XE8 template meta program.
This program plus up to 1 to 10.
Earlier in the compiler side we are making an answer as "meta program".
*/
template <int N>
class TFoo
{
public: