Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jan-Erik Lärka

Pages: [1] 2 3 ... 22
1
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)?

2
There's a text file mentioning how to call functions, but most people new to something as this need help to grasp how and why to knit this function together with that to achieve the desired result.

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.

Example 2: Pipe in, pipe out. What "end" of the pipe do one define? I want to output data as text instructions/parameters to one end of the pipe to be sent through the pipe into the application as instructions/parameters just as input by keyboard. It should not block the application that run.

Could you enlighten me how to do such things with RXUTILEX?

How to send commands to sqlite3.exe

:D

3
Programming / [Classic Rexx] How can one pipe data to application?
« on: June 10, 2025, 09:15:44 pm »
I have an urgent need to understand how to redirect instructions to a VIO/CLI application (or several) that take commands via stdin and output data to stdout. Depending on the input it exit or require more input.

I've looked at a code sample for ePDF (Print2PS) but it is designed for the oposite situation, and examples for rxu, C/C++ on OS/2 or whatever appear to be unavailable.

Yes, one can write instructions to a file and run it with something like
Code: [Select]
app.exe < "file.txt"|RXQUEUEbut then one must know the reply in advance or ensure to exit (even though one would like to continue in that session).
I use that approach now, but it is ugly, slow etc.

What I need can be described as redirection of stdin and stdout through the use of a (possibly named) pipe.

4
Games / Re: Please test - OpenTTD v12.1
« on: June 01, 2025, 12:09:24 am »
Yes, there no output visible or hidden as i run it on the command line.
with or without redirecting stderr with 2>&1 and/or to a text file.

Ordinary applications woulld complain about missing .dlls and configuration files etc. but this one doesn't even show usage.

So if I add -h it output text on the console... OpenTTD 12.2 ... Seem as if it find the files downloaded and list those, but trying random parameters doesn't start anything. It just finish right away.

The version v1.4 from 2014 start up without parameters and offer to download stuff (before it freeze).

5
Games / Re: Please test - OpenTTD v12.1
« on: May 31, 2025, 01:17:41 pm »
I'm trying to run OpenTTD (the SDL v1.2 version can still be downloaded) but here it just ... finish without anything apparent on screen almost right away. No errors seen and nothing else that tell me what's going on.

I've placed the three .tar files in a sub folder \baseset relative to openttd.exe

6
Programming / Re: [Classic Rexx] Translation database
« on: May 26, 2025, 10:27:35 pm »
Time is up!
Here's the update that add Numerals.
This now also show the word for to_language for prefix, suffix, language and numerals.
The view PHRASE_VW has been adjusted to allow that.

What files should one take on next?
Hmmm, lip packages while we're at it?

7
Programming / Re: [Classic Rexx] Translation database
« on: May 26, 2025, 12:44:19 pm »
You need two files if you want to add text from .msg and .ini files, one with the source language and another built the same way but with text for the destination language.
The script handle missing translations, but may require a watchful eye afterward.

Please do provide an url (and possibly code) or two, for other translation services than google one could use (as backup) as well.
See the script for one code example as of now.

It would also be very convenient if one could add support for more file formats... perhaps system specific files?!
OS/2 system files often need to be disassembled before one can extract the useful stuff.

Do explore and present command line resource (de)compilers along with other tools and scripts to extract text.

The translation team have the knowledge and it would be most useful if they'd share it and we could include such info into a tool so not everyone need to be a rocket scientist, on top of everything else, but can focus on writing good translations.

8
Programming / [Classic Rexx] Translation database
« on: May 25, 2025, 10:50:24 pm »
I've created a script to assemble words and phrases into a database (sqlite3) that can be viewes with DB Browser for SQLite (A huge Thank you TeLLie! for porting it!).

One just need to type
Code: [Select]
set mode=INITand then
Code: [Select]
T2NLV
It use wget to download a dictionary from wikdict (default english to the language your system run as) so it not aimed at those that use en_US or en_UK or similar.

It then build a database and feed the data to it.

The script can also handle translations by Goran Ivankovic such as .DCT and .INI but also .MSG files.
I've included (though renamed .DCT files provided in Gorans translation tool for reference).

Code: [Select]
set mode=IMPORTand then
Code: [Select]
T2NLV en-sv.DCT(change "sv" for your language if available)

Do not try to feed it the file "Words.txt" unless you're ready to let it spend (a lot of) time fetching translations from google.

I would appreciate your help to improve the script and database!

How about a translation tool to go with it to manage all the translation it should be able to swallow.
For those interested may want to poke on it and look att the table "CLASSIFICATION" as well.

Type
Code: [Select]
Set fromlang=frto set the source language by hand
or
Code: [Select]
Set tolang=nlto set destination language by hand.

Test and create a function on the side in another script that output numerals, so such words in the database can be classified.
That code has to be added, but the db contain them already.
rxNumerals: PROCEDURE EXPOSE this.
IF ARG(1) = 0 THEN
   RETURN 'zero'
