colobot-data/help/P/cbot/readln.txt.bak

21 lines
823 B
Plaintext

\b;Instrukcja \c;readln\n;
Wczytuje jednš linię z otwartego pliku w folderze files/. Jest to metoda klasy \c;\l;file\u cbot\file;\n;, dlatego też zawsze należy używać konstrukcji \c;handle.readln()\n;Ś:
\c;
\s; s = handle.readln();
\n;
Plik musi być otwarty do odczytu (\c;"r"\n;) przy użyciu instrukcji \c;\l;open\u cbot\open;\n;. Metoda \c;readln\n; zwraca cały wiersz ale bez znaków końca linii 0x0D (CR) i 0x0A (LF)
SkładniaŚ:
\s;\c;string = handle.readln ( );\n;
PrzykładŚ:
\c;
\s; string s;
\s; s = handle.readln();
\s; if ( s == "abc" )
\s; ...
\n;
\t;Zobacz również
\c;\l;file\u cbot\file;\n;, \c;\l;open\u cbot\open;\n;, \c;\l;close\u cbot\close;\n;, \c;\l;writeln\u cbot\writeln;\n; i \c;\l;eof\u cbot\eof;\n;.
\l;Programowanie\u cbot;, \l;typy\u cbot\type; i \l;kategorie\u cbot\category;.