FileSystem.TAB Metoda
Definicja
Używany z funkcjami Print
lub PrintLine
do pozycjonowania danych wyjściowych.Used with the Print
or PrintLine
functions to position output.
Przeciążenia
TAB() |
Używany z funkcjami |
TAB(Int16) |
Używany z funkcjami |
TAB()
Używany z funkcjami Print
lub PrintLine
do pozycjonowania danych wyjściowych.Used with the Print
or PrintLine
functions to position output.
public:
static Microsoft::VisualBasic::TabInfo TAB();
public static Microsoft.VisualBasic.TabInfo TAB ();
static member TAB : unit -> Microsoft.VisualBasic.TabInfo
Public Function TAB () As TabInfo
Zwraca
Używany z funkcjami Print
lub PrintLine
do pozycjonowania danych wyjściowych.Used with the Print
or PrintLine
functions to position output.
Przykłady
W tym przykładzie funkcja TAB
służy do pozycjonowania danych wyjściowych w pliku i w oknie danych wyjściowych .This example uses the TAB
function to position output in a file and in the Output window.
FileOpen(1, "TESTFILE", OpenMode.Output) ' Open file for output.
' The second word prints at column 20.
Print(1, "Hello", TAB(20), "World.")
' If the argument is omitted, cursor is moved to the next print zone.
Print(1, "Hello", TAB(), "World")
FileClose(1)
Uwagi
Jeśli bieżąca pozycja drukowania w bieżącym wierszu jest większa niż Column
, TAB
przeskakuje do wartości kolumny równej Column
na następnej linii wyjściowej.If the current print position on the current line is larger than Column
, TAB
skips to the column value equal to Column
on the next output line. Jeśli Column
jest mniejsza niż 1, TAB
przenosi pozycję drukowania do kolumny 1.If Column
is less than 1, TAB
moves the print position to column 1. Jeśli wartość Column
jest większa niż szerokość linii wyjściowej, TAB
oblicza następną pozycję drukowania przy użyciu formuły:If Column
is larger than the output line width, TAB
calculates the next print position using the formula:
Szerokość w kolumnieColumn Mod width
Na przykład jeśli Szerokość to 80 i określisz TAB(90)
, następne drukowanie rozpocznie się w kolumnie 10 (reszta z 90/80).For example, if width is 80 and you specify TAB(90)
, the next print will start at column 10 (the remainder of 90/80). Jeśli wartość Column
jest mniejsza niż bieżąca pozycja drukowania, drukowanie rozpocznie się w następnym wierszu na obliczonej pozycji wydruku.If Column
is less than the current print position, printing starts on the next line at the calculated print position. Jeśli obliczona pozycja drukowania jest większa niż bieżąca pozycja drukowania, drukowanie rozpocznie się w obliczonej pozycji drukowania w tym samym wierszu.If the calculated print position is larger than the current print position, printing starts at the calculated print position on the same line.
Pozycja drukowania z lewej strony w wierszu danych wyjściowych jest zawsze 1.The leftmost print position on an output line is always 1. W przypadku używania funkcji Print
lub PrintLine
do drukowania do plików, pozycja drukowania z prawej na początku jest bieżącą szerokością pliku wyjściowego, który można ustawić za pomocą funkcji FileWidth
.When you use the Print
or PrintLine
functions to print to files, the rightmost print position is the current width of the output file, which you can set using the FileWidth
function.
Funkcja TAB
może być również używana z funkcją WriteLine
.The TAB
function can also be used with the WriteLine
function. Nie można go używać z Debug.WriteLine ani Console.WriteLine.It cannot be used with Debug.WriteLine or Console.WriteLine.
Uwaga
Upewnij się, że kolumny tabelaryczne są wystarczająco szerokie, aby zawierały szerokie litery.Make sure your tabular columns are wide enough to contain wide letters.
Zobacz też
TAB(Int16)
Używany z funkcjami Print
lub PrintLine
do pozycjonowania danych wyjściowych.Used with the Print
or PrintLine
functions to position output.
public:
static Microsoft::VisualBasic::TabInfo TAB(short Column);
public static Microsoft.VisualBasic.TabInfo TAB (short Column);
static member TAB : int16 -> Microsoft.VisualBasic.TabInfo
Public Function TAB (Column As Short) As TabInfo
Parametry
- Column
- Int16
Opcjonalny.Optional. Numer kolumny jest przenoszony do przed wyświetleniem lub wydrukowaniem następnego wyrażenia na liście.The column number moved to before displaying or printing the next expression in a list. W przypadku pominięcia TAB
przenosi punkt wstawiania do początku następnej strefy drukowania.If omitted, TAB
moves the insertion point to the start of the next print zone.
Zwraca
Używany z funkcjami Print
lub PrintLine
do pozycjonowania danych wyjściowych.Used with the Print
or PrintLine
functions to position output.
Przykłady
W tym przykładzie funkcja TAB
służy do pozycjonowania danych wyjściowych w pliku i w oknie danych wyjściowych .This example uses the TAB
function to position output in a file and in the Output window.
FileOpen(1, "TESTFILE", OpenMode.Output) ' Open file for output.
' The second word prints at column 20.
Print(1, "Hello", TAB(20), "World.")
' If the argument is omitted, cursor is moved to the next print zone.
Print(1, "Hello", TAB(), "World")
FileClose(1)
Uwagi
Jeśli bieżąca pozycja drukowania w bieżącym wierszu jest większa niż Column
, TAB
przeskakuje do wartości kolumny równej Column
na następnej linii wyjściowej.If the current print position on the current line is greater than Column
, TAB
skips to the column value equal to Column
on the next output line. Jeśli Column
jest mniejsza niż 1, TAB
przenosi pozycję drukowania do kolumny 1.If Column
is less than 1, TAB
moves the print position to column 1. Jeśli Column
jest większa niż szerokość linii wyjściowej, TAB
oblicza następną pozycję drukowania przy użyciu formuły:If Column
is greater than the output line width, TAB
calculates the next print position using the formula:
Szerokość w kolumnieColumn Mod width
Na przykład jeśli Szerokość to 80 i określisz TAB(90)
, następne drukowanie rozpocznie się w kolumnie 10 (reszta z 90/80).For example, if width is 80 and you specify TAB(90)
, the next print will start at column 10 (the remainder of 90/80). Jeśli wartość Column
jest mniejsza niż bieżąca pozycja drukowania, drukowanie rozpocznie się w następnym wierszu na obliczonej pozycji wydruku.If Column
is less than the current print position, printing starts on the next line at the calculated print position. Jeśli obliczona pozycja drukowania jest większa niż bieżąca pozycja drukowania, drukowanie rozpocznie się w obliczonej pozycji drukowania w tym samym wierszu.If the calculated print position is greater than the current print position, printing starts at the calculated print position on the same line.
Pozycja drukowania z lewej strony w wierszu danych wyjściowych jest zawsze 1.The leftmost print position on an output line is always 1. W przypadku używania funkcji Print
lub PrintLine
do drukowania do plików, pozycja drukowania z prawej na początku jest bieżącą szerokością pliku wyjściowego, który można ustawić za pomocą funkcji FileWidth
.When you use the Print
or PrintLine
functions to print to files, the rightmost print position is the current width of the output file, which you can set using the FileWidth
function.
Funkcja TAB
może być również używana z funkcją WriteLine
.The TAB
function can also be used with the WriteLine
function. Nie można go używać z Debug.WriteLine ani Console.WriteLine.It cannot be used with Debug.WriteLine or Console.WriteLine.
Uwaga
Upewnij się, że kolumny tabelaryczne są wystarczająco szerokie, aby zawierały szerokie litery.Make sure your tabular columns are wide enough to contain wide letters.