English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 13 September 2021, 12:06   #1
mateusz_s
Registered User
 
Join Date: Jan 2020
Location: Poland
Posts: 181
[ARexx] Error while counting icons (bug?)

Hi,
When the drawer is empty or nothing is visible (because lack of icons)
I got error when using:
Code:
GETATTR WINDOW.ICONS.SELECTED.COUNT NAME file_path VAR selected_icons_count;
or
GETATTR WINDOW.ICONS.ALL.COUNT NAME file_path VAR all_icons_count;
If there are some files but without icons and I choose Show All Files - script works ok.

The whole script looks like this:
Code:
/*  
    $VER: myTextEdit with selected icon (v1.0)
*/

ADDRESS workbench;

GETATTR WINDOWS.ACTIVE VAR file_path;

/* errors here */
GETATTR WINDOW.ICONS.SELECTED.COUNT NAME file_path VAR selected_icons_count; 

file_path_length$ = LENGTH(file_path);
is_slash$ = '/';
IF (SUBSTR(file_path, file_path_length$) = ':') THEN is_slash$ = '';

IF (selected_icons_count = 0) THEN
    ADDRESS COMMAND 'sys:Tools/TextEdit ' file_path || is_slash$ || 'new_text_file.txt';
ELSE DO
    GETATTR WINDOW.ICONS.SELECTED.0.NAME NAME file_path VAR file_name;
    ADDRESS COMMAND 'sys:tools/TextEdit ' file_path || is_slash$ || file_name;
END;

EXIT;
mateusz_s is offline  
Old 13 September 2021, 17:39   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
What error do you get and did you use trace to find errors?
daxb is online now  
Old 14 September 2021, 00:23   #3
mateusz_s
Registered User
 
Join Date: Jan 2020
Location: Poland
Posts: 181
Quote:
Originally Posted by daxb View Post
What error do you get and did you use trace to find errors?
Hi,
It returns me code nr 10.
It my very first Arexx script ever, I don't know how to trace it.
mateusz_s is offline  
Old 14 September 2021, 11:14   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Check this: https://wiki.amigaos.net/wiki/AmigaO...Rexx_Debugging and ARexxGuide2 on Aminet.

I usually put a "trace i" somewhere in the script, start TCO (trace console) and then launch the script. Trace output should be visible in the trace console.
daxb is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Installed NEw Icons V4 and then removed error jmwtac support.Apps 0 27 April 2020 23:56
Icons bug/problem Jonpt project.ClassicWB 1 10 September 2017 20:36
OS 3.5 icons on 3.1 & WHDLoad hangs when displaying icons PoulpSquad support.WinUAE 22 14 September 2012 00:57
WHDLoad Bug Reports: Sorry, an error has occured: SPAM Keywords detected killergorilla project.WHDLoad 9 10 August 2007 13:01

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07066 seconds with 15 queries