Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Concatenation problem...

19 views
Skip to first unread message

Ron Millard

unread,
Sep 2, 2010, 12:39:33 PM9/2/10
to
I have a file where as I read multiple records for a person I wish to
concatenate one field from each record into a string. The field is
CUR:SpeakingDate and a local variable AllSpeakingDates (string 56).

I have the following statement:
AllSpeakingDates = CUR:SpeakingDate & ', ' & AllSpeakingDates

AllSpeakingDates should be collecting and concatenating all CUR:SpeakingDate
occurrences but I only end up with one CUR:SpeakingDate in the
AllSpeakingDates variable. I tried the inverse:
AllSpeakingDates = AllSpeakingDates & ', ' & CUR:SpeakingDate but it still
doesn't work--only one date shows up in the string and the ', ' never
appears.

This looks so simple but I'm missing something. The code for reading the
records is OK because I have a STOP statement showing the values in
CUR:SpeakingDate after each read.

What am I missing here?

Andy <<Cowboy>> Stapleton

unread,
Sep 2, 2010, 12:51:06 PM9/2/10
to
clip the 2 fields....

> AllSpeakingDates = Clip(CUR:SpeakingDate) & ', ' & Clip(AllSpeakingDates)

--
Andy <<cowboy>> Stapleton
www.ccscowboy.com
twitter: ccscowboy

"Ron Millard" <ron_norm...@verizon.net> wrote in message
news:A921.12834...@discuss.softvelocity.com...

Lee White

unread,
Sep 2, 2010, 12:51:09 PM9/2/10
to
Ron,

Assuming CUR:SpeakingDate is much shorter than 56 characters!<g>

> AllSpeakingDates = CUR:SpeakingDate & ', ' & AllSpeakingDates

Should work, if the assumption above is correct.

> AllSpeakingDates = AllSpeakingDates & ', ' & CUR:SpeakingDate

This will work if AllSpeakingDates is CSTRING(57)

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

Jon Waterhouse

unread,
Sep 2, 2010, 9:32:58 PM9/2/10
to
Try looking at the code that is created.

I think what is happening is that AllSpeakingDates becomes a column in your
browse queue (as you want), so on each row, Allspeakingdates gets
CUR:SpeakingDate added to it, then it gets put in the queue. I think it then
goes back (the queue column) to having a NULL value when you get to the next
row. I'm not sure it has an independent existence.

However, it sounds like your browse would be strange anyway....if your
person had gigs on tuseday, thursday and friday, according to your desired
logic, the first row would show up as tuesday, the second as
tuesday,thursday and the final as tuesday, thursday, friday....

HTH,

Jon

"Ron Millard" <ron_norm...@verizon.net> wrote in message
news:A921.12834...@discuss.softvelocity.com...

Bjarne Havnen - AdiTech as

unread,
Sep 3, 2010, 4:07:20 AM9/3/10
to
On 2 Sep 2010 12:39:33 -0400, "Ron Millard" <ron_norm...@verizon.net> wrote:

>I have a file where as I read multiple records for a person I wish to
>concatenate one field from each record into a string. The field is
>CUR:SpeakingDate and a local variable AllSpeakingDates (string 56).
>
>I have the following statement:
>AllSpeakingDates = CUR:SpeakingDate & ', ' & AllSpeakingDates


The STRING is padded with spaces and has fixed length. The spaces in CUR:SpeakingDate is copied to AllSpeakingDates, leaving no room for the rest.

Either use CSTRING or CLIP() the STRING to remove the spaces before assigning.

Bjarne

Carl W. Sumner

unread,
Sep 3, 2010, 12:21:31 PM9/3/10
to
Also note that even Cstrings can have spaces at the end, particularly
if they were copied from Strings at some point. You might need to
Clip() anyway.

HTH,

Carl Sumner

On 3 Sep 2010 04:07:20 -0400, Bjarne Havnen - AdiTech as

Paul

unread,
Sep 5, 2010, 12:19:47 PM9/5/10
to
Thanks for the subtle issue reminder Carl.

I can see this one consuming tons of time and hair finding it.

Best Regards,
Paul

On 9/3/2010 9:21 AM, Carl W. Sumner wrote:
> Also note that even Cstrings can have spaces at the end, particularly
> if they were copied from Strings at some point. You might need to
> Clip() anyway.
>
> HTH,
>
> Carl Sumner
>
> On 3 Sep 2010 04:07:20 -0400, Bjarne Havnen - AdiTech as
> <hav...@aditech.no> wrote:
>
>> On 2 Sep 2010 12:39:33 -0400, "Ron Millard"<ron_norm...@verizon.net> wrote:
>>
>>> I have a file where as I read multiple records for a person I wish to
>>> concatenate one field from each record into a string. The field is
>>> CUR:SpeakingDate and a local variable AllSpeakingDates (string 56).
>>>
>>> I have the following statement:

>>> AllSpeakingDates = CUR:SpeakingDate& ', '& AllSpeakingDates


>>
>>
>> The STRING is padded with spaces and has fixed length. The spaces in CUR:SpeakingDate is copied to AllSpeakingDates, leaving no room for the rest.
>>
>> Either use CSTRING or CLIP() the STRING to remove the spaces before assigning.
>>
>> Bjarne
>>
>>
>>
>>>
>>> AllSpeakingDates should be collecting and concatenating all CUR:SpeakingDate
>>> occurrences but I only end up with one CUR:SpeakingDate in the
>>> AllSpeakingDates variable. I tried the inverse:

>>> AllSpeakingDates = AllSpeakingDates& ', '& CUR:SpeakingDate but it still

Ron Millard

unread,
Sep 5, 2010, 3:36:01 PM9/5/10
to
Thank you all! CString with CLIP did the trick!

"Ron Millard" <ron_norm...@verizon.net> wrote in message
news:A921.12834...@discuss.softvelocity.com...

0 new messages