pbidea
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePbIdea 框架 API 查询
PbIdea Framework API Query
本技能把 PbIdea 框架的全部导出源码(,566 个 PB 对象:用户对象/数据窗口/窗口/函数/结构)
全文索引进一个 SQLite 数据库 ,用脚本毫秒级检索。核心原则:不要凭记忆
编造 PbIdea 的 API 细节,凡涉及具体函数签名、属性名、常量值(如 HttpGet=1)、组件是否存在,
一律查索引。 索引内容直接来自框架源码本身( 文件的外函数声明块 、
中文注释、常量、事件脚本),是最权威、最完整的 API 参考。
code/references/pbidea.db.srutype prototypesThis skill full-text indexes all exported source code of the PbIdea framework (, 566 PB objects: user objects/datawindows/windows/functions/structures) into an SQLite database , enabling millisecond-level retrieval via scripts. Core Principle: Do not fabricate PbIdea API details from memory. For any specific function signatures, property names, constant values (e.g., HttpGet=1), or component existence, always check the index. The indexed content directly comes from the framework's source code itself (external function declaration blocks in files, Chinese comments, constants, event scripts), making it the most authoritative and complete API reference.
code/references/pbidea.dbtype prototypes.sru运行前提(复制即用)
Prerequisites (Copy and Use Directly)
- 只需本技能目录中的 (已预构建)。
references/pbidea.db - 查询脚本只用 Python 内置 (FTS5 trigram 分词器),无需安装任何第三方包;但需要 Python 3.11+ 运行时(其自带 SQLite ≥3.37,支持 trigram)。
sqlite3 - 检查当前机器是否有 Python:(Windows 下也可试
python --version)。 若提示找不到py --version/python:先安装 Python 3.11+(https://www.python.org/downloads/), 否则检索脚本无法运行。py - Windows 下运行脚本时统一加 ,否则 GBK 控制台打印中文会报编码错误。
PYTHONIOENCODING=utf-8 - 整个技能目录可整体复制到任何装有 Python 3.11+ 的机器使用,无需联网、无需额外模型。
- Only need (pre-built) in this skill directory.
references/pbidea.db - The query script only uses Python's built-in (FTS5 trigram tokenizer), no third-party packages required; however, Python 3.11+ runtime is needed (it comes with SQLite ≥3.37 which supports trigram).
sqlite3 - Check if Python is available on the current machine: (try
python --versionon Windows). Ifpy --version/pythonis not found: Install Python 3.11+ first (https://www.python.org/downloads/), otherwise the retrieval script cannot run.py - Add when running the script on Windows to avoid encoding errors when printing Chinese in the GBK console.
PYTHONIOENCODING=utf-8 - The entire skill directory can be copied to any machine with Python 3.11+ for use, no internet connection or additional models required.
组件地图(先知道有什么,再检索)
Component Map (Know What's Available First, Then Search)
PbIdea 是「基于 JSON 与 WebAPI 的 PowerBuilder 接口扩展库」,核心实现编译在
,PB 侧通过外函数声明调用。 的 表存了全部 566 个
对象的名称、所属库和一句中文描述;用 可浏览,下表是主要组件速览:
PbIdea.dllreferences/pbidea.dbcataloglist_objects.py| 类别 | 对象(websuite 库) | 说明 |
|---|---|---|
| JSON | | 核心 JSON 对象:Parse/ToString/Set/Get,级联路径如 |
| JSON | | DataWindow/DataStore 与 JSON 互导 |
| JSON | | 标准库函数、可存二进制的 BSON、csv2json、json 格式配置文件 |
| HTTP | | WinHttp 客户端: |
| HTTP | | 基于 curl 库的客户端、FTP、WebSocket、阿里云 |
| 加密编码 | | openssl 算法库、RSA 加解密/签名验签、国密 SM2/SM3/SM4 |
| 数据库 | (sql 库) | 数据库访问、连接池、结果集 |
| 数据处理 | | DW 增强、DBF/xlsx/XML 读写 |
| 压缩 | | 压缩解压 |
| 系统工具 | | 线程/定时/进程/串口/字符串/键值对/blob/大整数/日期/文件/语法编辑器 |
| UI | | 图表、LED、遮罩窗口 |
| 其他库 | sciter 库 | — |
需要完整清单时运行 (可加 pbl 名、
、 过滤)。
PYTHONIOENCODING=utf-8 python scripts/list_objects.py--type--namePbIdea is a "PowerBuilder interface extension library based on JSON and WebAPI", with its core implementation compiled in , and the PB side calls it via external function declarations. The table in stores the names, affiliated libraries, and a Chinese description of all 566 objects; you can browse them using . The following is a quick overview of main components:
PbIdea.dllcatalogreferences/pbidea.dblist_objects.py| Category | Objects (websuite library) | Description |
|---|---|---|
| JSON | | Core JSON object: Parse/ToString/Set/Get, cascading paths like |
| JSON | | Mutual conversion between DataWindow/DataStore and JSON |
| JSON | | Standard library functions, BSON for binary storage, csv2json, JSON format configuration files |
| HTTP | | WinHttp client: |
| HTTP | | curl-based client, FTP, WebSocket, Alibaba Cloud |
| Encryption & Encoding | | openssl algorithm library, RSA encryption/decryption/signature verification, SM2/SM3/SM4 |
| Database | (sql library) | Database access, connection pool, result set |
| Data Processing | | DW enhancement, DBF/xlsx/XML reading and writing |
| Compression | | Compression and decompression |
| System Tools | | Thread/timer/process/serial port/string/key-value pair/blob/big integer/datetime/file/syntax editor |
| UI | | Charts, LED, mask window |
| Other Libraries | sciter library | — |
To get the complete list, run (you can add pbl name, , for filtering).
PYTHONIOENCODING=utf-8 python scripts/list_objects.py--type--name检索工作流
Retrieval Workflow
-
全文检索定位(主路径)。从用户问题里提取英文关键词(对象名、函数名、常量名)和中文 关键词(功能描述),用毫秒级定位命中对象:
search_db.pybashPYTHONIOENCODING=utf-8 python scripts/search_db.py Request PYTHONIOENCODING=utf-8 python scripts/search_db.py "uo_json Get" PYTHONIOENCODING=utf-8 python scripts/search_db.py 加密 签名多个关键词默认 AND 收窄(引号可有可无)。注意:索引用 trigram 分词器,不支持 AND/OR 等 布尔运算符,需要更宽/更窄搜索时直接换关键词或增减词数。命中输出「库 / 对象名 (类型)+ 命中片段」。 -
一次取回完整上下文。检索时加,让
--pages N在打印命中片段的同时把前 N 个命中对象的完整源码一起输出(函数签名、中文注释、常量、事件脚本同在一个文件里互补), 通常这一步就够作答:search_db.pybashPYTHONIOENCODING=utf-8 python scripts/search_db.py "uo_httpclient Request" --pages 2若已知对象名、想直接看完整源码,用:get_object.pybashPYTHONIOENCODING=utf-8 python scripts/get_object.py uo_json PYTHONIOENCODING=utf-8 python scripts/get_object.py uo_json websuite # 同名时指定库 -
按组件地图定位(辅助)。若不知道从哪个关键词下手,先看「组件地图」确定对象归属, 再直接取该对象源码,或
get_object.py浏览同类对象。list_objects.py --name uo_ -
自然作答。基于提取的原文内容回答,但不要照抄代码措辞,也不要罗列引用。回答要像一位 用 PbIdea 多年的 PowerBuilder 开发者面对面解答:直接给用法、给示例、给调用约定(如数组下标从 0 开始)。最终回答不得出现任何库名、 对象文件名、脚本命令或"出处"这类来源标识——检索脚本内部会用到文件名,但那是工作流内部 细节,不要泄漏给用户。也不要在正文中反复强调版本号(例如不要每句都带上"PbIdea 里")。 版本号仅在用户明确询问版本特性/差异时才提及。若提取内容不足以回答,扩大关键词或换对象重试。
uo_json.Get("/0/sub/2/dj", ref ld_dj)
-
Full-text Retrieval Localization (Main Path). Extract English keywords (object names, function names, constant names) and Chinese keywords (function descriptions) from user questions, then useto locate hit objects in milliseconds:
search_db.pybashPYTHONIOENCODING=utf-8 python scripts/search_db.py Request PYTHONIOENCODING=utf-8 python scripts/search_db.py "uo_json Get" PYTHONIOENCODING=utf-8 python scripts/search_db.py 加密 签名Multiple keywords default to AND to narrow down results (quotes are optional). Note: The index uses a trigram tokenizer, Boolean operators like AND/OR are not supported. To widen or narrow the search, directly change keywords or adjust the number of words. The hit output shows "Library / Object Name (Type) + Hit Fragments". -
Retrieve Complete Context at Once. Addduring retrieval to make
--pages Noutput the complete source code of the top N hit objects along with the hit fragments (function signatures, Chinese comments, constants, event scripts are in the same file for complementation). Usually this step is sufficient for answering:search_db.pybashPYTHONIOENCODING=utf-8 python scripts/search_db.py "uo_httpclient Request" --pages 2If you know the object name and want to view the complete source code directly, use:get_object.pybashPYTHONIOENCODING=utf-8 python scripts/get_object.py uo_json PYTHONIOENCODING=utf-8 python scripts/get_object.py uo_json websuite # Specify library for duplicate names -
Localize by Component Map (Auxiliary). If you don't know which keyword to start with, first check the "Component Map" to determine the object's affiliation, then useto directly retrieve the object's source code, or
get_object.pyto browse similar objects.list_objects.py --name uo_ -
Answer Naturally. Answer based on the extracted original content, but do not copy the code wording or list references. The answer should be like a PowerBuilder developer who has used PbIdea for many years answering face-to-face: directly provide usage, examples, and calling conventions (e.g.,where array indices start from 0). The final answer must not contain any library names, object file names, script commands, or source identifiers like "source" — the retrieval script uses file names internally, but that's an internal workflow detail and should not be disclosed to users. Also, do not repeatedly emphasize version numbers in the text (e.g., do not add "in PbIdea" to every sentence). Version numbers should only be mentioned when the user explicitly asks about version features/differences. If the extracted content is insufficient to answer, expand keywords or try other objects.
uo_json.Get("/0/sub/2/dj", ref ld_dj)
为什么查询而不是外推
Why Query Instead of Extrapolate
PbIdea 的 API 面极宽(566 个对象,函数签名、常量值、级联路径规则各不相同),且与主流语言
习惯不同(如 JSON 数组下标从 0 起、 外函数声明、
响应对象)。凭印象容易给错参数、记错常量或虚构不存在的组件。 是权威来源,按
「搜索关键词 → 取完整对象源码」两步走,多数问题毫秒级可锁定。
system library "PbIdea.dll"uo_responsepbidea.dbPbIdea has an extremely wide API surface (566 objects, with different function signatures, constant values, and cascading path rules), and its habits differ from mainstream languages (e.g., JSON array indices start from 0, external function declaration, response object). It's easy to give wrong parameters, misremember constants, or fictionalize non-existent components based on impressions. is the authoritative source. Following the two steps of "search keywords → retrieve complete object source code", most questions can be locked in milliseconds.
system library "PbIdea.dll"uo_responsepbidea.db附注
Notes
- 是预构建的(从 PbIdea 框架的导出源码构建,GBK/UTF-8 自动识别解码),已随技能 交付,可直接使用。
pbidea.db - 源码更新后可用 一键重建索引:
scripts/build_db.pybashPYTHONIOENCODING=utf-8 python scripts/build_db.py --source <PbIdea 源码目录> - 索引存的是文本正文,PB 导出文件中的布局坐标、字体等属性完整保留但无实际渲染价值;函数 签名、注释、事件脚本、常量声明完整可读。
- 查询依赖:仅 Python 内置 (含 FTS5 trigram),无第三方包。
sqlite3
- is pre-built (constructed from exported source code of the PbIdea framework, with automatic GBK/UTF-8 recognition and decoding), delivered with the skill, and can be used directly.
pbidea.db - After updating the source code, you can rebuild the index with one click using :
scripts/build_db.pybashPYTHONIOENCODING=utf-8 python scripts/build_db.py --source <PbIdea source code directory> - The index stores text content. Layout coordinates, fonts, and other attributes in PB exported files are fully retained but have no actual rendering value; function signatures, comments, event scripts, and constant declarations are fully readable.
- Query dependencies: Only Python's built-in (including FTS5 trigram), no third-party packages.
sqlite3