[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 文字列処理


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.1 copyright

copyright()

:: Risa/Asir の copyright 表示を文字列として戻す.

return

文字列

[1150] copyright();
This is Risa/Asir, Version 20040312 (Kobe Distribution).
Copyright (C) 1994-2000, all rights reserved, FUJITSU LABORATORIES LIMITED.
Copyright 2000-2003, Risa/Asir committers, http://www.openxm.org/.
GC 6.2(alpha6) copyright 1988-2003, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.
PARI 2.0.17, copyright 1989-1999, C. Batut, K. Belabas, D. Bernardi,
   H. Cohen and M. Olivier.

ChangeLog


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.2 string_to_tb, tb_to_string, write_to_tb

string_to_tb(s)
tb_to_string(tb)
write_to_tb(s,tb)

:: 文字列可変長配列型(text buffer)のデータの処理

return

文字列可変長配列型(string_to_tb), 文字列型(tb_to_string)

s

文字列

tb

文字列可変長配列型

[219] T=string_to_tb("");

[220] write_to_tb("Hello",T);
0
[221] write_to_tb(" world!",T);
0
[222] tb_to_string(T);
Hello world!

ChangeLog


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.3 set_print_function

set_print_function([fname])

:: 画面表示用の関数を登録

return

整数

fname

文字列

[219] def my_output(F) {
           print("Out: ",0); print(rtostr(F));
      }
[220] set_print_function("my_output");
Out: 0
[221]  1+2;
Out: 3
参照

@ref{rtostr}

ChangeLog


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.4 printf, fprintf, sprintf

printf(format[,args])
fprintf(fd,format[,args])
sprintf(format[,args])

:: C に似たプリント関数

return

整数(printf,fprintf), 文字列(sprintf)

format

文字列

fd

非負整数(ファイル記述子)

args

オブジェクト

[0] printf("%a: rat = %a\n",10,x^2-1)$
10: rat = x^2-1
[1] S=sprintf("%a: rat = %a",20,x^2-1)$
[2] S;
20: rat = x^2-1
[3] Fd=open_file("hoge.txt","w");
0
[4] fprintf(Fd,"Poly=%a\n",(x-1)^3)$
[5] close_file(Fd)$
[6] quit;

$ cat hoge.txt
Poly=x^3-3*x^2+3*x-1
参照

@ref{rtostr},@ref{open_file},@ref{close_file}

ChangeLog


[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on October 21, 2017 using texi2html 5.0.