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 ... 22
16
Programming / Re: [Classic REXX] Network Map
« on: March 27, 2025, 06:13:36 am »
SAY '>'STG'<'
is there to say it sent that as a Wake on Lan call to that machine.
But since the mac address isn't there it can't create a proper call to wake it up.

17
Programming / Re: [Classic REXX] Network Map
« on: March 26, 2025, 07:04:44 pm »
I would say that that explain the problems.
*** Can't find server name for address 192.168.0.1: Non-existent host/domain
then no script can help until it's configured to reply with something useful.

Hi!

What is the name returned from a nslookup 192.168.0.106 ?
Is it the one under nostname from config.sys ?

Today, my machines address is 192.168.0.104,
Code: [Select]
H:\tmp>nslookup 192.168.0.104
*** Can't find server name for address 192.168.0.1: Non-existent host/domain
*** Default servers are not available

config.sys has,
Code: [Select]
SET HOSTNAME=ARCAOS-44454C4

18
Programming / Re: [Classic REXX] Network Map
« on: March 26, 2025, 07:01:00 pm »
Seen.

I have a specific ARCAOS host_name under config.sys
Into my box and because my PC can be booted OS/2 or Windows using same interface, I have set a name to the corresponding @ip / macaddr
Using nslookup on my PC @ip I could see that my computer_name set into the box differs from the config.sys and after updating config.sys, it works

