2

我今天尝试使用TextIo保存文件。只有3行:字符串填充和路线

Radio Station;MagicFM 
Test;This is jost for testing purpose. 
TV;TV_Brand 

所有不错,但后来我读它。

enter image description here

我不能对齐的事情。

也许是这样的:

Radio Station   - MagicFM 
Test     - This is jost for testing purpose. 
TV     - TV_Brand 

这是我在代码:

info(strFmt("%1 - %2", strLFix(conPeek(con, 1), 20),conpeek(con, 2))); 

我打了一下与strRFix和strLFix,但没有运气..有一个简单的方法来完成这一点?

回答

3

像这样对齐输出不是infolog的预期用途,正如Matej所说,原因是因为字体。但是,如果你是想用于显示目的的信息日志,你可能会想使用这样得到以下的输出:

static void Job114(Args _args) 
{ 
    container  c, cc; 
    int    i; 

    c = [["Radio Station", "MagicFM"], ["Test", "This is jost for testing purpose."], ["TV", "TV_Brand"]]; 
    setPrefix("Output"); // SetPrefix is necessary to get the tabbing to function correctly 
    for (i=1; i<=conLen(c); i++) 
    { 
     cc = conPeek(c, i); 
     info(strFmt("%1\t%2", conPeek(cc, 1), conPeek(cc, 2))); 
    } 
} 

Output

+0

感谢您的详细回复,我看到您也提到了字体就像Matej,但是..我在哪里改变它? –

+0

我不建议改变它,但它的形式为'\ Forms \ SysInfologBrowser' –

1

您必须使用Fixed width font,如Courier。您无法使用可变宽度字体进行视觉对齐。