uniface-procscript

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Uniface 9.7 ProcScript Reference -- Navigation Skill

Uniface 9.7 ProcScript参考 -- 导航技能

This skill gives you access to the complete official Uniface 9.7 ProcScript reference documentation -- 594 entries across 8 merged category files in
reference/
. Your role is to look up and read these files when answering ProcScript questions, not to rely on memorized knowledge.
该技能可让你访问完整的官方Uniface 9.7 ProcScript参考文档 -- 包含
reference/
目录下8个合并分类文件中的594个条目。你的职责是在回答ProcScript相关问题时查阅并读取这些文件,而非依赖记忆中的知识。

What is ProcScript (minimal context)

什么是ProcScript(最小背景信息)

ProcScript is the 4GL scripting language of the Uniface low-code platform. Key traits to keep in mind when reading the docs:
  • Semicolons (
    ;
    ) start comments, not end statements
  • One statement per line (
    %\
    for continuation)
  • Fields are referenced as
    FIELD.ENTITY
    (qualified) or
    FIELD
    (in context)
  • Variables:
    $1
    -
    $10
    (scratch),
    $NAME$
    (general),
    variables/endvariables
    blocks
  • Lists use gold-semicolon as separator
  • $status
    holds the result of the last operation (0 = success, <0 = error)
  • Code lives in triggers (event handlers) attached to components, entities, or fields
ProcScript是Uniface低代码平台的4GL脚本语言。阅读文档时需要记住的核心特点:
  • 分号(
    ;
    )用于开启注释,而非结束语句
  • 每行一条语句(使用
    %\
    进行换行续接)
  • 字段引用格式为
    FIELD.ENTITY
    (限定格式)或
    FIELD
    (上下文内使用)
  • 变量:
    $1
    -
    $10
    (临时变量)、
    $NAME$
    (通用变量)、
    variables/endvariables
    代码块定义的变量
  • 列表使用gold分号作为分隔符
  • $status
    存储上一次操作的结果(0 = 成功,<0 = 错误)
  • 代码存放在附加到组件、实体或字段的triggers(事件处理器)中

Documentation layout

文档结构

All documentation is in
reference/
relative to this skill. Each category is a single merged file containing all entries separated by
---
horizontal rules:
reference/
  llms.txt                  # Index: every entry with title + one-line description (~620 lines)
  procstatements.md         # 173 entries -- statements (retrieve, read, store, if, for, putitem, ...)
  procfunctions.md          # 248 entries -- functions ($status, $concat, $scan, $replace, $date, ...)
  triggersstandard.md       # 74 entries  -- standard triggers (Read, Write, Store, Validate Field, ...)
  triggersextended.md       # 34 entries  -- extended triggers (OnClick, OnChange, expand, ...)
  procdatatypes.md          # 21 entries  -- data types (string, numeric, date, struct, handle, ...)
  procprecomp.md            # 23 entries  -- preprocessor directives (#define, #if, #include, ...)
  procstructfunctions.md    # 13 entries  -- struct functions ($name, $parent, $scalar, $tags, ...)
  predefinedoperations.md   # 8 entries   -- predefined operations (Exec, Init, Cleanup, Quit, ...)
Each entry starts with
# Title
and includes the full reference content: syntax, parameters, return values, usage notes, and code examples. Entries are separated by
---
.
所有文档存放在该技能相对路径的
reference/
目录下。每个分类是一个单独的合并文件,所有条目通过
---
水平分隔线隔开:
reference/
  llms.txt                  # Index: every entry with title + one-line description (~620 lines)
  procstatements.md         # 173 entries -- statements (retrieve, read, store, if, for, putitem, ...)
  procfunctions.md          # 248 entries -- functions ($status, $concat, $scan, $replace, $date, ...)
  triggersstandard.md       # 74 entries  -- standard triggers (Read, Write, Store, Validate Field, ...)
  triggersextended.md       # 34 entries  -- extended triggers (OnClick, OnChange, expand, ...)
  procdatatypes.md          # 21 entries  -- data types (string, numeric, date, struct, handle, ...)
  procprecomp.md            # 23 entries  -- preprocessor directives (#define, #if, #include, ...)
  procstructfunctions.md    # 13 entries  -- struct functions ($name, $parent, $scalar, $tags, ...)
  predefinedoperations.md   # 8 entries   -- predefined operations (Exec, Init, Cleanup, Quit, ...)
