How to Use Block Code: A Step-by-Step Tutorial
Quick Introduction to Block Code
Block Code is a beginner-friendly no-code/low-code platform that lets you build scripts and applications visually—without writing a single line of code. Using a drag-and-drop interface, you assemble logical blocks to define your program flow. It’s like building with LEGO bricks: intuitive, fun, and powerful. Once your block sequence is ready, the system automatically translates it into real source code in your chosen programming language.
Select Your Programming Language
At the top of the page, use the language selector to choose among supported languages like MQL4, JavaScript, Python, Java, C#, PHP, and others. The block library will refresh to show only blocks compatible with your selected language.
- Click the language dropdown and pick your target language.
- The available blocks list updates automatically.
- You can switch languages at any time; your dropped blocks remain in place if supported.
Searching and Selecting Blocks
The left panel lists all available blocks for your chosen language. Scroll through categories or use the search box to filter by keyword. Each block shows its name and a short description. Right-click on a block for detailed info, including required variables.
- Type in the search field to filter blocks.
- Right-click for details and variable specifications.
- Click to view or drag to add to your workspace.
Voting for Block Relevance
Help the community by rating blocks on a 6‑star scale (1 = 0/5, …, 6 = 5/5). Blocks with higher average ratings float to the top, making it easier for others to find the most useful elements.
- Right-click and select a star rating.
- See average ratings and vote counts in the details view.
- Your input continuously improves the block ecosystem.
Drag and Drop Blocks
Drag a block from the left panel into the workspace on the right. Blocks snap together to define the flow. You can rearrange, remove, or nest blocks as needed. The interface supports intuitive drag handles and snap guides.
- Drag blocks into the drop zone to add logic.
- Reorder by dragging up or down.
- Nest blocks to represent parent-child relationships.
Tip: Start small—add one block at a time and test your logic before building complex flows.
Configuring Block Variables
Each block may require specific variables (inputs) to operate. Click a block in the workspace to open its configuration panel. Fill in fields like numbers, text, or dropdowns. Hover tooltips often provide guidance or default values.
- Click to open the variable form.
- Fill in required inputs (e.g., API keys, thresholds, sizes).
- Leave optional fields blank to use defaults.
Note: Properly configured variables ensure your generated code runs without errors. Always check for missing inputs before compiling.
Compile Your Project
Click the Compile button below the workspace. The platform translates your block design into source code, checks for missing inputs or errors, and prepares the file for download.
- Press Generate the Code File.
- Resolve any error prompts for missing or invalid variables.
- Successful compile will display the download link.
Download the Generated File
After compiling, click the provided link to download your source file. The filename reflects your project name and language extension (e.g., .mq4
, .js
, .py
).
- Locate the file in your browser’s download folder.
- Keep the correct file extension for your environment.
- You can rename the file but maintain the extension.
Install in Your Environment
For languages requiring a specific runtime or IDE, follow standard installation steps. For example, to use an MQL4 EA, place the .mq4
file in MetaTrader’s Experts folder and refresh. For JavaScript, run with Node.js or in a web page. For Python, import and execute with your interpreter.
- Follow language-specific setup (IDE, runtime folders, refresh commands).
- Refer to platform documentation for advanced deployment.
- Ensure dependencies (if any) are installed.
Bonus: Add Custom Blocks
Extend Block Code by creating your own blocks. Navigate to the “Add New Block” page, define block metadata, write template code snippets, and declare variables. Once saved, custom blocks appear alongside built-ins.
- Provide block name, description, and code snippet.
- Define variables and their types.
- Save and start using your custom block immediately.
Advanced: Custom blocks unlock full flexibility—mix no-code ease with hand-written logic.
That’s it! You’re now ready to build multi-language projects visually with Block Code. Happy coding!
Any bugs? Report them to contact@cp-corporation.fr.