16 February 2018, 15:09 | #81 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
DOpusM2_ARexx.guide should be the newest? and is at least in http://aminet.net/package/util/dopus/Dopus5_91_os3
"lister refresh" is what are you looking for. DOpus 4 should do automatic refresh. http://aminet.net/package/util/wb/CopyIcon44 (if I'm not wrong PeterK did a version of it too) maybe help you with copy icons. |
19 February 2018, 20:21 | #82 |
Registered User
Join Date: Jan 2018
Location: Utrecht, NL
Posts: 15
|
Thanks! Yes I found some icon copy tools too, there's one in MagicWB. And I might use that eventually, but for now I have set myself a challenge to write a working arexx script for DOpus. Just for fun.
|
20 February 2018, 10:29 | #83 | |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,404
|
The DOpus 4 manual appears to have documentation on all the ARexx commands. If you don't have it in your install, it's available from Sourceforge here.
Apparently, the Rescan command should re-read the the specified window, so that might be worth checking out: Quote:
|
|
02 June 2021, 16:27 | #84 |
Registered User
Join Date: Aug 2019
Location: Germany
Posts: 19
|
Hello how can I check if a file exists and if it does it is aborted if not the script continues
IF Exists("c:ed") THEN say "break" Else Exit say "ok install" this does not work |
02 June 2021, 21:07 | #85 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
Code:
IF Exists("c:ed") THEN DO say "break" EXIT END |
03 June 2021, 18:01 | #86 |
Registered User
Join Date: Aug 2019
Location: Germany
Posts: 19
|
thank you
|
12 September 2023, 14:28 | #87 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Is it possible with ARexx to create something like an Array of string, like ["Abc", "Def", ...] and then iterate trough it in a loop?
|
12 September 2023, 17:55 | #88 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
If you search this thread for "array" you get an example how to create an array. Something like this (very simple example):
Code:
str = 'Abc Def' DO i = 1 TO WORDS(str) var.i = WORD(str, i) END DO i = 1 TO WORDS(str) SAY var.i END |
13 September 2023, 09:18 | #89 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Thank you, that is what I was looking for:-)
|
13 September 2023, 10:23 | #90 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,041
|
You should not call a function which always returns the same value in a loop. This only creates a lot of unnecessary overhead. Rather call the function once before the loop and store the returned value in a variable.
By convention you usually put the number of elements into the .0 entry of the stem. So this would be better: Code:
str = 'Abc Def' n = WORDS(str) DO i = 1 TO n var.i = WORD(str, i) END var.0 = n DO i = 1 TO var.0 SAY var.i END |
17 September 2023, 13:35 | #91 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
I stumbled across another question today.
I've created a function that creates a stem variable (entry_info) and returns it. But the caller doesn't receive the stem variable. Here's the code: Code:
/** * Program to read the contents of DOpus 5 source and destination * listeners. * * Will later be improved to do some processiong with the entries. */ options results address 'DOPUS.1' 'LISTER QUERY SOURCE' src_handle = RESULT 'LISTER QUERY DEST' dst_handle = RESULT src_entries = getListerEntryInfos(src_handle) dst_entries = getListerEntryInfos(dst_handle) say src_entries.count /* Debug output */ exit getListerEntryInfos: procedure arg handle 'LISTER QUERY 'handle' ENTRIES STEM 'entries n = entries.count-1 do i = 0 to n 'LISTER QUERY 'handle' ENTRY "'entries.i'" STEM 'entry_info.i end entry_info.count = entries.count say entry_info.count /* Debug output */ return entry_info Code:
4 5 SRC_ENTRIES.COUNT Does anyone have any idea what the reason could be? |
17 September 2023, 14:30 | #92 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
"src_entries.count" is just a string, hence SAY will print it as a string in upper case. Use TCO to open a trace console and add "trace r" or "trace i" in front of your script to see what is going wrong.
|
17 September 2023, 20:56 | #93 | |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Quote:
If so that would mean that something like this isn't possible: Code:
/**/ p = createPersons() Do i = 1 to Length(p) Say p.i.Name End exit createPersons: procedure Person.1.Name = "Turanga Leela" Person.1.Postcode = 101 Person.2.Name = "Bender Rodriguez" Person.2.Postcode = 823 Person.3.Name = "Phillip J. Fry" Person.3.Postcode = 823 return Person |
|
17 September 2023, 22:44 | #94 | ||
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
Quote:
Quote:
Code:
/**/ call createPersons() Do i = 1 to Person.0 Say Person.i.Name End exit createPersons: procedure expose Person. Person.1.Name = "Turanga Leela" Person.1.Postcode = 101 Person.2.Name = "Bender Rodriguez" Person.2.Postcode = 823 Person.3.Name = "Phillip J. Fry" Person.3.Postcode = 823 Person.0 = 3 return |
||
09 October 2023, 08:44 | #95 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Howto bring Workbench to front with ARexx
For a DOpus 5.82 ARexx script I need to explicitly bring the Workbench screen to front and switch back to DOpus after a while.
To bring DOpus to the foreground, there is a command in its ARexx port: 'dopus front'. But what could I do to bring the Workbench screen to front? (I have OS3.2 and could use its Workbench ARexx port for this. Unfortunately I have not found accurate documentation for it. But in the Workbench ARexx port for OS4 there seems to be no such function.) Last edited by thyslo; 09 October 2023 at 13:37. |
09 October 2023, 14:38 | #96 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
I haven't tried but "WINDOWTOFRONT root" should do what you want: https://wiki.amigaos.net/wiki/Workbe...OFRONT_command
|
09 October 2023, 19:43 | #97 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Yes this works! I had overlooked that in the api document.
Thank you |
04 December 2023, 08:15 | #98 |
Registered User
Join Date: Jan 2010
Location: turkey
Posts: 30
|
Hello, I don't know much about Arexx scripts, but there is something I want to ask. For example, I opened the "work: application/myprog/crate" drawer and is it possible to copy the path to this drawer and create a script?
Solved my solution Code:
/* Get directory */ IF ~SHOW(LIBRARIES,'rexxtricks.library') THEN IF ~ADDLIB('rexxtricks.library',9,-30,38) THEN quit('Cannot open rexxtricks.library!',10) OPTIONS RESULTS ADDRESS WORKBENCH GETATTR OBJECT WINDOWS.ACTIVE ACTIVEWINDOW = RESULT /*SAY 'Directory = ' RESULT*/ IF WRITECLIPBOARD(0, RESULT) THEN EXIT ELSE SAY 'ERROR wirting to clipboard' Last edited by blasterreal; 04 December 2023 at 11:42. |
04 December 2023, 14:11 | #99 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,315
|
With "GETATTR OBJECT WINDOWS.ACTIVE" you get the name of the active window. Is the window name = full path? If yes and you want to save the result in a variable you can use this for example:
Code:
GETATTR OBJECT WINDOWS.ACTIVE VAR activewindowname SAY activewindowname WRITECLIPBOARD() is not needed. I guess the next thing you need is GETDIR() from rexxtricks.library. |
19 December 2023, 21:11 | #100 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
I have a problem with an ARexx script that is started from inside GoldEd. Its purpose is to start BlitzBasic and display a success (or failure, or 'is already ruinning') message in GoldEds status bar. Here's the whole script, and it contains some GoldEd boilerplate code at the start and at the end. My script content starts after the INSERT YOUR CODE HERE comment:
Code:
/* Open BlitzBasic/TED from GoldED */ options results /* enable return codes */ if (left(address(), 6) ~= "GOLDED") then /* not started by editor ? */ address 'GOLDED.1' 'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */ if (RC ~= 0) then exit options failat 6 /* ignore warnings */ signal on syntax /* ensure clean exit */ /* ------------------------ INSERT YOUR CODE HERE: ------------------- */ cmd_start_ted = 'run >NIL: <NIL: SYS:DevTools/BlitzBasic2/Blitz2' status_msg = 'TED already running.' ted_port = 'TED_REXX1' resources_loaded = 1 /* Open rexxsupport.library, needed for msg related functions */ if ~Show('LIBRARIES', 'rexxsupport.library') then do if ~AddLib('rexxsupport.library', 0, -30) then do status_msg = 'Failed to open rexxsupport.library.' resources_loaded = 0 end end if resources_loaded = 1 then do if ~Show('PORTS', ted_port) then do address command cmd_start_ted loaded=0 do for 25 while loaded=0 Delay(15) if Show('PORTS', ted_port) then do loaded=1 status_msg = 'Successfully loaded TED.' end end if loaded=0 then do status_msg = 'Failed to load TED.' end end end 'REQUEST STATUS="'status_msg'"' /* ---------------------------- END OF YOUR CODE ----------------------- */ 'UNLOCK' /* unlock user interface */ exit SYNTAX: SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-(" 'UNLOCK' exit The error request doesn't appear if I comment out the line with the Delay(15). This tells me that GoldEd wants to process the Delay(15). But this function, Delay(), isn't for GoldEd - it's a function of the rexxsupport.library that is opened a few lines above the Delay() call. How can I manage that GoldEd doesn't want to process the Delay() but rexxsupport.library does instead? Last edited by thyslo; 29 July 2024 at 15:00. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AmigaDOS scripting resources | Photon | Coders. System | 26 | 19 March 2018 14:51 |
Very Basic Scripting. Confused. | marduk_kurios | Coders. System | 5 | 06 February 2014 11:13 |
UAE Scripting Layer | FrodeSolheim | support.FS-UAE | 15 | 26 January 2014 15:56 |
C= 64 BASIC as a Scripting Language | Charlie | Retrogaming General Discussion | 2 | 17 November 2008 14:23 |
|
|