× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Scan Error.... Help..!
  • From: "Peter Dow" <pcdow@xxxxxxxxx>
  • Date: Sat, 29 Jul 2000 12:49:28 -0700

Don't forget to deal with the situations where NW_sascnt = *blanks and where
n<=1:

         Eval  nwcs_nm_f = *blanks
         Eval  nwcs_nm_l = *blanks
         IF    NW_sascnt <> *Blanks
    ' '  scan  NW_sascnt     n
         If    n>1
         Eval  nwcs_nm_f = %subst(NW_sascnt:1:n-1)
         Eval  nwcs_nm_l = %subst(NW_sascnt:n+1)
         End

or if you feel that doing those extra Eval's when you don't have to is
reprehensible and adding more source code isn't:

         IF    NW_sascnt <> *Blanks
    ' '  scan  NW_sascnt     n
         If    n>1
         Eval  nwcs_nm_f = %subst(NW_sascnt:1:n-1)
         Eval  nwcs_nm_l = %subst(NW_sascnt:n+1)
         else
         Eval  nwcs_nm_f = *blanks
         Eval  nwcs_nm_l = *blanks
         Endif
         else
         Eval  nwcs_nm_f = *blanks
         Eval  nwcs_nm_l = *blanks
         endif

Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax


----- Original Message -----
From: <booth@martinvt.com>
To: <RPG400-L@midrange.com>
Sent: Friday, July 28, 2000 7:13 PM
Subject: Re: Scan Error.... Help..!


> What about:
>         IF    NW_sascnt <> *Blanks
>    ' '  scan  NW_sascnt     n
>         If    n>1
>         Eval  nwcs_nm_f = %subst(NW_sascnt:1:n-1)
>         Eval  nwcs_nm_l = %subst(NW_sascnt:n+1)
>         End
>
>
> (I am wondering if NW_sascnt can ever have a value but have a blank in
> position 1 or position 2?)
>
> _______________________
> Booth Martin
> Booth@MartinVT.com
> http://www.MartinVT.com
> _______________________
>
>
>
>
> a b <eagle_291@yahoo.com>
> Sent by: owner-rpg400-l@midrange.com
> 07/28/2000 11:16 AM
> Please respond to RPG400-L
>
>
>         To:     RPG400-L@midrange.com
>         cc:
>         Subject:        Scan Error.... Help..!
>
> This might sound a bit elementary, but I'm desperately
> seeking help...  I have an triggered application that
> continues to blow up with the following error:
>
> Message . . . . :   Length or start position is out of
> range for the string operation
> Cause . . . . . :   One of the following has occurred
> in RPG procedure TRG_APGM in program BLAHLIB/TRG_APGM
> at statement 382:
>  -A numeric length or start position is less than 1 or
> too large for the string operation.
>  -The search-argument parameter of the %SCAN built-in
> function has zero length or is longer than the
> source-string parameter.
>  -The maximum-length parameter of the %STR built-in
> function is not a value
>   between 1 and 32767.
>
> This is what my code looks like...
>  if contact name /customer name is company name
>
>          IF    NW_sascnt <> *Blanks
>     ' '  scan  NW_sascnt     n
>          Eval  nwcs_nm_f = %subst(NW_sascnt:1:n-1)
>          Eval  nwcs_nm_l = %subst(NW_sascnt:n+1)
>
> Any help would greatly be appreciate.
>
> Thanks
> AB
>
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Kick off your party with Yahoo! Invites.
> http://invites.yahoo.com/
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
> david@midrange.com
> +---
>
>
>
>
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
david@midrange.com
> +---


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.