Difference between revisions of "Sand Box/ru"

From Lazarus wiki
Jump to navigationJump to search
Line 1: Line 1:
 
{{Sand Box}}
 
{{Sand Box}}
  
New Page
+
=Heading=
 +
----
 +
==Append==
  
==Заголовок==
+
<syntaxhighlight> Program Test;
===Подзаголовок===
+
Uses Crt;
<table>
+
 
  <tr>
+
Var I : Integer;
<td>Таблица</td>
+
 
  </tr>
+
Begin
</table>
+
  For I := 0 to 12 do
 +
    WriteLn('Test ',I:2);
 +
End.</syntaxhighlight>
 +
 
 +
--[[User:Ggeldenhuys|Graeme]] 11:03, 23 March 2012 (UTC) The DELPHI style doesn't seem to be supported, so we have to use the SOURCE tag instead.
 +
 
 +
===Sayonara===
 +
 
 +
Test O
 +
 
 +
How to use an internal link: [[#indenting first line|indent first line]].
 +
 
 +
==External link==
 +
External link: [http://www.example.com link title]
 +
<br>another link: [http://www.example.com link title]
 +
 
 +
<div class="floatright"> [[Image:Laz de menu bearb2.jpg]] </div>
 +
 
 +
 
 +
 
 +
==a image==
 +
This text should be placed near the picture, does it? zxvzxcv zxvc xcv xzcv zxcv zxvc zxvc zxcv zxcv zxcv zxcv xcv xcv xcv xcv zxcv zxcv zxcv xcv zxcv zxcv aaaaaaaaaaaaa<br>
 +
<b>And this line were is going?</b> and this line?<br>
 +
==a text==
 +
This is the text
 +
 
 +
==new section test==
 +
 
 +
==Table 2==
 +
<TABLE WIDTH="90%" CELLPADDING="1" CELLSPACING="1">
 +
<TR>  
 +
  <TD><b>Header 1</b></TD>
 +
  <TD><b>Header 2</b></TD>
 +
  <TD><b>Header 3</b></TD>
 +
  <TD><b>Header 4</b></TD>
 +
</TR>
 +
<TR>
 +
  <TD>Item 1,1</TD>
 +
  <TD>Item 1,2</TD>
 +
  <TD>Item 1,3</TD>
 +
  <TD>Item 1,4</TD>
 +
</TR>
 +
<TR>
 +
  <TD>Item 2,1</TD>
 +
  <TD>Item 2,2</TD>
 +
  <TD>Item 2,3</TD>
 +
  <TD>Item 2,4</TD>
 +
</TR>
 +
</TABLE>
 +
 
 +
==Bullets==
 +
*One
 +
*Two
 +
**Tree
 +
 
 +
==Numbering==
 +
#First
 +
#Second
 +
#Third
 +
''Nested Numbering''
 +
#First
 +
##first.one
 +
##first.two
 +
##first.three
 +
#Second
 +
##second.one
 +
##second.two
 +
##second.three
 +
''Mixed Numbering''
 +
#First
 +
#*first.one
 +
#*first.two
 +
#*first.three
 +
#Second
 +
#*second.one
 +
#*second.two
 +
#*second.three
 +
 
 +
==indenting first line==
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please note that all contributions to Lazarus-ccr are considered to be released under the GNU Free Documentation License (see Lazarus-ccr:Copyrights for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
 +
: You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
 +
 
 +
TEST
 +
 
 +
[[es:Probando]]
 +
 
 +
'''Another''' ''Test:'' '''''lets go crazy'''''
 +
 
 +
I want to create a boxed text:
 +
This is in a '''box''', or so ''I hope''.
 +
 
 +
This is outside the box, no? And this is a reference to my incomplete
 +
[http://www/pcug.org.au/~akabaila/StructuralAnalysis/  Structural Analyis] book
 +
ThisIsMyShura
 +
 
 +
  Weird: this is in the box as well?
 +
 
 +
* ''And a bullet in italics?''
 +
 
 +
<nowiki>non formatted...</nowiki>
 +
 
 +
==Humm==
 +
 
 +
=Float Like A Butterfly=
 +
 
 +
==New section?==
 +
Let's see...
 +
ok
 +
 
 +
grusskarte
 +
 
 +
if Graphviz was installed, this would draw a pretty graph...
 +
 
 +
<graphviz>
 +
digraph G {
 +
  rankdir=LR; node [fontsize = "8" shape = "rectangle"];
 +
  "Node 1" -> "Node 2";
 +
}
 +
</graphviz>
 +
 
 +
This is a test to see, if I can edit a page after the Bad-Behavior update. [[User:Vincent|fpcfan]] 22:43, 7 December 2007 (CET)
 +
 
 +
==Tutorial links==
 +
[http://www.chat11.com/30_Second_Quick_Wiki_Tutorial 30 Second Quick Wiki Tutorial]
 +
 
 +
*[[LazAutoUpdater#Use|Using LazAutoUpdate CodeSnippet]]
 +
 
 +
<nowiki>
 +
Use this syntax to include a page within another page: {{:LazAutoUpdater}}
 +
</nowiki>
 +
{{:AppIsRunning}}

Revision as of 12:31, 7 December 2014

Deutsch (de) English (en) español (es) Bahasa Indonesia (id) italiano (it) 日本語 (ja) polski (pl) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN)

Heading


Append

 Program Test;
 Uses Crt;

 Var I : Integer;

 Begin
   For I := 0 to 12 do
     WriteLn('Test ',I:2);
 End.

--Graeme 11:03, 23 March 2012 (UTC) The DELPHI style doesn't seem to be supported, so we have to use the SOURCE tag instead.

Sayonara

Test O

How to use an internal link: indent first line.

External link

External link: link title
another link: link title


a image

This text should be placed near the picture, does it? zxvzxcv zxvc xcv xzcv zxcv zxvc zxvc zxcv zxcv zxcv zxcv xcv xcv xcv xcv zxcv zxcv zxcv xcv zxcv zxcv aaaaaaaaaaaaa
And this line were is going? and this line?

a text

This is the text

new section test

Table 2

Header 1 Header 2 Header 3 Header 4
Item 1,1 Item 1,2 Item 1,3 Item 1,4
Item 2,1 Item 2,2 Item 2,3 Item 2,4

Bullets

  • One
  • Two
    • Tree

Numbering

  1. First
  2. Second
  3. Third

Nested Numbering

  1. First
    1. first.one
    2. first.two
    3. first.three
  2. Second
    1. second.one
    2. second.two
    3. second.three

Mixed Numbering

  1. First
    • first.one
    • first.two
    • first.three
  2. Second
    • second.one
    • second.two
    • second.three

indenting first line

      Please note that all contributions to Lazarus-ccr are considered to be released under the GNU Free Documentation License (see Lazarus-ccr:Copyrights for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.

You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!

TEST

es:Probando

Another Test: lets go crazy

I want to create a boxed text:

This is in a box, or so I hope.

This is outside the box, no? And this is a reference to my incomplete Structural Analyis book ThisIsMyShura

Weird: this is in the box as well?
  • And a bullet in italics?

non formatted...

Humm

Float Like A Butterfly

New section?

Let's see... ok

grusskarte

if Graphviz was installed, this would draw a pretty graph...

<graphviz> digraph G {

 rankdir=LR; node [fontsize = "8" shape = "rectangle"]; 
 "Node 1" -> "Node 2";

} </graphviz>

This is a test to see, if I can edit a page after the Bad-Behavior update. fpcfan 22:43, 7 December 2007 (CET)

Tutorial links

30 Second Quick Wiki Tutorial

Use this syntax to include a page within another page: {{:LazAutoUpdater}} Deutsch (de) English (en) español (es) Bahasa Indonesia (id) italiano (it) 日本語 (ja) polski (pl) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN)

Test whether an Application is already running

Here's a unit that works under both Windows and Linux

  • There's no need to pass the full application path to the function - the ExeName will usually do. Below code cannot find out its own exename though.
unit uappisrunning;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils
  {$IFDEF WINDOWS}, Windows, JwaTlHelp32{$ENDIF}
  {$IFDEF LINUX},process{$ENDIF};
// JwaTlHelp32 is in fpc\packages\winunits-jedi\src\jwatlhelp32.pas

// Returns TRUE if EXEName is running under Windows or Linux
// Don't pass an .exe extension to Linux!
function AppIsRunning(const ExeName: string):Boolean;

implementation

// These functions return Zero if app is NOT running
// Override them if you have a better implementation

{$IFDEF WINDOWS}
function WindowsAppIsRunning(const ExeName: string): integer;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;

begin
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
  Result := 0;

  while integer(ContinueLoop) <> 0 do
    begin
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
      UpperCase(ExeName)) or (UpperCase(FProcessEntry32.szExeFile) =
      UpperCase(ExeName))) then
      begin
      Inc(Result);
      // SendMessage(Exit-Message) possible?
      end;
    ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
    end;

  CloseHandle(FSnapshotHandle);
end;
{$ENDIF}

{$IFDEF LINUX}
function LinuxAppIsRunning(const ExeName: string): integer;
var
  t: TProcess;
  s: TStringList;

begin
  Result := 0;
  t := tprocess.Create(nil);
  t.CommandLine := 'ps -C ' + ExeName;
  t.Options := [poUsePipes, poWaitonexit];

    try
    t.Execute;
    s := TStringList.Create;
      try
      s.LoadFromStream(t.Output);
      Result := Pos(ExeName, s.Text);
      finally
      s.Free;
      end;
    finally
    t.Free;
    end;

end;
{$ENDIF}

function AppIsRunning(const ExeName: string):Boolean;
begin

{$IFDEF WINDOWS}
  Result:=(WindowsAppIsRunning(ExeName) > 0);
{$ENDIF}

{$IFDEF LINUX}
  Result:=(LinuxAppIsRunning(ExeName) > 0);
{$ENDIF}

end;
end.

See also