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

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

3
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

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

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

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

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

8
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

9
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

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

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

12
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

13
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.  ;)

14
Programming / Re: [Classic REXX] Network Map
« on: March 28, 2025, 08:52:27 pm »
Great update of the script Remy!  8)

It now tell me that the vacuum cleaner has gone offline for the night, but it managed to pull out the cable of the laptop today and ensured it went offline as well.

I comment the 2 initial SET line into de macaddr.cmd and use those from config.sys
uncomment bof lines if you would like set these two vars without config.sys update
e.g.  remove /* and */ of both lines and set value to 1 or 0
/* 'SET WOL=1' */   
/* 'SET NET=1' */

Just type
SET WOL=1
SET NET=1
on the command line before you run the script and those will be added to each object it create, thus not require any of them in config.sys

or create a program object "Refresh" pointing to the script, without any parameter, but with
WOL=1
NET=1
in the Environment tab (See each created network object for examples).


How about merging/reuse code for the various calls that resemble each other, and control them with parameters?
Perhaps explore the use of parsing templates:
PARSE VALUE ... WITH pre (fixed_variable1) mid (fixed_variable2) post

The idea was initially to build a network map of the devices found on the home LAN with info about them.
What uses can we explore here?
Shares would be one thing, but ... are there something else that one want and can be created?!

15
Programming / Re: [Classic REXX] Network Map
« on: March 27, 2025, 09:17:15 pm »
Feel free to modify the code and post it here, both for testing purposes and to improve it.

Pages: [1] 2 3 ... 22