1

GW-BASIC 言語を使用しており、出力をページの中央に印刷する必要があります。現在、A4 サイズのページの左上から開始しています。プリンター設定を使用して余白を設定しようとしましたが、そのようなオプションはありません。

ページの中央に印刷するように設定する方法を誰か教えてもらえますか?

4

1 に答える 1

1

No way for me to be sure what the x and y need to be for your specific message on an A4 sized paper, but using the LOCATE statement to move the cursor would be the easiest way.

Likely take trial and error to get your message to be perfectly centered on your particular display.

Quick Google got me this : GW-BASIC User's Guide - LOCATE Statement

From the site:

Syntax:

LOCATE [row][,[col][,[cursor][,[start] [,stop]]]]

Comments:

row is the screen line number, a numeric expression within the range of 1 to 25.

col is the screen column number, a numeric expression within the range of 1 to 40, or 1 to 80, depending upon screen width.

cursor is a Boolean value indicating whether the cursor is visible; zero is off, nonzero is on.

start is the cursor start scan line, a numeric expression within the range of 0 to 31.

stop is the cursor stop scan line, a numeric expression within the range of 0 to 31.

Only the first two arguments are really necessary for a simple movement of the cursor, something like:

10 LOCATE 4,20
20 PRINT "YOUR TITLE HERE"

The above would move the cursor to the 4th row and 20th column then print "YOUR TITLE HERE".

于 2013-05-07T09:03:30.047 に答える