Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
80 user(s) are online (69 user(s) are browsing Forums)

Members: 1
Guests: 79

emeck, more...

Support us!

Headlines

 
  Register To Post  

(1) 2 »
List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
Has the LFORMAT lost the %P argument ?

7.Amiga OS 4:> version list
List 53.7
7.Amiga OS 4:> List lformat %P%N
.backdrop
search.rexx
System.info
Internet.info

Go to top
Re: List LFORMAT %P
Not too shy to talk
Not too shy to talk


See User information
@JosDuchIt

%p outputs the path relative to the path you entered. As you didn't enter a path, %P does not make much sense without ALL.

Try either

list all lformat %p%n

or

list sys: lformat %p%n

The former will give you relative paths, the latter will precede each file name by "sys:".

Works like this since ever.


Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@JosDuchIt

Or simply use %F instead of %P.

List %F%N will list the files in the current dir with their full parent paths prepended (in your example just the volume name of your system partition).

Check out "help list".

Best regards,

Niels

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@thomas & nbache
Thank you
as to 'help'
i guess i did overwrite a "alias help "'RX help'" in my user-startup , it did not work lately.

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@JosDuchIt

Quote:
i guess i did overwrite a "alias help "'RX help'" in my user-startup , it did not work lately.
You mean Shell-Startup, not User-Startup, right?

An alias in User-Startup won't be of much use, since an alias is for the current Shell process, not global.

But anyway, an alias should not be necessary. The file REXX:Help must have (at least) the S, E and R bits set, though, does it?

Best regards,

Niels

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@nbache

I observe this

7.Amiga OS 4:S/ARexx> help assign
ok here help is read with more
7.Amiga OS 4:S/ARexx> list help
help 7165 -s--rwed 20-Sep-09 00:06:54
1 fichier - 6K octets - 8 blocs utilisés
7.Amiga OS 4:S/ARexx> sys:
7.Amiga OS 4:> help path
Code de retour 51 : Program not found
7.Amiga OS 4:> path
Répertoire_courant
RAM Disk:
Amiga OS 4:C
Amiga OS 4:S/Shell
Amiga OS 4:S/ARexx
...
7.Amiga OS 4:>


and have indeed no alias for RX help in


; $VER: Shell-Startup 52.1 (15.12.2006) (untouched)


I did solve the problem though having an assign
alias help RX help

in s:Myaliases that is launched from user-startup.
(not in Shell-Startup)
Maybe this is new ?
thanks for your kind help


Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@JosDuchIt
The reason for the behavior you observed when you enter "help path" without the alias is that you have spaces in your system partition name (Amiga OS 4).

If you relabel your system partition to remove the spaces, the ARexx help will work as it should. You may have additional ARexx problems in the future if you leave the spaces in your system partition name.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@nbache
His problem with the ARexx Help script is caused by the spaces in his system partition label. If you temporarily relabel your system partition with spaces in the name and try to call help from the shell command line (help path) without SYS:C/ARexx as the current directory, you will see the same result as he gets. If you run Snoopy and enter "help path" when the current directory is your system partition (SYS:) and then enter "help path" when SYS:S/ARexx is the current directory, you will see what is going wrong.

There is also a bug in the ARexx Help script that causes it to fail if the user keeps his system partition write protected (locked) like I do. I fixed the script to eliminate the bug on my system so it doesn't concern me anymore.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
Since "Help" for shell commands (C: commands) has been mentioned, it might be worth pointing out that you can also double-click SYS:System/Help and get help with all the shell commands. If you are using a KCON shell console, you can also enter SYS:System/Help <command-name>.help to see the help for a single command without using the "more" command.

I use these aliases in my shell-startup:

alias help "run SYS:System/Help" - opens the help window
alias helps SYS:System/Help [].help - displays help for a specific command in the shell window (e.g. help path).

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@xenic

