0

我看过几个关于 Pascal 插入排序的问题。所以我想我会用数组字符串尝试一下。

文本值:

Advanced IF Syntax 
Advanced LOOP Syntax 
ALIGN 
BANNER / NOBANNER 
BLANK 
COLOR / COLOUR 
CONG_MEET_TIME 
DATE 
ENDPAGE 
EOL 
FIELD 
FONT 
HIGHLIGHT / NOHIGHLIGHT 
IF 
IMAGE 
INCLUDE 
LINESPACING 
LOOKUP_FIELD 
LOOP 
LOOP AS 
LOOP SQL 
PARAGRAPH / TEXT 
REQUIRES 
Script Command Syntax 
SEPARATOR 
TAB 
TAB SET 
TALK_THEME 

这是代码:

Procedure InsertionSort(aTopics : Array of String; size : Integer);
Var
    i, j : Integer;
    caption, topic_id : String;

Begin
    For i := 2 to size-1 do
    Begin
        topic_id := aTopics[i];
        caption := HndTopics.GetTopicCaption(aTopics[i]);

        j := i;
        While ((j > 1) AND (CompareText(HndTopics.GetTopicCaption(aTopics[j-1]), caption) > 0)) do
        Begin
            aTopics[j] := aTopics[j-1];
            j := j - 1;
        End;
        aTopics[j] := topic_id;
    End;
End;

除了一个例外,它似乎 99% 正确。转到帮助文档并单击索引选项卡。单击自定义脚本命令语法项,将显示一个弹出窗口:

弹出窗口

为什么第一项是TALK_THEME?那应该在列表的末尾,而不是开头。

4

0 回答 0