IF ARG(1) < 20 THEN
   RETURN WORD( 'one two three four ...

9
Storage / Re: How to discover the newly assigned USB drive letter?
« on: May 15, 2025, 10:04:40 pm »
No need to get fancy here...

SysDriveMap() before calling LVM.
SysDriveMap() after calling LVM.
What changed?

something like:

Code: [Select]
/* Comment */
...
before = SysDriveMap()
'@LVM.EXE /RediscoverPRM'
after = SysDriveMap()
DO i = 1 TO WORDS( after )
  IF 0 = POS( SUBWORD( after, i, 1 ), before )  THEN
    SAY SUBWORD( after, i, 1 ) "must be the drive we're looking for!"
END

Nice!

10
Programming / [Classic Rexx] check disk of external drives
« on: May 14, 2025, 08:53:43 pm »
I've got 3 external USB drives of 1 - 2 TB each attached to this computer, that one need run chkdsk on, after each other to avoid stalls.

I've created a shadow to the following script in the startup folder and disabled automatic chkdisk in the widget of xwp as it otherwise run them i parallell.

This script determine drives with the function SysDriveMap(, 'LOCAL' ) and use a combinationen of SysDriveInfo and SysFileSystemType to determine if each drive is valid, yet not available and in need of chkdsk to run.

It could of course output the type of file system it detect in need of chkdsk, but I've omitted it since chkdsk itself output that during execution.

11
Storage / Re: How to discover the newly assigned USB drive letter?
« on: May 14, 2025, 08:37:31 pm »
One of the new functions in the REXXUTIL.DLL from Object-Oriented REXX may also help you:

SysFileSystemType
get the name of the file system for a drive

Example

  cfs = SysFileSystemType('C:')
  efs = SysFileSystemType('E:')
  SAY 'The file system on drive C: is' cfs
  SAY 'The file system on drive E: is' efs

The following is a sample of output from this example:

  The file system on drive C: is HPFS
  The file system on drive E: is JFS

12
Programming / Re: [Classic Rexx] Set Long File Name
« on: April 23, 2025, 09:31:16 pm »
Someone may try to experiment with SysMoveObject and tell the rest of us if it is possible to use?

13
Applications / Re: DBExpert
« on: April 23, 2025, 05:54:14 pm »
You're welcome! :)

Hard code the path or use rexx.

In the current folder:
SAY DIRECTORY()||'\myimage.bmp'

parent folder ( note the omitted \ ):
SAY FILESPEC( 'Drive', DIRECTORY() )||FILESPEC( 'Path', DIRECTORY() )||'myimage.bmp'

parents parent folder ( must strip the trailing \ ):
SAY FILESPEC( 'Drive', DIRECTORY() )||FILESPEC( 'Path', STRIP( FILESPEC( 'Path', DIRECTORY() ), 'Trailing', '\' ) )||'myimage.bmp'

another folder relative parents parent folder ( must strip the trailing \ ):
SAY FILESPEC( 'Drive', DIRECTORY() )||FILESPEC( 'Path', STRIP( FILESPEC( 'Path', DIRECTORY() ), 'Trailing', '\' ) )||'otherfolder\myimage.bmp'

14
Programming / Re: [Classic Rexx] Set Long File Name
« on: April 19, 2025, 08:41:12 am »
I you copy files to external drives like I do it is important to set the EA for each file either before you copy each file or first thing.

Just bought my latest one the other day and started to copy files to it.
Files without EA attached to them are destined to get short names, possibly loosing all hope to recover the real name, causing all sorts of annoyances as the visible name and the real name behind doesn't match. Most may not notice, as you haven't given it a thought, but once you look at it closer... grrrr.

This script set .LONGNAME info and use it to rename each file name to the visible one, by adjusting the TITLE or if that doesn't work use the command rename. (comment out the "IF rc = 0 THEN" to allow it to actually rename the file)

Note the important yet subtle information about TITLE (in Rexx Tips & Tricks v3.60 for example).
Is there a way to get rid of the rename command?

15
Programming / Re: [Classic Rexx] Set Long File Name
« on: April 18, 2025, 08:05:35 pm »
Warning!

This script may cause harm to your computer!
DO NOT USE UNLESS FULLY AWARE OF THE DANGER!

The attached script was inspired by setln.cmd, but also extended to handle "more" of the problems we face with our OS when we download files with national characters.

Those brave that may want try it should perhaps trace it line by line to see what it does to begin with.

Feel free to improve!

rename nls.zip to nls.ext
An important part of the script is the function that use unzip32.dll or unzip.exe to unpack the file nls.ext (that is a plain .zip-file)
nls.ext contain information about the characters valid in various languages.

Pages: [1] 2 3 ... 22