Page 1 of 1

New version but old error not corrected? and new function not implemented.

Posted: Tue Jun 28, 2022 6:40 am
by peder udesen
Hi Scott

I have found out you have made a new version of CSVR4 that can handle UTF. Excellent.

But I have 2 questions.

1)
But when I'm looking in the source it looks like you haven't corrected an error that was reported in 2010:

Employee_ID,StateCode,FilingStatus
51,,
A1,TX,
B3,OK,S
The first 2 records will not return the correct number of fields, while the third one will.


Am I right?


2)
In 2009 you suggested a function to load a record from user-supplied string called CSV_loadbuffer().
The code was the following. But it seems you haven't implemented it in the new version.

Code: Select all

      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
      * CSV_loadrec(): Load a record from a delimited file into memory    
      *                                                                   
      *     peHandle = (i/o) handle to file returned by CSV_open()        
      *                                                                   
      * Returns *ON if successful, *OFF upon failure or EOF               
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
     P CSV_loadrec     B                   export                         
     D CSV_loadrec     PI             1N                                  
     D   peHandle                          like(CSV_HANDLE) value         
                                                                          
     D CSV             DS                  likeds(CSVFILE_t)              
     D                                     based(peHandle)                
                                                                          
     D p_buf           s               *                                  
     D len             s             10I 0                                
                                                                          
      /free                                                               
                                                                          
         %len(CSV.buf) = %size(CSV.buf) - VARPREF;            
                 %len(CSV.buf) = len;                            
                                                        
        if (%subst(CSV.buf : len : 1) = LINEFEED );     
           len = len - 1;                               
           %len(CSV.buf) = len;                         
        endif;                                          
                                                        
        if (%subst(CSV.buf : len : 1) = CARRTN );       
           len = len - 1;                               
           %len(CSV.buf) = len;                         
        endif;                                          
                                                        
        csv_rewindrec(peHandle);                        
                                                        
        return *ON;                                     
     /end-free                                          
    P                 E                                             
         
Regards
Peder

PS: I have pdf-files with the old entries from Systemi Networks Forum ( long gone ) but I'm not allowed to attach them.

Re: New version but old error not corrected? and new function not implemented.

Posted: Tue Jun 28, 2022 5:13 pm
by Scott Klement
I'm not familiar with CSV_loadbuffer, but there is an CSV_openbuf in the current release. Will that help?

Re: New version but old error not corrected? and new function not implemented.

Posted: Thu Jun 30, 2022 11:02 am
by peder udesen
Have you checked if the old bug has been fixed or still exists?

Regards
Peder

Re: New version but old error not corrected? and new function not implemented.

Posted: Thu Jun 30, 2022 11:07 am
by peder udesen
Please forgive me. I put the wrong source in the above example for CSV_loadbuffer()

Here it is:

Code: Select all

 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      
 * CSV_loadbuffer(): Load record from user-supplied string.            
 *                                                                     
 *     peHandle = (i/o) handle to file returned by CSV_open()          
 *        peBuf = (input) data to load into record buffer              
 *                                                                     
 * Returns *ON if successful, *OFF upon failure or EOF                 
 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      
P CSV_loadbuffer  B                   export                           
D CSV_loadbuffer  PI             1N                                    
D   peHandle                          like(CSV_HANDLE) value           
D   peBuf                    65502a   varying const options(*varsize)  
                                                                       
D CSV             DS                  likeds(CSVFILE_t)                
D                                     based(peHandle)                  
                                                                       
 /free                                                                 
    CSV.buf = peBuf;                                                   
    csv_rewindrec(peHandle);                                           
    return *ON;         
 /end-free 
P                                                         

Re: New version but old error not corrected? and new function not implemented.

Posted: Mon Jul 11, 2022 7:14 am
by peder udesen
Do any of you know if the old bug has been fixed in the new version?

Re: New version but old error not corrected? and new function not implemented.

Posted: Mon Jul 11, 2022 4:24 pm
by Scott Klement
CSV_loadbuffer was from a forum discussion, and has never officially been a part of the CSVR4 tool. Is this something you think should be added? If so, can you explain why you would use this instead of CSV_openBuf?

I don't agree with the other proposed change ("bug fix").

Re: New version but old error not corrected? and new function not implemented.

Posted: Mon Jul 18, 2022 8:00 am
by peder udesen
Thank you for your response. I didn't want to offend you.

Re: New version but old error not corrected? and new function not implemented.

Posted: Mon Jan 08, 2024 7:58 am
by sarika78
Hello guys
"I'm disappointed with the most
top followrecent update—anticipated new features are absent, and old faults still exist. It's annoying to see important problems disregarded in favor of improvements. Wishing for a speedy resolution and extensive enhancements in the upcoming release." ;) :(