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 4 ... 23
16
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.

17
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 ...

18
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!

19
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.

20
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

21
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?

22
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'

23
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?

24
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.

25
Programming / [Classic Rexx] Set Long File Name
« on: April 18, 2025, 07:50:14 pm »
You may have noticed that Seamonkey, Firefox or Thunderbird or another application all of a sudden (after a restart) has lost all or many settings/profiles etc.
This is not limited to those applications, but as they're a central part of what one use, more likely that you've also have seen.
Files downloaded from the internet these days usually have these long names and software ported from other systems create files with long file names, both for settings and other output.
The problem is that the file system sometimes loose the info about the long file name and revert to a short form with the length 8.3

To improve the chanse to recover files, one can set the .LONGNAME EA (Extended Attribute).
Ported software are unaware of the concept of EA, even "native" software doesn't write .LONGNAME EA to files, thus it is very strange to think that every application has to write .LONGNAME EA to files. It would be more appropiate if the IFS driver would handle something as that...

but JRescuer contain a litte script (setln.cmd) that set .LONGNAME of each file, so that one can recover and set the proper file name.

setln.cmd contain a function that call itself repeatedly (recursively) to go through files and set the .LONGNAME EA.
What the script lack, is the ability to set the file name nor output information about the process.

A rewrite would be interesting to explore that address the issue, as and update to the file system (JFS) and deeper understanding and acceptance to add the feature to the ifs driver is far away.

1. Change the recursive calls
2. Show output of what the script do
3. Rename files that has lost the name

26
Would he agree to that someone sign a NDA (Non Disclosure Agreement)
and either let that person remove the code or himself if we'd scramble money to do it?

At a later stage it would be interesting if Gpf Rexx could work with ooRexx 5.x

27
Applications / Re: DBExpert
« on: April 18, 2025, 11:58:38 am »
Also note that the form has to be tied to a database table.
It seem as if it only try to read the file if it also has initialized a record.

28
Applications / Re: DBExpert
« on: April 18, 2025, 10:25:31 am »
Save the form as a report and open the report.
Do you see the picture there?

I suspect that you only see a white background as it is?
And no change if you use =dbeLoadPicture('c:\path\2\picturefile.bmp') either?

29
Applications / Re: DBExpert
« on: April 16, 2025, 07:01:06 pm »
To create a bitmap control that displays a picture from a disk file:  

1.Click the bitmap control tool [tree and house] in the control tool box   

2.Click on the form where you want the top left corner of the bitmap to appear   

3.Set the Source attribute to =LoadPicture(`filename') where filename is the name of the file the picture is in. For example, =LoadPicture( `os2.bmp' )
____
Skip to 3. to adjust existing bitmap control and specify the path to the bitmap.
I think you may need to specify the full path or no path, but try if you can use relative path with "..\" for parent folder, something like ..\..\other\WHOOPI.BMP for parents-parent-folder-containing-folder-other-with-bitmap

30
Programming / Re: [Classic REXX] Network Map
« on: April 01, 2025, 09:18:32 pm »
Hi Jan-Erik
Sorry having added a lof of codes  ::)

Ohh, yes, I soooOOooo crossed (NOT!) that you've improved the script further than one could hope for.

I''m actually very pleased that you've come up with all of these enhancements, but don't tell anyone I wrote that.  ;)

Pages: 1 [2] 3 4 ... 23