Quote:
His problem with the ARexx Help script is caused by the spaces in his system partition label.
Ah, I didn't notice that - thanks.

Well, the best advice there is to rename that system partition! One thing is to have a space in "RAM Disk:", and that has over time helped to reveal many bugs in various programs. But doing it to your system partition is just plain masochistic.

ARexx is a pretty difficult beast about quoting the arguments a script receives, to be able to have spaces etc. in them. I'm not totally convinced there is any good way to fix the script so it can handle it.

Quote:
There is also a bug in the ARexx Help script that causes it to fail if the user keeps his system partition write protected (locked) like I do.
Hmm, is that because your T: is assigned to a directory on SYS: instead of as default in RAM:? Every system I know requires a temp dir of some sort to be writable. T: is what we use in AmigaOS. It is not reasonable to expect things to work if T: is not writable.

Quote:
I fixed the script to eliminate the bug on my system so it doesn't concern me anymore.
Do share details .

Best regards,

Niels

Go to top
Re: List LFORMAT %P
Home away from home
Home away from home


See User information
@nbache

Quote:

Quote:

Xenic ranted:
Quote:
There is also a bug in the ARexx Help script that causes it to fail if the user keeps his system partition write protected (locked) like I do.

Hmm, is that because your T: is assigned to a directory on SYS: instead of as default in RAM:? Every system I know requires a temp dir of some sort to be writable. T: is what we use in AmigaOS. It is not reasonable to expect things to work if T: is not writable.


No I just did a quick test by locking sys: (must remember to unlocl it again!).

The redirection at line 80 fails, a quick check of the code shows that the global 'tmpfile' variable is not exposed in the function.

changing line 79 to

getpager: PROCEDURE EXPOSE pager tmpfile

from

getpager: PROCEDURE EXPOSE pager

fixes the issue.

I'll write a BZ




Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@xenix thanks for clarification & help


How did you spot you could do
Quote:
alias helps SYS:System/Help [].help - displays help for a specific command in the shell window (e.g. help path).

sys:System/Help is nt documented on my system and has no template.

I do use sys:system/help regularly from contextmenus.allready


Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@broadblues

The tmpfile variable is used throughout the script but is only a problem in the getpager procedure. It works in function calls (like getlanguage) but not in getpager which is declared a PROCEDURE. I guess the "takeaway" from this bug is that an ARexx PROCEDURE does not necessarily have access to a script's global variables.

I solved the problem here by sending "tmpfile" as an argument to the "getpager" PROCEDURE like this:

------------------------------------------------------------------------------
getpager tmpfile


getpager: PROCEDURE EXPOSE pager
arg temp
ADDRESS COMMAND 'getenv *>NIL: PAGER >' || temp
IF RC == 0 THEN
IF OPEN('pager',temp,'R') THEN
DO
pager = READLN('pager')
CLOSE('pager')
END
ADDRESS COMMAND 'delete >NIL: ' || temp
RETURN
-------------------------------------------------------------------------------


Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@nbache
Quote:
Ah, I didn't notice that - thanks.

I noticed it when I ran Snoopy to identify the problem. The same problem will occur when you try to run an ARexx script from a shell when there is a space in the path. For example try something like this:

Makedir "Data:test dir" ( where Data: is a partition)
Copy C:List TO "Data:test dir"
Copy "SYS:S/ARexx/Help" TO "Data:test dir"
"Data:test dir/list" ram:
"Data:test dir/Help" path

The list command will work but the ARexx Help script won't.

The bottom line is that if you want ARexx scripts to work reliably, don't use spaces in partition labels, directory names or file names. That's why my RAM: is labeled "Ram_Disk:" and not "Ram Disk".

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@JosDuchIt
Quote:
sys:System/Help is nt documented on my system and has no template.

