sakura/en/Macro Functions for PPA and WSH

Last-modified: 2008-03-30 (日) 09:16:45

Macro Functions for PPA and WSH

There is a function that cannot be used (It is not significant even if it does) from key macro.

Format of function declaration

function FunctionName( ParameterName :Type ): ReturnValueType;

[hatena] Hint:
Please apply "S_FunctionName", "S_" prefix when using it from PPA.
Please apply "Editor.FunctionName", the object name when using it from WSH.

It becomes the following if it writes by C language.

ReturnValueType FunctionName( Type ParameterName );

  • Version
    sakura: The version for which the function can be used is shown.

GetFileName

function GetFileName(): String;

  • Return Value
    A present file name returns.
  • Remarks
    The file name that can be acquired is a full path.
    When filename is "(Untitled)", the null character string is restored.
    It doesn't become an error.
  • Version
    (sakura:1.2.106.9 or later)

GetSelectedString

function GetSelectedString( int1 :Integer ) :String;

  • Parameter
    • int1
      It is reserved. Please specify 0.
  • Return Value
    The character string that has been selected returns.
  • Remarks
    sakura:1.3.5.4 - 1.3.7.0.
    When a part of one line has been selected -> The range of the selection.
    When two lines or more have been selected -> The part where the first line has been selected.
    When it is not selected -> The word at the cursor position.
    Line feed code/NULL character is not included in the character string.
  • Version
    sakura:1.3.8.0 or later
    The entire part selection is returned. The null character string is returned at the unselection.
    The character string within the range of the selection including the line feed code etc. is acquired as it is.
    The acquisition of two or more lines is also possible.
    Please use ExpandParameter("$s") when you want to use existing functions.
  • Version
    sakura:1.3.5.4 or later

ExpandParameter

function ExpandParameter( str1 :String ): String;

  • Parameter
    • str1
      The special character string that develops is specified.
  • Return Value
    The character string specified with str1 returns and development and the replaced character string return.
  • Remarks
    The function for which the ExpandParameter format can be used as it is.

[hatena] Hint:
ExpandParameter( '$F' ); is return S_GetFilename( ); same value.

  • Version
    sakura:1.3.5.4 or later

GetLineStr

function GetLineStr( int1 :Integer ): String;

  • Parameter
    • int1
      The line - number of the line to be acquired is specified by the unit of line-feed (1 beginning).
      The character string of the cursor line can be acquired by specifying 0.
  • Return Value
    The character string of one line including the line feed code.
  • Remarks
    The acquired character string is Line-Feed unit.
    When the return value is a character string of 0 in length, the line means no existence.
    The error occurs when int1 is a minus value.
  • Version
    sakura:1.4.2.0 or later

GetLineCount( int1 :Integer ) :Integer;

  • Parameter
    • int1
      It is reserved. Please specify 0.
  • Return Value
    The all number of lines at the time of each line-feed are returned.
    The case where there is no data in the final line, that is, the line only of EOF is not included in this number of lines.
  • Remarks
    The error occurs if it specifies it for int1 excluding 0.
    Please note the movement about the cursor though the line only of EOF is not included in the number of lines.
  • Version
    sakura:1.4.2.0 or later

ChangeTabWidth( int1 :Integer ) :Integer;

  • Parameter
    • int1
      The value between 1-64 is effective.
  • Return Value
    The width of the tab before the setting change is returned.
  • Remarks
    The width of the tab is set by the value specified by the argument.
    Only when you want to acquire the width of the tab 0 etc. Please specify an invalid argument.
  • Version
    sakura:1.5.5.0 or later

IsTextSelected :Integer;

  • Return Value
    • 0 Non-selective state.
    • 1 It is selecting it.
    • 2 The rectangle is being selected.
  • Remarks
    The range of choice It judges it while selecting it in case of the selection mode at 0.
  • Version
    sakura:1.5.5.0 or later

GetSelectLineFrom :Integer;

  • Return Value
    The selection beginning line (Start from one) is returned.
  • Version
    sakura:1.5.5.0 or later

GetSelectColmFrom :Integer;

  • Return Value
    The selection beginning digit (Start from one) is returned.
  • Version
    sakura:1.5.5.0 or later

GetSelectLineTo :Integer;

  • Return Value
    The selection end line (Start from one) is returned.
  • Version
    sakura:1.5.5.0 or later

GetSelectColmTo :Integer;

  • Return Value
    The selection end digit (Start from one) is returned.
  • Version
    sakura:1.5.5.0 or later

IsInsMode :Integer;

  • Return Value
    • 0 Overwrite Mode
    • 1 Insert Mode
  • Version
    sakura:1.5.5.0 or later

GetCharCode :Integer;

  • Return Value
    • 0 SJIS
    • 1 JIS
    • 2 EUC
    • 3 Unicode
    • 4 UTF-8
    • 5 UTF-7
    • 6 UnicodeBE
  • Remarks
    Whether the file that is opening now is opened as which character-code is examined.
    No one to acquire the state of the text at a specific range or a specified position.
  • Version
    sakura:1.5.5.0 or later

GetLineCode :Integer;

  • Return Value
    • 0 CRLF
    • 1 CR
    • 2 LF
  • Remarks
    The line feed code specified by "Specification of the Input Line Feed Code" is examined.
    No one to acquire the state of the text at a specific range or a specified position.
  • Version
    sakura:1.5.5.0 or later

IsPossibleUndo :Integer;

  • Return Value
    • 0 Invalid
    • 1 Valid
  • Version
    sakura:1.5.5.0 or later

IsPossibleRedo :Integer;

  • Return Value
    • 0 Invalid
    • 1 Valid
  • Version
    sakura:1.5.5.0 or later