Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
93 user(s) are online (57 user(s) are browsing Forums)

Members: 1
Guests: 92

flash, more...

Headlines

 
  Register To Post  

[SOLVED] [ARexx] Is LASTPOS() broken?
Amigans Defender
Amigans Defender


See User information
This always returns 0:

rx "say lastpos('abcdabcd', 'b')"


No matter what values I feed in, LASTPOS() always returns 0 which means "not found".

I can't get it to work under OS3.1 either. Has it ever worked? Is there an alternative function?


Edited by Chris on 2014/4/13 20:48:33
Go to top
Re: [ARexx] Is LASTPOS() broken?
Not too shy to talk
Not too shy to talk


See User information
@Chris

Quote:
This always returns 0:

rx "say lastpos('abcdabcd', 'b')"


No matter what values I feed in, LASTPOS() always returns 0 which means "not found".

I can't get it to work under OS3.1 either. Has it ever worked? Is there an alternative function?

while i don't know if there is a difference in how it's implemented in AREXX, using ANSI REXX on z/OS, the format is different:

LASTPOS(needle,haystack)
LASTPOS(needle,haystack,offset)


so if it's anything like ANSI REXX, then you'd want your code to be:

rx "say lastpos('b','abcdabcd')"

see if that works.

-- eliyahu

"Physical reality is consistent with universal laws. When the laws do not operate, there is no reality. All of this is unreal."
Go to top
Re: [ARexx] Is LASTPOS() broken?
Just can't stay away
Just can't stay away


See User information
@eliyahu
I confirm, "lastpos" ARexx works like on z/OS mainframe REXX.

Go to top
Re: [ARexx] Is LASTPOS() broken?
Amigans Defender
Amigans Defender


See User information
Wonderful, that works, thanks.

The documentation I always refer to is wrong. Well, the description appears to be correct, but the examples are the other way round.

Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Home away from home
Home away from home


See User information
Which documentation is that?

Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Amigans Defender
Amigans Defender


See User information
ARexx.guide
I'm not sure where I got it, but it has been my go-to reference for as long as I can remember (which, tbh, is only about as far as last Tuesday tea-time).

Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Home away from home
Home away from home


See User information
@Chris

Okay, just wanted make sure it was anything official.

try:

http://wiki.amigaos.net/index.php/AmigaOS_Manual:_ARexx

Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Not too shy to talk
Not too shy to talk


See User information
@broadblues

looks like the wiki is correct (link).

-- eliyahu

"Physical reality is consistent with universal laws. When the laws do not operate, there is no reality. All of this is unreal."
Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Amigans Defender
Amigans Defender


See User information
@broadblues

My AmigaGuide looks suspiciously similar to that, however as eliyahu notes, the wiki is correct.

Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Just can't stay away
Just can't stay away


See User information
@Chris

Try This, I've been using it for years.

ARexx For Beginners (& Others) .guide

Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Amigans Defender
Amigans Defender


See User information
@Chris
Quote:
My AmigaGuide looks suspiciously similar to that, however as eliyahu notes, the wiki is correct.

Some day I hope people will use the official documentation wiki as the first source of accurate information.

ExecSG Team Lead
Go to top
Re: [SOLVED] [ARexx] Is LASTPOS() broken?
Home away from home
Home away from home


See User information
@ssolie

Quote:
Some day I hope people will use the official documentation wiki as the first source of accurate information.


I have an animicon on my workbench which links directly to the wikki.


Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project