With WOL=0 and NET=0, it display all local equipments.
When I set WOL=1, I have all equipment but also many
(icoplte    (icoplte    (icoplte    (icoplte    (icoplte    (icoplte ....

Remy, I've only been able to test with English version, is it possible that the parsing has to be adjusted somewhat?

With NET=1, I have the folder created as well all found equipment but none have an icon !
Where are icon found ?
That also mean that I need help to create the artwork for it.  ;)
But see the icons I use here.
I would suggest a change into the rexx which could prevent this kind of no returned result.
Check the interface used and look for its @ip followed by a nslookup on the @ip which will return the hostname and then run into the process like if the
the host_name was found into os2env variables....
That's something to fall back on, as several of you seem to not be able to get "host" to return proper info

19
Programming / Re: [Classic REXX] Network Map
« on: March 25, 2025, 06:33:46 am »
It is supposed to find all machines on the network, and here it does!

My hosts file on this newlt installed ArcaOS 5.0.7, read
127.0.0.1                localhost
and nothing else.
My router thus provide my machines with the information and ip-number through dhcp as the vacuum cleaner was introduced just days ago... and when the script run again it update the info (and icons, if SET NET=1 is active) and show that 2 devices has gone offline over the night.

So the question remain... why host command behave the way it does.

"DHCP Monitor" of course list the ip-address on LAN0 for you?
( Desktop\Computer\System Setup\Network\TCP/IP\DHCP Monitor )

20
Programming / Re: [Classic REXX] Network Map
« on: March 24, 2025, 10:45:00 pm »
If the host command in TCP/IP say it is unknown, then one can't do much about it in the script.
 
Anyone know why host can't retrieve it?
Is it some security setting in the router, a missing setting or ...?

21
Programming / Re: [Classic REXX] Network Map
« on: March 24, 2025, 07:16:52 pm »
Neil: Interesting, and you get anything else if you run the OS/2 commands (HOST, NETSTAT, PING and ARP) by hand?
Or should the script be adjusted to use some other parameter with the above commands?

The script determine the IP-number from the machine that run the script.
Dave: Can it be something like 192.168.0.101 for your machine?

The script PARSE away the last part and then PING 192.168.0.1 to 192.168.0.255 and follow that by listing each with ARP
Could you please add
Code: [Select]
call trace '?i'before the first line that begin with '@HOST and step through the code and tell us?

Some of the PARSE lines may very well need tweaking depending on wrong assumptions made

22
Programming / Re: [Classic REXX] Network Map
« on: March 23, 2025, 08:46:43 am »
I've added a line to the script to open the folder as it refresh the devices.

23
Hello,

Here's a script I've just completed to download and install information about REXX.
You have 10 titles to choose from and enjoy.

Beware that the script has not been tested that much and may cause problems, especially when sites such as hobbesarchive.com complain or is down.
I leave testing and extending the script to you, to enhance it further.


 REXX tutorials under ArcaOS out-of-the-box
 ==========================================
 1. REXX for the absolute beginner: Installed
 2. Rexx Reference Summary Handbook: Installed
 3. REXX Tips & Tricks v3.60: Installed
 4. Learning REXX Programming in 56,479 Steps: Installed
 5. OS/2 REXX. From Bark to Byte: Installed
 6. REXX Programmers Reference 2nd Edition: Installed
 7. REXX Tutorial: Installed
 8. A Practical Approach to Programming: Installed
 9. OS/2 2.1 Rexx Handbook (Warning! 321MB): Installed
10. Extending the Workplace Shell with Object Rexx: Installed

 Install <A>ll or 1, 2 ... ( ? for additional Info, 0 to Exit ):


Regards,
//Jan-Erik

24
Programming / [Classic REXX] Network Map
« on: March 16, 2025, 04:16:38 pm »
I'm trying to write a REXX script to list the devices available on my home LAN.

It use commands available in the OS to get the host name, ip-number and mac address.

Here I can see on the names that it has found computers, mobile phones, vacuum cleaner, routers etc. on the same subnet and indicate if they're offline or not.
I'd also like to, if possible, find out what kind of device the script has listed and set icons accordingly, and not just online/offline. How?!

That also mean that I need help to create the artwork for it.  ;)

The script in default mode without parameters determine the ip-address of the computer, ping and check for others 1 to 255.
With environment variable SET WOL=1 it also send a "wake on lan call" to each machine.
With environment variable SET NET=1 it also create a folder Network Map* in the folder Network, with a sub folder for workgroup* or domain* and individual objects (online*/offline*) for each device. If one click on a device it will refresh (run the script and update the object itself).

25
First of all we need a function that can check if an executable can run or if the library/file exist or not.

Since we don't have a list of the files nor their types yet, our function can only be prepared to:
  • Support obvious file types such as .exe, .hlp/.inf, .pdf and .cmd
  • Take one parameter by default, the file to check and return 0 if all is well or another number depending on the problem.
  • Be extendable and allow for more files types and at least one more parameter or stem/array later.

Try to write a function and post it here, that can test if for example wget.exe (without path*) is present or not on the system.
Hints:
  • rc = 1041 not available
  • rc <> 0 missing support libraries
  • other problem and rc = 0 ok

*The function should try determine the path if needed, but not provided, with for example SysSearchPath(...).

26
It is the start to look at that is a good starting point, with a need for more, so let's keep this thread alive.

So what do we need/want?

Should we aim to support a specific version of OS/2 and newer? ¹)
A list of handbooks related to REXX. The list that Dariusz Piatkowski showed should be a good starting point, where can the files be downloaded from?
There should also be a dedicated section about "Object REXX" ²) and "ooRexx" ²).
PDF and/or INF/HLP format?

What would you like to see/need? Dan and Lewis
Is it a broader discussion about what REXX can do and how, a list of functions one can copy/paste into own projects, or...?

____
¹) Various libraries has been introduced and removed in versions of eComStation and ArcaOS. The proper way would be to assume that there is only Classic REXX in Warp 4 installed with the limitations and bugs found there and provide functions that check and test the system and then work from there. It may require rather large functions to be complete, but may be what we should aim for?
Example 1: To get the boot drive of the system currently in use one can call the function SysBootDrive, but it is only available with later versions of RexxUtil, so to write scripts that work with any version of the OS, one has to expand it somewhat (see code).
Example 2: The useful rexx library to unpack files "unzip32.dll" may (not) be available, but unzip.exe of various versions may (not) also be available, and/or unpack200.exe with OpenJDK. A wrapper function to unzip should be written to use whatever is available as we can't assume a baseline.

²) With Object REXX and ooRexx one can create a reusable "text library" to reference (compare to "include" in C/C++) with methods that can explore all possebilities and provide a unified way to unpack archives.

Code: [Select]
/* Purpose: Get information about the drive where the OS has been installed to */
/* Somewhat extended (and renamed) version of the one found in Rexx Tips & Tricks v3.60 */
/* Note the use of OS2ENVIRONMENT instead of just ENVIRONMENT as one can't assume a certain baseline version without forcing that one on others */
RxBootDrive: PROCEDURE EXPOSE (exposeList)

