× 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.



Hi,

according to the RPG manuals, %LEN returns the actual data length for
variable-lenght fields only. Your code would work, if you specify keyword
VARYING for field SndMsg. For non-variable-length fields, you just get the
specified field length.

Regards,
Werner Noll

-----Ursprüngliche Nachricht-----
Von: michael@xxxxxxxxxxxxxxxxxx [mailto:michael@xxxxxxxxxxxxxxxxxx]
Gesendet: Mittwoch, 8. September 2004 15:21
An: midrange-l
Betreff: %Len problem


   What's up with this? Here's the definition of a couple of fields...

   D SndMsg          S            100  
   D SndMsgSize      S             10U 0
   Here's the calc...
    
   C                   Eval      SndMsgSize = %Len(%Trim(SndMsg))
    
   and here's what I see in debug...

   EVAL SndMsgSize                                                        
   SNDMSGSIZE = 000000100.                                                
   EVAL SndMsg                                                            
   SNDMSG =                                                              
            ....5...10...15...20...25...30...35...40...45...50...55...60
       1   'yada                                                        '
      61   '                                        '                    
    
   I would expect to see SNDMSGSIZE = 0000000004.
    
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.