Who's Online 
 
         
              
          115  user(s) are online (
81  user(s) are browsing 
Forums )
Members: 0
Guests: 115
    more...
  
       
      
     
   
                         
                         
                      
                
        
            
                        
            
                         
  
      
          Topic options 
                           
            
      
          View mode 
                        Newest First 
                 
                      
              
    
         
 
    
  
    
    
        
    
    
        
            
         
        
            [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 19:01 
                                  
                                    #1  
                             
         
     
    
                
                             Amigans Defender
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/11/17 22:40Last Login
                                :  Yesterday 22:48
                                                    From  England
                                                                            Group: 
                                  Registered Users  Moderators                            
                                                
                                                                            
                                             
                                     
        
                        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 19:48:33 
                
                      
     
    
                
                             
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 19:13 
                                  
                                    #2  
                             
         
     
    
                
                             Not too shy to talk
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2010/6/17 14:04Last Login
                                :  Today 1:09
                                                    From  Waterbury, Connecticut (USA)
                                                                            Group: 
                                  Registered Users                            
                                                
                                                                            
                                             
                                     
        
                        @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." 
            
                 
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 19:32 
                                  
                                    #3  
                             
         
     
    
                
                             Just can't stay away
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2012/8/14 12:51Last Login
                                :  7/5 20:45
                                                    From  France
                                                                            Group: 
                                  Registered Users                            
                                                
                                                                            
                                             
                                     
        
                        @eliyahu I confirm, "lastpos" ARexx works like on z/OS mainframe REXX.
                        
             
            
                                    
 
     
    
                
                             
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 19:48 
                                  
                                    #4  
                             
         
     
    
                
                             Amigans Defender
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/11/17 22:40Last Login
                                :  Yesterday 22:48
                                                    From  England
                                                                            Group: 
                                  Registered Users  Moderators                            
                                                
                                                                            
                                             
                                     
        
                        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.
                        
             
            
                                    
 
     
    
                
                             
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 20:10 
                                  
                                    #5  
                             
         
     
    
                
                             Home away from home
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/12/4 23:15Last Login
                                :  10/30 14:27
                                                                            Group: 
                                  Registered Users                            
                                                
                                                                            
                                             
                                     
        
                        Which documentation is that?
                        
             
            
                                    
 
     
    
                
                                
                 
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 20:13 
                                  
                                    #6  
                             
         
     
    
                
                             Amigans Defender
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/11/17 22:40Last Login
                                :  Yesterday 22:48
                                                    From  England
                                                                            Group: 
                                  Registered Users  Moderators                            
                                                
                                                                            
                                             
                                     
        
                        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).
                        
             
            
                                    
 
     
    
                
                             
     
    
        
     
     
   
        
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 21:10 
                                  
                                    #8  
                             
         
     
    
                
                             Not too shy to talk
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2010/6/17 14:04Last Login
                                :  Today 1:09
                                                    From  Waterbury, Connecticut (USA)
                                                                            Group: 
                                  Registered Users                            
                                                
                                                                            
                                             
                                     
        
                        @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." 
            
                 
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 21:40 
                                  
                                    #9  
                             
         
     
    
                
                             Amigans Defender
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/11/17 22:40Last Login
                                :  Yesterday 22:48
                                                    From  England
                                                                            Group: 
                                  Registered Users  Moderators                            
                                                
                                                                            
                                             
                                     
        
                        @broadblues My AmigaGuide looks suspiciously similar to that, however as eliyahu notes, the wiki is correct.  
                        
             
            
                                    
 
     
    
                
                             
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/13 21:59 
                                  
                                    #10  
                             
         
     
    
                
                             Just can't stay away
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/11/24 18:52Last Login
                                :  2021/9/26 19:59
                                                    From  Gloucestershire, UK.
                                                                            Group: 
                                  Registered Users                            
                                                
                                                                            
                                             
                                     
        
                        @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> 
            
                 
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/14 15:51 
                                  
                                    #11  
                             
         
     
    
                
                             Amigans Defender
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/11/26 23:16Last Login
                                :  2024/8/31 21:09
                                                    From  Canada
                                                                            Group: 
                                  Staff members  Moderators                            
                                                
                                                                            
                                             
                                     
        
                        @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
            
                 
     
    
        
     
     
   
        
  
    
    
        
    
    
        
            
         
        
            Re: [SOLVED] [ARexx] Is LASTPOS() broken?
         
        
            
                                    Posted on: 
2014/4/14 18:59 
                                  
                                    #12  
                             
         
     
    
                
                             Home away from home
 
                                     
                     
                                 
                                    
                    
                         
 
                    
                        Joined:  2006/12/4 23:15Last Login
                                :  10/30 14:27
                                                                            Group: 
                                  Registered Users                            
                                                
                                                                            
                                             
                                     
        
                        @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.
 
                        
             
            
                                    
 
     
    
                
                                
                 
     
    
        
     
     
   
    
  
    
      Currently Active Users Viewing This Thread:
      1
      (
        0 members
                  and 1 Anonymous Users
              )