/* install a local error handler                  */
  SIGNAL ON SYNTAX NAME BootDrive

  boot_drive = ''
  boot_drive = SysBootDrive()

BootDrive:
/* boot_drive is still empty if SysBootDrive() failed */
/* SysBootDrive() is only available in the newer versions of REXXUTIL! */
    IF boot_drive = '' THEN
    DO
        /* Do further tests to ensure that the result of this method is correct! */
        PARSE UPPER VALUE VALUE( "PATH",, prog.__env ) WITH "\OS2\SYSTEM" -2 boot_drive +2
        boot_drive = STRIP( boot_drive )
        os_dir = STRIP( LEFT( VALUE( 'OSDIR',, 'OS2ENVIRONMENT' ), 2 ) )
        sys_cmd = STRIP( LEFT( VALUE( 'COMSPEC',, 'OS2ENVIRONMENT' ), 2 ) )
        IF LENGTH( os_dir ) = 2 & LENGTH( sys_cmd ) = 2 THEN
            IF os_dir = sys_cmd THEN RETURN os_dir
        IF LENGTH( os_dir ) = 2 THEN
            IF boot_drive = os_dir THEN RETURN boot_drive
        IF LENGTH( sys_cmd ) = 2 THEN
            IF boot_drive = sys_cmd THEN RETURN boot_drive
    END
RETURN boot_drive

27
List info related to programming in REXX
TitleType (Help/Tutorial/Reference/Guide/Examples/...)LocationFormat (pdf/inf/html/...)License (free/gpl 3/restricted/commercial/...)Interpreter (CRexx/ORexx/ooRexx/ARexx/BRexx/Regina/Roo)

28
Hi Dan,
you're quite right.

We need to discuss and make plans from 'Hello world' and beyond, bridging the gap from an intro to writing something useful.
How about a combination of scripts to choose what to retrieve and install of help, reference, guides, editors etc.

Introductions that hold the hand all the way is key and what I would say help one over the initial hurdles how to get used to what can be done.

Rexx is great as "glue" to explore and control various tools, techniques and system resources.
Code: [Select]
/* Retrieve help/tutorial/guide/intro to REXX */
'@yum -y install wget' /* ensure wget is available so we can retrieve/tools/packages/... from the web */
The above code would use the external tool and run yum. @ ensure that the command yum -y install wget doesn't appear on screen, while the output from the command do.

Or should all come as wpi or rpm packages? A problem is the hosting and location after a few years.

A first version could list the various titles, file format and internet location (url)?
Let the user choose and then do some magic, add short cuts as suggested etc.

Next list text editors and their benefits in writing rexx code

Why not guide the user through the code that do all of that as well.
How to read, interpret and follow the execution, 'dry execution', as learning from existing code should be easier.
Perhaps donate a number of functions that can be reused, instead of asking everyone to reinvent the wheel over and over again

I have a recursive function I call RxMkDir that is quite useful. One specify the path and it create it all levels down if it doesn't exist, and/or jump to it.

Someone else have a function that create shortcuts on the desktop from a stem/array, etc.

29
Ohh, nice output like a container tree view!

   IF dir < dir.0 THEN leader = D2C(195)
                  ELSE leader = D2C(192)
can be shortened to
Code: [Select]
leader = D2C( 192 + 3 * ( dir < dir.0 ) )

30
/**/
parse arg where
call lineout where,'     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5'
do i=1 to 15
  call charout where,' '||right(i*16,3,' ')
  do j=0 to 15
    call charout where,' '||d2c(i*16+j)
  end
  call lineout where,' '||right(16*i+15,3,' ')
 end
call lineout where,'     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5'
call lineout where
exit


It is often just a matter of personal taste and preference, so the code to output that can be written in many ways and they'll serve well, thus cause frustration and confusion for beginners that want one and only one solution to cling to.

But here goes, assuming that the code has been saved to "charcode.cmd":
parse arg where and every occurance of where can be omitted in this case, as one can type "charcode > c850.txt" to save it to file c850.txt

How about a loop for:
call lineout ,'     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5'
such as:
do i = 0 to 15 /* loop 16 times, start at 0 and end at 15 */
  call charout , right( i, 2 + 4 * ( i = 0 ) , ' ' ) /* output a number, with 1 space in front and 4 more if loop number is zero*/
End
SAY /* This "say" without anything else just add a new line character */


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