It's not documented and as far as I can tell there are no command line arguments read by SYS:System/Help. I figured out how to use it by trial-and-error. It's a simple program but could use some TOOLTYPES and shell arguments to make it more useful. It would be handy if there were TOOLTYPES/ARGS to set the window size, make it append ".help" when only command names are given, add an additional search directory where you could add help files for 3rd party commands etc.

The only reason we still need the ARexx help script is because we don't have a system shell (console actually) that has a scrollbar like KingCON. Otherwise it could be replaced by the SYS:System/Help command. For now we need the script because it uses "more" to split the help text into segments that will fit in the visible console window.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: List LFORMAT %P
Home away from home
Home away from home


See User information
@xenic
Quote:

guess the "takeaway" from this bug is that an ARexx PROCEDURE does not necessarily have access to a script's global variables.


For emphasis if you declare a function with the PROCEDURE keyword in ARexx it creates a new scope, *no* global are visible in that scope unless they are included in the EXPOSE list.

Your solution of adding tmpfile as an argument works but it's cleaner just to add it to the expose list as it's functioning as a global.

Quote:

It's not documented and as far as I can tell there are no command line arguments read by SYS:System/Help. I figured out how to use it by trial-and-error. It's a simple program but could use some TOOLTYPES and shell arguments to make it more useful. It would be handy if there were TOOLTYPES/ARGS to set the window size, make it append ".help" when only command names are given, add an additional search directory where you could add help files for 3rd party commands etc.


Your right about lack of docs as far as I can see there aren't any. I'll review your suggestions above and make some enhancement request if they don't allready exist.

Quote:

The only reason we still need the ARexx help script is because we don't have a system shell (console actually) that has a scrollbar like KingCON. Otherwise it could be replaced by the SYS:System/Help command. For now we need the script because it uses "more" to split the help text into segments that will fit in the visible console window


erm...

alias helps "sys:System/Help [].help | more"

works well for more, but for alternate pagers like multiview it's a bit more tricky.


Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
Help alias:

This would be nice too


.Amiga OS 4:System> alias helpme RX " OPTONS RESULTS ; ADDRESS COMMAND 'SYS:System/Help [].help >t:helpme' ; 'Next t:helpme' "
9.Amiga OS 4:System> helpme delete
1 *-* OPTONS RESULTS;
>>> "OPTONS RESULTS"
>+>
1 *-* ADDRESS COMMAND 'SYS:System/Help delete.help >t:helpme...
>>> "SYS:System/Help delete.help >t:helpme"
>+>
1 *-* 'Next t:helpme';
>>> "Next t:helpme"
>+>
9.Amiga OS 4:System> S;

Next is in my path
the t:helpme file is is created but Next is not launched.

Why ?


Alias Now Next t:helpme
can be used here though.



Go to top
Re: List LFORMAT %P
Home away from home
Home away from home


See User information
@JosDuchIt
Do

alias helpme RX " OPTONS RESULTS ; ADDRESS COMMAND; 'SYS:System/Help [].help >t:helpme' ; 'next t:helpme' ; 'delete t:helpme'"

NOTE the semicolon ';' after the ADDRESS COMMAND without it the ADRESS only affects the following expresion.

You pushing an alias quite hard here, you might be better offwriting a short arexx script.


Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
@broadblues thank you,
Quote:

You pushing an alias quite hard here, you might be better offwriting a short arexx script.


replacing the s:arexx/help script maybe ? ;)

Go to top
Re: List LFORMAT %P
Just can't stay away
Just can't stay away


See User information
Also, I can't help advocating a ground rule of dealing with a multitasking system.

If the alias (or script) is used from two different processes (e.g. Shell windows) simultaneously, they will use the same file and mess up the output.

This can be avoided by specifying a filename such as

't:helpme_' || pragma(I)

- which will append the process address in Hex to each filename.

Even if you don't think concurrency will ever be a problem, you might as well make a habit of this; it just might save your bacon some day.

Best regards,

Niels

Go to top

  Register To Post
(1) 2 »

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project