4d-v20
3
总安装量
3
周安装量
#62582
全站排名
安装命令
npx skills add https://github.com/jaimealvarezv/4d-development-skill-v20 --skill 4d-v20
Agent 安装分布
amp
3
gemini-cli
3
antigravity
3
github-copilot
3
codex
3
kimi-cli
3
Skill 文档
4D v20 Development Skill
This skill provides expert knowledge for developing in 4D v20. It includes embedded official documentation and best practice guides tailored for version 20.
ð Documentation Router
| Topic | Reference File | Description |
|---|---|---|
| Language Syntax | language-syntax.md | var, operators, control flow, v20 specifics. |
| Data Types | data-types.md | Collections, Objects, Variants, typing rules. |
| ORDA | orda-modern.md | Entity Selections, DataClass, optimization. |
| Queries | query-patterns.md | Placeholders, formula queries, optimization. |
| Error Handling | error-handling.md | ON ERR CALL, Try/Catch (check availability). |
| Web & REST | web-and-rest.md | Web Server, REST API, HTTPRequest. |
| Forms & UI | forms-and-ui.md | Form objects, events, list boxes. |
â ï¸ Critical v20 Rules
- Variable Declaration: ALWAYS use
var $name : Type. AvoidC_TEXTunless modifying legacy code. - Assignment: Use
:=for assignment found in legacy/standard mode. v20 allows=in some contexts but:=is safer for compatibility.- Note: If “Use standard assignment =” option is on,
=is fine. Default to:=to be safe.
- Note: If “Use standard assignment =” option is on,
- Collections vs Arrays: Prefer Collections (
[]) and Objects ({}) over Arrays (ARRAY TEXT). - Query Literals: Use placeholders (
:1,:2) or: $var. NEVER concat strings into queries (SQL injection checks).- Safe:
ds.Users.query("name = :1", $name)
- Safe:
- Null: Use
Nullkeyword. Check withUnknown valueorAsserthelper if needed. - Linked Collections: When using
[table], remember it returns a selection. To get a collection, useds.Table.all().toCollection().
ð« v21+ Features to AVOID (v21-only)
Do NOT use the following features unless you are certain the project is v20 R7+ or v21:
- HTTP Classes:
4D.IncomingMessage,4D.OutgoingMessage(v20 R6+). UseOn Web Connection/WEB GET BODYfor standard v20 servers. - File Handles:
4D.File.Handle(v21). UseFileandDocument to text/Text to documentorFile.getContent(). - Singleton Classes:
shared singleton Class. UseStoragefor singletons in v20. - Try/Catch: Available in v20 R4+. If base v20, use
ON ERR CALL. Verify exact v20 R-release.
ð Searching Documentation
The official 4D v20 documentation is embedded in the docs/ directory.
To find information about a command or class:
- Search References: Check
references/first for high-level patterns. - Grep Docs: Use
grep_searchorfind_by_nameindocs/folder.- Example:
grep -r "HTTP Request" docs/
- Example:
- API Index: See api-index.md for a map of standard commands.
REST Contract
When building REST APIs in v20:
- Success:
{ "ok": true, "data": ... } - Error:
{ "ok": false, "error": { "code": 123, "message": "..." } } - Use
Web Serverclass orOn Web Connectiondatabase method.