OS/2, eCS & ArcaOS - Technical > Programming
[Classic Rexx] How can one pipe data to application?
Dave Yeo:
--- Quote from: Jan-Erik Lärka on June 11, 2025, 12:44:48 pm ---Example 1: "SysFileTree" was unthinkable to me to use to find or search for files when I begun to try Rexx, the function should have been named SysSearchPath, SysFindFile or something along those lines, not "...Tree", totally bonkers name.
--- End quote ---
When sub-directories were first introduced, they were often described as a tree. The root (directory), branches or stems (sub-directories) and leaves (files). There were even commands such as deltree to delete multiple sub-directories in a branch.
Remy:
--- Quote from: Jan-Erik Lärka on June 11, 2025, 04:49:36 pm ---ok, this pipe info out of the application into the script (WIN),
how do one send instructions out from the script (WIO) into the application (applications stdin)?
--- End quote ---
Use the pipe as input mode too
may be specifying dual mode (I didn't have time to give it a try)+ something like <\pipe\nnnnnnn before the >\pipe\nnnnnnn and instcnt to 2!
Use the write function from rxutilex to write into the pipe
The application should support using pipe input and output.
sqlite3 seems to use special syntax
Dave Yeo:
What about binary vs text? Often in C have to purposely set the pipe to binary, though for sending sending commands to a program it shouldn't matter.
Jan-Erik Lärka:
--- Quote from: Remy on June 11, 2025, 06:36:59 pm ---sqlite3 seems to use special syntax
--- End quote ---
Yes, it is somewhat special, but also useful once one find out that the character ; (semicolon) is important.
In the below example one load the database (en2sv.db3) at start by specifying the name as parameter to sqlite3
Then one can input a command that begin with a . (dot) or SQL query.
The enter key just add a new line, while ; & Enter instruct sqlite3 to process what has been entered on the lines above since previous instruction.
--- Code: ---OS/2 Command Interpreter version 4.5
[D:\PROGRAMS\DRDIALOG\WRD2NLV]sqlite3 en2sv.db3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite> SELECT
...> *
...> FROM
...> CLASSIFICATION
...> LIMIT 3;
1||Substantiv|152
2||Adjektiv|152
3||Räkneord|152
sqlite>
--- End code ---
National characters such as ä above appear as UTF-8 characters and not as ä in codepage 850.
The SELECT could have been entered on one line as well, but this illustrate that it is possible to build complex queries over severeal lines.
Read more on https://sqlite.org/index.html and for the vio/cli command line tool https://sqlite.org/cli.html while the gui tool ported by TeLLie provide a more friendly user experience.
Navigation
[0] Message Index
[*] Previous page
Go to full version