> Coming out of the cocoon! Won a Mini Mac on EBAY. soon will be downloading
> iso..
> Any having an comments? Amiga 3000 was my last Amiga
> TIA Sarkis
Cool :) Enjoy it! Just make sure you've your disks with rexxsyslib.library
of your old computer available when you look into arexx using morphos :)
http://www.morphzone.org/modules/newbb_plus/viewtopic.php?topic_id=6517&forum=3&\
goto=prev
ciao Alfonso, :-)
> I think the command is not implemented. I can't say that for sure, because
> I am far from my peg atm. But I can't find anything like "ViewList" in the
> Ambient sources.
from MOSSYS:Ambient/docs/changelog.txt:
[snip]
22.10.2005
- appclass.c
Added RXCMD_ViewList : lists view names/id. Can be useful for rexx
scripting. (fab1)
[snip]
seems so well planned three years ago but apparently not in operation.
The ARexx port has the following RC:
-1: bad definition
-2: out of memory
-3: unknown command
-4: bad syntax
-5: not yet implemented
- success: 0
- warnings: 5 to 9
- errors: 10 to 19
- fatals: 20 or more
and trying to invoke 'ViewList' appropriate results are obtained:
address AMBIENT
ViewList -> RC = -4
ViewList list -> RC = 0
ViewList STEM list -> RC = 0
ViewList STEM -> RC = -4
viewLost -> RC = -3
so I thought it was implemented and that something was wrong with my script
cari saluti,
paolo
Hi Paolo
I think the command is not implemented. I can't say that for sure, because I
am far from my peg atm. But I can't find anything like "ViewList" in the
Ambient sources.
Ciao. Alfonso
ciao Alex,
> On another note, maybe it's "not officially documented" for a
> reason....maybe the command was never completely functional.
well, now I can consider this eventuality as the most likely.
to know for sure I tried to question morphosambient-public@...
but no responses until now.
I am not an expert programmer, I've just tried to see if there was a my mistake
in creating the ARexx script
Alex, that serious tone! the world will not fall if I can not do it! :-)
for two decades amiga was pure fun for me but lately everything is getting heavy
.... well, let's leave
regards,
paolo
1. Do you have a link to the forum that states this info?
2. I'm guessing this is for AMBIENT the MorphOS and not Ambient Project which is something completely different?
On another note, maybe it's "not officially documented" for a reason....maybe the command was never completely functional.
Alex.
From: Paolo Germano <pgermano@...> To: arexx@yahoogroups.com Sent: Saturday, January 31, 2009 1:14:33 AM Subject: [arexx] how to apply this ARexx command?
(I have already asked in the appropriate forums related to Ambient, the desktop of MorphOS, and have received no reply....)
From a script I'm sending a command to the 'AMBIENT' host but I do not receive the expected result. I do not understand whether it is matter of pure Arexx technical programming or something contextual to the host interaction .....
This command is not officially documented but I have found it and his description from the public sources of Ambient project at SourceForge:
* Command: * - ViewList * Synopsis: * - return view list into a stem * Parameters: * - STEM: stem name to store the result to * Example: * - ViewList views * Result: * - A stem var with the following fields: * - stem.n: <id,name> pair * - stem.count: list count * RC: * - 0 : Ok * - 20: Syntax Error
with code: --------- address 'AMBIENT' ViewList views say
RC say views.count say views.0
I have the results: ------------ ------ 0 VIEWS.COUNT VIEWS.0
so, return code says command was executed without errors but stem remains uninitialized.
want to help me understand my arexx mistake in order to handle this task??
ciao Bernd,
> Maybe you have to declare "options results" first?
already tried
>> so 'AMBIENT' should set a variable only declared into 'REXX' host
>> I do not even know if this can be a regular task within ARexx.... is it?
>
> I don't know. I think the variables are declared for the script context.
> So if the REXX host sends a command to another host it will also send
> the context so that the other host does have access to the variables of
> the script form which the command was sent, or so.
and if so, then there is nothing else more to try, I think..... :-/
thanks to you Bernd,
paolo
Hoi Paolo,
> thanks anyway for your suggestions :-)
Maybe you have to declare "options results" first?
> in practice I can define an arbitrary name for a STEM, local to the 'REXX'
host
> address, to be passed as argument to 'Viewlist', exclusive command of the
> 'AMBIENT' host address.
> so 'AMBIENT' should set a variable only declared into 'REXX' host
> I do not even know if this can be a regular task within ARexx.... is it?
I don't know. I think the variables are declared for the script context.
So if the REXX host sends a command to another host it will also send
the context so that the other host does have access to the variables of
the script form which the command was sent, or so.
--
cu, Bernd
ciao Bernd,
>> address 'AMBIENT'
>> ViewList views
>
> Maybe you have to add the Point too?
> ViewList views.
done -> RC=0, same negative results
> Or the argument must be given?
> ViewList STEM views
done -> RC=0, same negative results
> Or both?
> ViewList STEM views.
done -> RC=0, same negative results
> Sorry, don't have MorphOS to try.
thanks anyway for your suggestions :-)
in practice I can define an arbitrary name for a STEM, local to the 'REXX' host
address, to be passed as argument to 'Viewlist', exclusive command of the
'AMBIENT' host address.
so 'AMBIENT' should set a variable only declared into 'REXX' host
I do not even know if this can be a regular task within ARexx.... is it?
regards,
paolo
Hoi Paolo,
> with code:
> ---------
> address 'AMBIENT'
> ViewList views
Maybe you have to add the Point too?
ViewList views.
Or the argument must be given?
ViewList STEM views
Or both?
ViewList STEM views.
Sorry, don't have MorphOS to try.
--
cu, Bernd
(I have already asked in the appropriate forums related to Ambient, the desktop
of MorphOS, and have received no reply....)
From a script I'm sending a command to the 'AMBIENT' host but I do not receive
the expected result.
I do not understand whether it is matter of pure Arexx technical programming or
something contextual to the host interaction .....
This command is not officially documented but I have found it and his
description from the public sources of Ambient project at SourceForge:
* Command:
* - ViewList
* Synopsis:
* - return view list into a stem
* Parameters:
* - STEM: stem name to store the result to
* Example:
* - ViewList views
* Result:
* - A stem var with the following fields:
* - stem.n: <id,name> pair
* - stem.count: list count
* RC:
* - 0 : Ok
* - 20: Syntax Error
with code:
---------
address 'AMBIENT'
ViewList views
say RC
say views.count
say views.0
I have the results:
------------------
0
VIEWS.COUNT
VIEWS.0
so, return code says command was executed without errors but stem remains
uninitialized.
want to help me understand my arexx mistake in order to handle this task??
Thank folks,
paolo
Hello StellanInDerMailingliste@...,
on 01.05.2008 you wrote:
> On 01.05.08 Bernd Gollesch wrote:
>>> (1L<<1)
>>> \ \--- is the bit to set.
>>> \------ 1L = 1 Longword = 2 word = 4 byte = 32 bit
>
>> Sort of. The "<<" is the shift left operator. What 1L<<1 means is shift
>> the bits of the value 1L (= 1 long) to the left by 1:
>
>> 1L => 00000000 00000000 00000000 00000001
>> <<1 => 00000000 00000000 00000000 00000010
>
>> 3L => 00000000 00000000 00000000 00000011
>> <<1 => 00000000 00000000 00000000 00000110
>
> I liked my explanation much more. ;D Thank you for the right one.
I think you know it alreay but for correctness:
Your explanation is only correct for the 1L initial Value.
>>> What does mean (0L) of #define MEMF_ANY (0L)?
>
>> The big L at the end of the number just tells the compiler it's a LONG
>> not a WORD not a CHAR.
>
> Ok, 0L means 00000000 00000000 00000000 00000000 and shift makes no
> sense.
Correct!
>> There is the bitset() function, so you can do like this:
>
>> /* MEM-Flags for AllocMem() */
>> MEMF_ANY = '00000000'x
>> MEMF_PUBLIC = bitset('00000000'x, 0)
>> MEMF_CHIP = bitset('00000000'x, 1)
>> MEMF_FAST = bitset('00000000'x, 2)
>> MEMF_LOCAL = bitset('00000000'x, 8)
>> MEMF_24BITDMA = bitset('00000000'x, 9)
>> MEMF_KICK = bitset('00000000'x, 10)
>
>> MEMF_CLEAR = bitset('00000000'x, 16)
>> MEMF_REVERSE = bitset('00000000'x, 18)
>
>> MEMF_NO_EXPUNGE = ('00000000x', 31)
>
>> There is also a bitor() function, so you can use:
>
>> my_mem = ALLOCMEM(len, bitor(MEMF_FAST, MEMF_CLEAR))
>
> Thanks again for the hint.
Thanks to Bernd to bing that back into my memory. :-)
--
Regards,
Frank (Opi) Weber
Hello StellanInDerMailingliste@...,
on 01.05.2008 you wrote:
>>>> /*----- Memory Requirement Types ---------------------------*/
>>>> /*----- See the AllocMem() documentation for details--------*/
>>>
>>>> #define MEMF_ANY (0L) /* Any type of memory will do */
>>>> #define MEMF_PUBLIC (1L<<0)
>>>> #define MEMF_CHIP (1L<<1)
>>>> #define MEMF_FAST (1L<<2)
[...]
>> Hmm, then maybe you should learn something about the binary number
>> system. 00 01 00 02 (hex) are 32 bits. in binary it's:
>> 00000000 00000001 00000000 00000010
>> the leftmost is bit 31 the rightmost is bit 0
>
> I know a bit about binary numbers system but never need to use them and I
> didn`t know what (1L<<1) does mean. As you said set bits is really easy.
> I`ll guess now. Tell me if I`m right or wrong. :-)
>
> (1L<<1)
> \ \--- is the bit to set.
> \------ 1L = 1 Longword = 2 word = 4 byte = 32 bit
The first 1 is the initial Value and the second 1 is the value how many
times the initial Value should be left shifted to get the result.
For this case (initial Value = 1) your definition "is the bit to set."
is correct but not for other initial Values.
The "L" defines the Variable as LONG (4 Bytes) as you wrote above.
> What does mean (0L) of #define MEMF_ANY (0L)?
with the above you should know it now.
it's a LONG with the Value of 0.
>> it's really easy and i can calculate such values in the head
>> but you can use sites like:
>> http://www.townblog.de/tools/dezimal-hexadezimal-binaer-tabelle.htm
>> (and the links on this site)
>
> I prefer DigiConverter by Deniil in case of need.
I wrote already i prefer my own human Hardware. :-)
--
Regards,
Frank (Opi) Weber
On 01.05.08 Bernd Gollesch wrote:
>> (1L<<1)
>> \ \--- is the bit to set.
>> \------ 1L = 1 Longword = 2 word = 4 byte = 32 bit
> Sort of. The "<<" is the shift left operator. What 1L<<1 means is shift the
> bits of the value 1L (= 1 long) to the left by 1:
> 1L => 00000000 00000000 00000000 00000001
> <<1 => 00000000 00000000 00000000 00000010
> 3L => 00000000 00000000 00000000 00000011
> <<1 => 00000000 00000000 00000000 00000110
I liked my explanation much more. ;D Thank you for the right one.
>> What does mean (0L) of #define MEMF_ANY (0L)?
> The big L at the end of the number just tells the compiler it's a LONG not
> a WORD not a CHAR.
Ok, 0L means 00000000 00000000 00000000 00000000 and shift makes no sense.
> There is the bitset() function, so you can do like this:
> /* MEM-Flags for AllocMem() */
> MEMF_ANY = '00000000'x
> MEMF_PUBLIC = bitset('00000000'x, 0)
> MEMF_CHIP = bitset('00000000'x, 1)
> MEMF_FAST = bitset('00000000'x, 2)
> MEMF_LOCAL = bitset('00000000'x, 8)
> MEMF_24BITDMA = bitset('00000000'x, 9)
> MEMF_KICK = bitset('00000000'x, 10)
> MEMF_CLEAR = bitset('00000000'x, 16)
> MEMF_REVERSE = bitset('00000000'x, 18)
> MEMF_NO_EXPUNGE = ('00000000x', 31)
> There is also a bitor() function, so you can use:
> my_mem = ALLOCMEM(len, bitor(MEMF_FAST, MEMF_CLEAR))
Thanks again for the hint.
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
Hoi,
> (1L<<1)
> \ \--- is the bit to set.
> \------ 1L = 1 Longword = 2 word = 4 byte = 32 bit
Sort of. The "<<" is the shift left operator. What 1L<<1 means is shift the bits
of the value 1L (= 1 long) to the left by 1:
1L => 00000000 00000000 00000000 00000001
<<1 => 00000000 00000000 00000000 00000010
3L => 00000000 00000000 00000000 00000011
<<1 => 00000000 00000000 00000000 00000110
> What does mean (0L) of #define MEMF_ANY (0L)?
The big L at the end of the number just tells the compiler it's a LONG not a
WORD not a CHAR.
There is the bitset() function, so you can do like this:
/* MEM-Flags for AllocMem() */
MEMF_ANY = '00000000'x
MEMF_PUBLIC = bitset('00000000'x, 0)
MEMF_CHIP = bitset('00000000'x, 1)
MEMF_FAST = bitset('00000000'x, 2)
MEMF_LOCAL = bitset('00000000'x, 8)
MEMF_24BITDMA = bitset('00000000'x, 9)
MEMF_KICK = bitset('00000000'x, 10)
MEMF_CLEAR = bitset('00000000'x, 16)
MEMF_REVERSE = bitset('00000000'x, 18)
MEMF_NO_EXPUNGE = ('00000000x', 31)
There is also a bitor() function, so you can use:
my_mem = ALLOCMEM(len, bitor(MEMF_FAST, MEMF_CLEAR))
--
cu, Bernd
On 01.05.08 Frank Weber wrote:
>>> See in System includes include/exec/memory.h
>>> Here is the interesting part of this file:
>>
>>> /*----- Memory Requirement Types ---------------------------*/
>>> /*----- See the AllocMem() documentation for details--------*/
>>
>>> #define MEMF_ANY (0L) /* Any type of memory will do */
>>> #define MEMF_PUBLIC (1L<<0)
>>> #define MEMF_CHIP (1L<<1)
>>> #define MEMF_FAST (1L<<2)
>>> #define MEMF_LOCAL (1L<<8) /* Memory that does not go away at RESET */
>>> #define MEMF_24BITDMA (1L<<9) /* DMAable memory within 24 bits of
>>> address */ #define MEMF_KICK (1L<<10) /* Memory that can be used
>>> for KickTags */
>>
>>> #define MEMF_CLEAR (1L<<16) /* AllocMem: NULL out area before return
>>> */ #define MEMF_LARGEST (1L<<17) /* AvailMem: return the largest chunk
>>> size */ #define MEMF_REVERSE (1L<<18) /* AllocMem: allocate from the
>>> top down */ #define MEMF_TOTAL (1L<<19) /* AvailMem: return total
>>> size of memory */
>>
>>> #define MEMF_NO_EXPUNGE (1L<<31) /*AllocMem: Do not cause expunge on
>>> failure */
>>
>>> e.g. 1L<<1 means the 1 Bit is set
>>> same goes for the oher values.
>>
>> I don`t understand that. How can I translate the attributes? E.g.:
>>
>> #define MEMF_PUBLIC (1L<<0) = '00 01 00 01'x
>> #define MEMF_CHIP (1L<<1) = '00 01 00 02'x
>>
>> ???
> Hmm, then maybe you should learn something about the binary number system.
> 00 01 00 02 (hex) are 32 bits. in binary it's:
> 00000000 00000001 00000000 00000010
> the leftmost is bit 31 the rightmost is bit 0
I know a bit about binary numbers system but never need to use them and I didn`t
know what (1L<<1) does mean. As you said set bits is really easy. I`ll guess
now. Tell me if I`m right or wrong. :-)
(1L<<1)
\ \--- is the bit to set.
\------ 1L = 1 Longword = 2 word = 4 byte = 32 bit
What does mean (0L) of #define MEMF_ANY (0L)?
> you see in this case bit 1 and 16 are set.
> that mean (1L<<1) MEMF_CHIP and (1L<<16) MEMF_CLEAR
> if you now want MEMF_REVERSE too then set bit 18 (1L<<18) the result is:
> 00000000 00000101 00000000 00000010 = 00 05 00 02 (hex)
> i hope with that example you understand how it works and
> you can calculate your needed values...
Yep, easy thing. :-)
> it's really easy and i can calculate such values in the head
> but you can use sites like:
> http://www.townblog.de/tools/dezimal-hexadezimal-binaer-tabelle.htm
> (and the links on this site)
I prefer DigiConverter by Deniil in case of need.
> IIRC: you can submit the Values in binary format too.
The book say that it have to be a 4-byte character string. So I didn`t tried
other forms but it seems it works also with binary as argument.
> BTW: AREXX has also binary to hex and dez functions.
Alas there is only B2C(). ARexxGuide show the nested functions
c2x(b2c(<binary>)) to get a b2x() function that is not supported in Arexx.
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
Hello StellanInDerMailingliste@...,
on 01.05.2008 you wrote:
>> See in System includes include/exec/memory.h
>> Here is the interesting part of this file:
>
>> /*----- Memory Requirement Types ---------------------------*/
>> /*----- See the AllocMem() documentation for details--------*/
>
>> #define MEMF_ANY (0L) /* Any type of memory will do */
>> #define MEMF_PUBLIC (1L<<0)
>> #define MEMF_CHIP (1L<<1)
>> #define MEMF_FAST (1L<<2)
>> #define MEMF_LOCAL (1L<<8) /* Memory that does not go away at RESET */
>> #define MEMF_24BITDMA (1L<<9) /* DMAable memory within 24 bits of
>> address */ #define MEMF_KICK (1L<<10) /* Memory that can be used
>> for KickTags */
>
>> #define MEMF_CLEAR (1L<<16) /* AllocMem: NULL out area before return
>> */ #define MEMF_LARGEST (1L<<17) /* AvailMem: return the largest chunk
>> size */ #define MEMF_REVERSE (1L<<18) /* AllocMem: allocate from the
>> top down */ #define MEMF_TOTAL (1L<<19) /* AvailMem: return total
>> size of memory */
>
>> #define MEMF_NO_EXPUNGE (1L<<31) /*AllocMem: Do not cause expunge on
>> failure */
>
>> e.g. 1L<<1 means the 1 Bit is set
>> same goes for the oher values.
>
> I don`t understand that. How can I translate the attributes? E.g.:
>
> #define MEMF_PUBLIC (1L<<0) = '00 01 00 01'x
> #define MEMF_CHIP (1L<<1) = '00 01 00 02'x
>
> ???
Hmm, then maybe you should learn something about the binary number system.
00 01 00 02 (hex) are 32 bits. in binary it's:
00000000 00000001 00000000 00000010
the leftmost is bit 31 the rightmost is bit 0
you see in this case bit 1 and 16 are set.
that mean (1L<<1) MEMF_CHIP and (1L<<16) MEMF_CLEAR
if you now want MEMF_REVERSE too then set bit 18 (1L<<18) the result is:
00000000 00000101 00000000 00000010 = 00 05 00 02 (hex)
i hope with that example you understand how it works and
you can calculate your needed values...
it's really easy and i can calculate such values in the head
but you can use sites like:
http://www.townblog.de/tools/dezimal-hexadezimal-binaer-tabelle.htm
(and the links on this site)
IIRC: you can submit the Values in binary format too.
BTW: AREXX has also binary to hex and dez functions.
--
Regards,
Frank (Opi) Weber <opionline@...>
On 30.04.08 Frank Weber wrote:
> Hello StellanInDerMailingliste@...,
> on 30.04.2008 you wrote:
>> Hi!
>>
>> More then a year is gone since last action here. So I`ll break the
>> silence with a question related to rexxsupport.library function
>> ALLOCMEM():
>>
>> ALLOCMEM(<length>, [<attribute>])
>>
>> <attribute> may be any of the standard flags used with the Exec AllocMem
>> function, but must be supplied as a four-byte string. The default is
>> public (MEMF_PUBLIC).
>>
>> I read in the Amiga ARexx book that the standart attribute for public mem
>> is 1. For other attributes and mem types they refer to the Amiga RKRM. I
>> found different mem types but no attributes in 4-byte character string
>> form.
>>
>> '00 01 00 01'x = Public-RAM (the one and only example from Amiga ARexx
>> book) '00 01 00 02'x = Chip-RAM (I think so after try & error method)
>> '00 01 00 04'x = Fast-RAM ???
> All are correct if you really wish a cleared memory. :-)
>> What about the other mem types. Which attributes?
> See in System includes include/exec/memory.h
> Here is the interesting part of this file:
> /*----- Memory Requirement Types ---------------------------*/
> /*----- See the AllocMem() documentation for details--------*/
> #define MEMF_ANY (0L) /* Any type of memory will do */
> #define MEMF_PUBLIC (1L<<0)
> #define MEMF_CHIP (1L<<1)
> #define MEMF_FAST (1L<<2)
> #define MEMF_LOCAL (1L<<8) /* Memory that does not go away at RESET */
> #define MEMF_24BITDMA (1L<<9) /* DMAable memory within 24 bits of address
> */ #define MEMF_KICK (1L<<10) /* Memory that can be used for KickTags
> */
> #define MEMF_CLEAR (1L<<16) /* AllocMem: NULL out area before return */
> #define MEMF_LARGEST (1L<<17) /* AvailMem: return the largest chunk size
> */ #define MEMF_REVERSE (1L<<18) /* AllocMem: allocate from the top down
> */ #define MEMF_TOTAL (1L<<19) /* AvailMem: return total size of memory
> */
> #define MEMF_NO_EXPUNGE (1L<<31) /*AllocMem: Do not cause expunge on
> failure */
> e.g. 1L<<1 means the 1 Bit is set
> same goes for the oher values.
I don`t understand that. How can I translate the attributes? E.g.:
#define MEMF_PUBLIC (1L<<0) = '00 01 00 01'x
#define MEMF_CHIP (1L<<1) = '00 01 00 02'x
???
[...]
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
Hello StellanInDerMailingliste@...,
on 30.04.2008 you wrote:
> Hi!
>
> More then a year is gone since last action here. So I`ll break the
> silence with a question related to rexxsupport.library function
> ALLOCMEM():
>
> ALLOCMEM(<length>, [<attribute>])
>
> <attribute> may be any of the standard flags used with the Exec AllocMem
> function, but must be supplied as a four-byte string. The default is
> public (MEMF_PUBLIC).
>
> I read in the Amiga ARexx book that the standart attribute for public mem
> is 1. For other attributes and mem types they refer to the Amiga RKRM. I
> found different mem types but no attributes in 4-byte character string
> form.
>
> '00 01 00 01'x = Public-RAM (the one and only example from Amiga ARexx
> book) '00 01 00 02'x = Chip-RAM (I think so after try & error method)
> '00 01 00 04'x = Fast-RAM ???
All are correct if you really wish a cleared memory. :-)
> What about the other mem types. Which attributes?
See in System includes include/exec/memory.h
Here is the interesting part of this file:
/*----- Memory Requirement Types ---------------------------*/
/*----- See the AllocMem() documentation for details--------*/
#define MEMF_ANY (0L) /* Any type of memory will do */
#define MEMF_PUBLIC (1L<<0)
#define MEMF_CHIP (1L<<1)
#define MEMF_FAST (1L<<2)
#define MEMF_LOCAL (1L<<8) /* Memory that does not go away at RESET */
#define MEMF_24BITDMA (1L<<9) /* DMAable memory within 24 bits of address */
#define MEMF_KICK (1L<<10) /* Memory that can be used for KickTags */
#define MEMF_CLEAR (1L<<16) /* AllocMem: NULL out area before return */
#define MEMF_LARGEST (1L<<17) /* AvailMem: return the largest chunk size */
#define MEMF_REVERSE (1L<<18) /* AllocMem: allocate from the top down */
#define MEMF_TOTAL (1L<<19) /* AvailMem: return total size of memory */
#define MEMF_NO_EXPUNGE (1L<<31) /*AllocMem: Do not cause expunge on failure
*/
e.g. 1L<<1 means the 1 Bit is set
same goes for the oher values.
here is the part of Autodocs/exec.doc (mentioned above):
exec.library/AllocMem exec.library/AllocMem
NAME
AllocMem -- allocate memory given certain requirements
SYNOPSIS
memoryBlock = AllocMem(byteSize, attributes)
D0 D0 D1
void *AllocMem(ULONG, ULONG);
FUNCTION
This is the memory allocator to be used by system code and
applications. It provides a means of specifying that the allocation
should be made in a memory area accessible to the chips, or
accessible to shared system code.
Memory is allocated based on requirements and options. Any
"requirement" must be met by a memory allocation, any "option" will
be applied to the block regardless. AllocMem will try all memory
spaces until one is found with the proper requirements and room for
the memory request.
INPUTS
byteSize - the size of the desired block in bytes. (The operating
system will automatically round this number to a multiple of
the system memory chunk size)
attributes -
requirements
If no flags are set, the system will return the best
available memory block. For expanded systems, the fast
memory pool is searched first.
MEMF_CHIP: If the requested memory will be used by
the Amiga custom chips, this flag *must*
be set.
Only certain parts of memory are reachable
by the special chip sets' DMA circuitry.
Chip DMA includes screen memory, images that
are blitted, audio data, copper lists, sprites
and Pre-V36 trackdisk.device buffers.
MEMF_FAST: This is non-chip memory. If no flag is set
MEMF_FAST is taken as the default.
DO NOT SPECIFY MEMF_FAST unless you know
exactly what you are doing! If MEMF_FAST is
set, AllocMem() will fail on machines that
only have chip memory! This flag may not
be set when MEMF_CHIP is set.
MEMF_PUBLIC: Memory that must not be mapped, swapped,
or otherwise made non-addressable. ALL
MEMORY THAT IS REFERENCED VIA INTERRUPTS
AND/OR BY OTHER TASKS MUST BE EITHER PUBLIC
OR LOCKED INTO MEMORY! This includes both
code and data.
MEMF_LOCAL: This is memory that will not go away
after the CPU RESET instruction. Normally,
autoconfig memory boards become unavailable
after RESET while motherboard memory
may still be available. This memory type
is now automatically set in V36. Pre-V36
systems may not have this memory type
and AllocMem() will then fail.
MEMF_24BITDMA: This is memory that is within the address
range of 24-bit DMA devices. (Zorro-II)
This is required if you run a Zorro-II
DMA device on a machine that has memory
beyond the 24-bit addressing limit of
Zorro-II. This memory type
is now automatically set in V36. Pre-V36
systems may not have this memory type
and AllocMem() will then fail.
MEMF_KICK: This memory is memory that EXEC was able
to access during/before the KickMem and
KickTags are processed. This means that
if you wish to use these, you should allocate
memory with this flag. This flag is
automaticly set by EXEC in V39. Pre-V39
systems may not have this memory type and
AllocMem() will then fail. Also, *DO NOT*
ever add memory the system with this flag
set. EXEC will set the flag as needed
if the memory matches the needs of EXEC.
options
MEMF_CLEAR: The memory will be initialized to all
zeros.
MEMF_REVERSE: This allocates memory from the top of
the memory pool. It searches the pools
in the same order, such that FAST memory
will be found first. However, the
memory will be allocated from the highest
address available in the pool. This
option is new as of V36. Note that this
option has a bug in pre-V39 systems.
MEMF_NO_EXPUNGE This will prevent an expunge to happen on
a failed memory allocation. This option is
new to V39 and will be ignored in V37.
If a memory allocation with this flag
set fails, the allocator will not cause
any expunge operations. (See AddMemHandler())
RESULT
memoryBlock - a pointer to the newly allocated memory block.
If there are no free memory regions large enough to satisfy
the request, zero will be returned. The pointer must be
checked for zero before the memory block may be used!
The memory block returned is long word aligned.
WARNING
The result of any memory allocation MUST be checked, and a viable
error handling path taken. ANY allocation may fail if memory has
been filled.
EXAMPLES
AllocMem(64,0L) - Allocate the best available memory
AllocMem(25,MEMF_CLEAR) - Allocate the best available memory, and
clear it before returning.
AllocMem(128,MEMF_CHIP) - Allocate chip memory
AllocMem(128,MEMF_CHIP|MEMF_CLEAR) - Allocate cleared chip memory
AllocMem(821,MEMF_CHIP|MEMF_PUBLIC|MEMF_CLEAR) - Allocate cleared,
public, chip memory.
NOTE
If the free list is corrupt, the system will panic with alert
AN_MemCorrupt, $01000005.
This function may not be called from interrupts.
A DOS process will have its pr_Result2 field set to
ERROR_NO_FREE_STORE if the memory allocation fails.
SEE ALSO
FreeMem
> Some problems with ALLOCMEM() and FREEMEM() known or it is save to use
> them?
it's should be save if you use it correct and never change or forget the
pointer to your allocated memory and do not use memory outside of your
allocation.
HTH
--
Regards,
Frank (Opi) Weber
Hi!
More then a year is gone since last action here. So I`ll break the silence with
a
question related to rexxsupport.library function ALLOCMEM():
ALLOCMEM(<length>, [<attribute>])
<attribute> may be any of the standard flags used with the Exec AllocMem
function, but must be supplied as a four-byte string. The default is public
(MEMF_PUBLIC).
I read in the Amiga ARexx book that the standart attribute for public mem is 1.
For other attributes and mem types they refer to the Amiga RKRM. I found
different mem types but no attributes in 4-byte character string form.
'00 01 00 01'x = Public-RAM (the one and only example from Amiga ARexx book)
'00 01 00 02'x = Chip-RAM (I think so after try & error method)
'00 01 00 04'x = Fast-RAM ???
...
What about the other mem types. Which attributes?
Some problems with ALLOCMEM() and FREEMEM() known or it is save to use them?
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
On 04.01.07 Frank Weber wrote:
> Hello StellanInDerMailingliste@...,
> on 04.01.2007 you wrote:
>> On 04.01.07 Frank Weber wrote:
>>>> Maybe it is the "/" char?!
>>
>>> Yes of course. as i already wrote it's a feature of the rx command. :-)
>>> With quotes you can execute Arexx commands in the CLI.If you type e.g.:
>>> rx "say 1/2"
>>> you should get 0.5.
>>
>> Ok, forgot that feature but what about this?:
> No i don't want to forget that feature because it's sometimes very handy.
> (BTW: take also look into your Arexx manual how RX work)
I use that feature too but at that time my mind was blocked for that info. :D
>> assign ARexxScripte: Tools:Dev/ARexx/
>>
>> 13. Tools:Dev/ARexx> rx "ARexxScripte:ASCII_Table.rexx" (works)
>> Why does it work?
> because you want it. ;-)
I meant compared to the second command line but no more interesting.
>> 13. Tools:> rx "ARexxScripte:ASCII_Table.rexx" (no error, no output)
> Run SnoopDos and you should see what happen...
I did it already but that didn`t help me. However, I wont invest more time for
this issue.
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
Hello StellanInDerMailingliste@...,
on 04.01.2007 you wrote:
> On 04.01.07 Frank Weber wrote:
>>> Maybe it is the "/" char?!
>
>> Yes of course. as i already wrote it's a feature of the rx command. :-)
>> With quotes you can execute Arexx commands in the CLI.If you type e.g.:
>> rx "say 1/2"
>> you should get 0.5.
>
> Ok, forgot that feature but what about this?:
No i don't want to forget that feature because it's sometimes very handy.
(BTW: take also look into your Arexx manual how RX work)
> assign ARexxScripte: Tools:Dev/ARexx/
>
> 13. Tools:Dev/ARexx> rx "ARexxScripte:ASCII_Table.rexx" (works)
> Why does it work?
because you want it. ;-)
> 13. Tools:> rx "ARexxScripte:ASCII_Table.rexx" (no error, no output)
Run SnoopDos and you should see what happen...
If that answers is again not sufficient for you then ask the programer
of rx (if you can find him...)
EOT
--
Regards,
Frank (Opi) Weber
On 04.01.07 Frank Weber wrote:
>> Maybe it is the "/" char?!
> Yes of course. as i already wrote it's a feature of the rx command. :-)
> With quotes you can execute Arexx commands in the CLI.If you type e.g.:
> rx "say 1/2"
> you should get 0.5.
Ok, forgot that feature but what about this?:
assign ARexxScripte: Tools:Dev/ARexx/
13. Tools:Dev/ARexx> rx "ARexxScripte:ASCII_Table.rexx" (works)
Why does it work?
13. Tools:> rx "ARexxScripte:ASCII_Table.rexx" (no error, no output)
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
Hello StellanInDerMailingliste@...,
on 04.01.2007 you wrote:
> On 04.01.07 Frank Weber wrote:
>>> here it never worked. I get always with all scripts:
>>> +++ Error 47 in line 1: Arithmetic conversion error
>> Here at least 2 solutions:
>
>> 1. Don't quote the Filename/path and use {f}
>> (here you lose the possibility to use spaces in Filenames Paths)
>
>> 2. use {o} but CD to the source source first.
>> i use this here. :-)
>
>> For both options exists checkmarks in the DOpus 4 configuration.
>> maybe it's the same in DOpus 5!?
>
> Yep, it is the same wiht DOpus5. Thanks for the hint! It works. :-)
OK.
[...]
> Maybe it is the "/" char?!
Yes of course. as i already wrote it's a feature of the rx command. :-)
With quotes you can execute Arexx commands in the CLI.If you type e.g.:
rx "say 1/2"
you should get 0.5.
--
Regards,
Frank (Opi) Weber
On 04.01.07 Frank Weber wrote:
>> here it never worked. I get always with all scripts:
>> +++ Error 47 in line 1: Arithmetic conversion error
>>
>> I tried "RX {f}", "SYS:Rexxc/RX {f}" (AmigaDOS).
>> "{f}" (ARexx)
>>
>> Please tell me how. It must be easy. :-)
> I don't use DOpus 5 but DOpus 4 and suffer on the same problem
> some years ago. Seems to be a feature of the rx command which
> don't like quotes around the script path/name.
> Here at least 2 solutions:
> 1. Don't quote the Filename/path and use {f}
> (here you lose the possibility to use spaces in Filenames Paths)
> 2. use {o} but CD to the source source first.
> i use this here. :-)
> For both options exists checkmarks in the DOpus 4 configuration.
> maybe it's the same in DOpus 5!?
Yep, it is the same wiht DOpus5. Thanks for the hint! It works. :-)
Examples:
With {o} and CD source (works):
cd "DH1:Dev/ARexx/"
stack 65536
rx "ASCII_Table.rexx"
With {f} and CD source (error):
cd "DH1:Dev/ARexx/"
stack 65536
rx "DH1:Dev/ARexx/ASCII_Table.rexx"
With {f} (error):
stack 65536
rx "DH1:Dev/ARexx/ASCII_Table.rexx"
With {f} and No quotes (works):
stack 65536
rx DH1:Dev/ARexx/ASCII_Table.rexx
Similar when you start a script from Shell (here KingCON).
It seems that the problem/error appears only with following requirements:
- Use quotes
AND
- You are NOT in the dir where the script is
AND
- NOT use assign to the script
A bit strange IMHO. E.g. for shell:
assign ARexxScripte: Tools:Dev/ARexx/
13. Tools:Dev/ARexx> rx "ARexxScripte:ASCII_Table.rexx" (works)
13. Tools:Dev/ARexx> rx "Tools:Dev/ARexx/ASCII_Table.rexx" (error)
13. Tools:> rx "ARexxScripte:ASCII_Table.rexx" (no error, no output)
Maybe it is the "/" char?!
Regards
--
_____ _____ ______ ___ _____ _____ ______ ________
_\ _/___\ /__ __\_ / /___\ /___\ /____\_ /_\__ /
.-/ \ / / /_ / /_ / /_ / /_ \ / / (/___/-.
|/________________\_______\__\____\__\____\___/ ___________\.vK |
`- ( www.moodsplateau.net ) - ------------ -./____/ - ------------'
Hello Stellan,
on 04.01.2007 you wrote:
> here it never worked. I get always with all scripts:
> +++ Error 47 in line 1: Arithmetic conversion error
>
> I tried "RX {f}", "SYS:Rexxc/RX {f}" (AmigaDOS).
> "{f}" (ARexx)
>
> Please tell me how. It must be easy. :-)
I don't use DOpus 5 but DOpus 4 and suffer on the same problem
some years ago. Seems to be a feature of the rx command which
don't like quotes around the script path/name.
Here at least 2 solutions:
1. Don't quote the Filename/path and use {f}
(here you lose the possibility to use spaces in Filenames Paths)
2. use {o} but CD to the source source first.
i use this here. :-)
For both options exists checkmarks in the DOpus 4 configuration.
maybe it's the same in DOpus 5!?
--
Regards,
Frank (Opi) Weber
Hi Bernd,
--- In arexx@yahoogroups.com, Bernd Gollesch <bgollesch@...> wrote:
> It's not the time so much as having to remember to compile before
> running the script. I guess I could add a Save/Compile/Run button
> to GoldEd to automate that.
>
>> You could use a makefile, so you just has to type "make" before
>> running the script.
To me one of the nice things about working with ARexx is not having
to remember to "compile"; so I'll probably continue using
my "include" function during development. In the final release I'll
paste the generated code into the script.
> My first thought was to tell you about the
> ARG() and PARSE but than I decided to just rewrite the function to
> give you an example to actually see it in action (and because I
> like coding in ARexx :).
Thanks for the hints, much appreciated.
Robert
Hoi Robert,
> > Does the FlexCat compile really takes that long to split up the script?
> It's not the time so much as having to remember to compile before running the
script. I guess I could add a Save/Compile/Run button to GoldEd to automate
that.
You could use a makefile, so you just has to type "make" before running
the script.
> BTW there were some good tips in there for me too, I didn't realise that ARG()
alone gave the count of arguements nor that you could use the content of a
variable in a PARSE statement by enclosing it in brackets.
That's why I've done it. My first thought was to tell you about the
ARG() and PARSE but than I decided to just rewrite the function to
give you an example to actually see it in action (and because I like
coding in ARexx :).
--
cu, Bernd
Hi Bernd,
On 15/12/06 at 21:58, Bernd Gollesch wrote:
>> That's it, sorry for the long post but I'd be interested he hear any
>> comments you may have on this implementation of localisation.
>
> You're using nearly the same approach as I did. I think there is not
> much room for any other solution.
I'd come to that conclusion, but it's nice to hear comments from others.
> Does the FlexCat compile really takes that long to split up the script?
It's not the time so much as having to remember to compile before running the
script. I guess I could add a Save/Compile/Run button to GoldEd to automate
that.
> May I suggest some improvements of your LocStr procedure:
Certainly, your version is much more compact and you're right that including the
stem in the LocStr() call is no less readable. BTW there were some good tips in
there for me too, I didn't realise that ARG() alone gave the count of arguements
nor that you could use the content of a variable in a PARSE statement by
enclosing it in brackets.
Thanks very much for your comments. Given that I seem to be going along the
right lines I'll start work on localising AmiPodder over the weekend!
Robert
--
| Mag Editor and Web Master | robert@... |
| Total Amiga magazine | AmiPodder - Amiga Podcast Receiver |
| http://www.totalamiga.org/ | http://www.amipodder.com |
- Coming SOON!: Total Amiga Issue 25 - http://www.totalamiga.org -