Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 2.37 KB

README.md

File metadata and controls

87 lines (61 loc) · 2.37 KB

Coding Guide

Syntax Checking

PEBakery supports syntax checking.

Checking Statements or Section

Copy codes into Syntax Checker provided in Utility.

Checking Plugin

Make sure your plugin is visible in project tree. Open plugin's interface, and click the check button on the right.

If Auto Syntax Check Error setting is enabled, the button's color reports if error exists.

Optimization

PEBakery automatically optimizes some commands related to text manipulation.

  • TXTAddLine
  • TXTReplace
  • TXTDelLine
  • INIRead
  • INIWrite
  • INIDelete
  • INIReadSection
  • INIAddSection
  • INIDeleteSection
  • INIWriteTextLine
  • Visible

When commands are optimized, multiple file read/write is compacted into single read/write, improving performance.

The optimization occurs only if same commands manipulates same file are placed in a row.

Make sure your code can be optimized for performance.

Example of Optimized Commands

TXTAddLine writes multiple lines into same file %ProjectTemp%\Korean_IME_TheOven.txt. They are optimized to single command TXTAddLineOp, writing full text at once.

Set,%w%,%ProjectTemp%\Korean_IME_TheOven.txt
FileCreateBlank,%w%
TXTAddLine,%w%,"<Korean IME Plugin - TheOven Topics>",Append
TXTAddLine,%w%,,Append
TXTAddLine,%w%," [TheOven] Korean IME for Win8.1SE topic",Append
TXTAddLine,%w%,"  - http://TheOven.org/index.php?topic=825",Append
TXTAddLine,%w%,,Append
TXTAddLine,%w%," [TheOven] Korean IME for Win10PESE topic",Append
TXTAddLine,%w%,"  - http://TheOven.org/index.php?topic=1440",Append
Call,StartDoc,%w%

Visible command only affects plugin itself.

Visible,%pBevel3%,True,PERMANENT
Visible,%pCheckBox4%,True,PERMANENT
Visible,%pCheckBox5%,True,PERMANENT
Visible,%pCheckBox6%,True,PERMANENT
Visible,%pCheckBox7%,True,PERMANENT

Example of Not Optimized Commands

TXTDelLine and TXTAddLine is different command.

TXTDelLine,%target_sys%\autorun.cmd,exit
TXTAddLine,%target_sys%\autorun.cmd,"hiderun.exe IMEReg.cmd",Append

Multiple TXTAddLine is writing to same file, but they are not placed in a row.

TXTAddLine,%DestDir%\hello.txt,"Hello World!",Append
Echo,"Hello World!"
TXTAddLine,%DestDir%\hello.txt,"Have a nice day.",Append

Possible Problem with Optimization

If optimized commands failes, all data cannot be processed properly.

So make sure your codes to avoid exceptions.