1

私は顧客の姓、名を取得しようとしています-ドブ、すべてが同じ場所に印刷されていますが、何か考えはありますか?

         declare n_curs cursor for
              select unique pin,surname,given1,given2,dob from crcharge where
              chargenum in (select chargenum from crbookdd where book_no = rpt.book_no)
         order by surname,given1

            print ESC, "&l4E"

      foreach n_curs into t_pin, t_surname, t_given1, t_given2, t_dob
          if kick_new then
            print column 1, ESC, "&a0G", ESC, "&l3O", ESC, "&f4y3X",
                            ESC, "&l8D",ESC, "&l4E"
         end if
           let shtwrd_count = 0
        if shtwrd_count > 6 then
            let shtwrd[shtwrd_count] = t_shtwrd
            let shtwrd_count = shtwrd_count + 1
      Exit foreach
        end if
           print
           print  ESC,"&a6R", ESC, "&a3C",
                  upshift(t_surname) clipped, ",",
                  updown(t_given1) clipped," " ,
                  updown(t_given2) clipped,"-", t_dob clipped;

       end foreach
4

2 に答える 2

1

The semi-colon after the PRINT statement means 'suppress newline'. The next PRINT statement continues on the same line, therefore. Very useful when that's the effect you want; otherwise, not good.

Separately, as some advice, you should parameterize the escape sequences. If you don't, then life will become really difficult when you need to change printer or terminal type. Create functions which name the effect and return the correct string:

FUNCTION extra_bold()
    RETURN ESC, "&a6R"   -- Or whatever
END FUNCTION

Then use them:

PRINT extra_bold(), info.field
于 2012-09-14T14:09:24.280 に答える
1

エスケープ シーケンスが CR (キャリッジ リターン) の後の LF (ライン フィード) を抑制しているためです。

于 2012-09-14T04:54:48.347 に答える