|
You probably don't have all PTF's applied. Use parens around the right-side value and see if that fixes it. WorkString += (cBlanks + %TrimR(InParmList.ParmList(x))); -Bob Cozzi www.iSeriesTV.com iPod your industry news instead of reading it. Coming July 18, 2006 Ask your friends to tune into iSeriesTV.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan G. Campin Sent: Friday, July 07, 2006 11:12 AM To: rpg400-l@xxxxxxxxxxxx Subject: Nasty little problem I am writing that little command to build a command string but have run into a nasty little problem which blows my mind. I am receiving the string from the command like this InParmList Number of Entries 3 ParmList(1) = 'My Sister Sam ' ParmList(2) = 'A Value ' ParmList(3) = '00000125.24' Here is my code: d WorkString... d s 4096a Varying d x... d s Like(StdInt) d cBlanks... d s 2a /Free WorkString = 'CALL PGM(' + %TrimR(InProgramName.Library) + '/' + %TrimR(InProgramName.Program) + ') PARM('; // Add the parmeters in a loop. For x = 1 to InParmList.NumberOfEntries; If x = 1; WorkString += %TrimR(InParmList.ParmList(x)); Else; WorkString += cBlanks + %TrimR(InParmList.ParmList(x)); EndIf; EndFor; WorkString = %TrimR(WorkString) + ')'; Return WorkString; Now problem is that now matter how hard I try to insert a blank between the parms, it puts them together so I get: PARM('My Sister Sam ''My Value ''00000125.24') If I put another character like a '~', it works fine except if I try to convert to a blank. The second I convert it to a blank, it sucks up the blank. I can watch the string in the WDSC debugger and watch it transform instantly. What could be causing it to suck up the blanks? Have tried every kind of trick and it always sucks out the blanks. I am assuming it has something to do with the strings have quotes in them but can't figure what. Thanks for any help.
As an Amazon Associate we earn from qualifying purchases.
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.