每个条目以
# Title
开头,包含完整的参考内容:语法、参数、返回值、使用说明和代码示例。条目之间用
---
分隔。

How to answer ProcScript questions

如何回答ProcScript问题

Follow this lookup strategy. Always consult the docs -- do not answer from memory alone.
遵循以下查询策略。务必查阅文档 -- 不要仅靠记忆回答。

Step 1: Identify what the user needs

步骤1:明确用户需求

Map the user's question to a category file:
User asks about...Look in
A statement (retrieve, read, store, if, for, putitem, creocc, ...)
procstatements.md
A
$function
($status, $concat, $scan, $date, $curocc, ...)
procfunctions.md
A trigger (Read, Write, Store, Validate, Leave Field, ...)
triggersstandard.md
An extended/widget trigger (OnClick, OnChange, expand, ...)
triggersextended.md
A data type (string, numeric, date, struct, handle, ...)
procdatatypes.md
Preprocessor (#define, #if, #include, compile-time constants)
procprecomp.md
Struct operations ($name, $parent, $scalar, $tags, ...)
procstructfunctions.md
Predefined operations (Exec, Init, Cleanup, Quit, ...)
predefinedoperations.md
将用户的问题映射到对应的分类文件:
用户询问...查阅文件
语句(retrieve, read, store, if, for, putitem, creocc, ...)
procstatements.md
$
开头的函数($status, $concat, $scan, $date, $curocc, ...)
procfunctions.md
触发器(Read, Write, Store, Validate, Leave Field, ...)
triggersstandard.md
扩展/组件触发器(OnClick, OnChange, expand, ...)
triggersextended.md
数据类型(string, numeric, date, struct, handle, ...)
procdatatypes.md
预处理器指令(#define, #if, #include, 编译期常量)
procprecomp.md
Struct操作($name, $parent, $scalar, $tags, ...)
procstructfunctions.md
预定义操作(Exec, Init, Cleanup, Quit, ...)
predefinedoperations.md

Step 2: Find the entry within the file

步骤2:在文件中查找条目

Option A -- Grep for the entry heading (fastest, when you know the name):
Grep: pattern="^# retrieve$" path="reference/procstatements.md" -A 80
This returns the entry and the following lines. Read until you hit the next
---
separator or
# NextTitle
.
Option B -- Search the index (when unsure of the exact name):
Read
reference/llms.txt
to find the entry name and its category file. Each section lists the file:
undefined
选项A -- 搜索条目标题(知道名称时最快):
Grep: pattern="^# retrieve$" path="reference/procstatements.md" -A 80
这会返回条目及其后续行。读取内容直到遇到下一个
---
分隔符或
# 下一个标题
为止。
选项B -- 搜索索引(不确定确切名称时):
读取
reference/llms.txt
来查找条目名称及其所属的分类文件。每个部分都会列出对应的文件:
undefined

Statements

Statements

File:
procstatements.md
  • retrieve: Activate the Read trigger for the first outermost entity...

**Option C -- Grep across all files** (for cross-cutting questions):
Grep: pattern="your search term" path="reference/" glob="*.md"

This is useful for questions like "which statements support the /lock option?" or "where is $webinfo used?".
File:
procstatements.md
  • retrieve: Activate the Read trigger for the first outermost entity...

**选项C -- 全文件搜索**(跨领域问题时):
Grep: pattern="your search term" path="reference/" glob="*.md"

这种方式适用于类似“哪些语句支持/lock选项?”或“$webinfo在哪里使用?”这类问题。

Step 3: Read and synthesize

步骤3:阅读并整合信息

  1. Use Grep with
    -A
    (after context) to read the entry. Typically
    -A 80
    is enough for one entry; increase if the entry is longer
  2. Pay attention to: syntax, parameters, return values, use restrictions, and code examples
  3. Check the Related Topics section at the bottom of each entry for connected concepts
  4. If the question spans multiple topics, grep multiple entries and synthesize
  5. Always cite which file and entry you consulted
  1. -A
    (后续上下文)参数使用Grep读取条目。通常
    -A 80
    足够覆盖单个条目,如果条目较长可以增加数值
  2. 重点关注:语法参数返回值使用限制代码示例
  3. 查看每个条目底部的相关主题部分了解关联概念
  4. 如果问题涉及多个主题,搜索多个条目并整合内容
  5. 务必标注你查阅的文件和条目名称

Step 4: Respond with precision

步骤4:精准回复

  • Quote exact syntax from the docs
  • Include code examples from the docs (they use
    ```procscript
    fenced blocks)
  • Mention
    $status
    return values and error codes when relevant
  • If the docs mention restrictions (component types, trigger contexts), include them
  • When the user's question is ambiguous, list the possible interpretations with entry references
  • 引用文档中的准确语法
  • 包含文档中的代码示例(使用
    ```procscript
    围栏块)
  • 相关情况下需提及
    $status
    返回值和错误码
  • 如果文档提到限制(组件类型、触发器上下文等),请一并说明
  • 当用户问题存在歧义时,列出可能的解读并附上对应的条目参考

Common lookup patterns

常见查询场景

"How do I do X?" (task-oriented)

"我该如何实现X?"(任务导向)

  1. Search
    reference/llms.txt
    for keywords related to the task
  2. Grep the most relevant entries from the appropriate category file
  3. Check
    reference/triggersstandard.md
    if the task involves a specific event context
  4. Combine findings into a coherent answer with code examples from the docs
  1. reference/llms.txt
    中搜索与任务相关的关键词
  2. 在对应的分类文件中搜索最相关的条目
  3. 如果任务涉及特定事件上下文,查阅
    reference/triggersstandard.md
  4. 整合查找结果,结合文档中的代码示例给出连贯的回答

"What does X do?" (reference lookup)

"X的作用是什么?"(参考查询)

  1. Grep directly for the entry:
    pattern="^# X$"
    in the appropriate category file
  2. Read and present: syntax, description, parameters, return values, examples
  1. 直接在对应的分类文件中搜索条目:
    pattern="^# X$"
  2. 读取并展示:语法、描述、参数、返回值、示例

"What's wrong with this code?" (debugging)

"这段代码有什么问题?"(调试)

  1. Identify which statements/functions the code uses
  2. Grep each one's entry, paying attention to:
    • Correct syntax (the docs show exact syntax templates)
    • Valid trigger contexts (some statements are only valid in specific triggers)
    • Return values and error conditions
    • Common gotchas mentioned in the "Use" or "Description" sections
  1. 识别代码使用了哪些语句/函数
  2. 搜索每个条目的内容,重点关注:
    • 正确语法(文档给出了准确的语法模板)
    • 有效触发器上下文(部分语句仅在特定触发器中有效)
    • 返回值和错误条件
    • "使用"或"描述"部分提到的常见陷阱

"What are all the X?" (enumeration)

"所有的X都有哪些?"(枚举)

  1. Read
    reference/llms.txt
    and filter by the relevant section header
  2. Or Grep with a broad pattern across the relevant category file
  1. 读取
    reference/llms.txt
    并按相关的章节标题过滤
  2. 或者在相关分类文件中使用宽泛的模式进行搜索

Important caveats

重要注意事项

  • Generated files: The
    reference/
    directory is regenerated by
    doc/scripts/convert.py
    from
    doc/html/
    sources -- do not edit these files manually.
  • Merged format: Each
    .md
    file contains multiple entries separated by
    ---
    . Use Grep with
    -A
    context to read individual entries.
  • Encoding: Source files are Windows-1252; generated output is UTF-8.
  • Version: This documentation covers Uniface 9.7 specifically. Do not assume features from other versions.
  • 生成文件
    reference/
    目录是由
    doc/scripts/convert.py
    doc/html/
    源文件生成的 -- 不要手动编辑这些文件
  • 合并格式:每个
    .md
    文件包含多个通过
    ---
    分隔的条目。使用带
    -A
    上下文参数的Grep读取单个条目
  • 编码:源文件编码为Windows-1252;生成的输出文件编码为UTF-8
  • 版本:本文档专门针对Uniface 9.7版本。不要假设其他版本也具备对应功能