thementornetwork
MIS
2 fields (can be one or more value each delimited with an '&' sign):
- Service Code (string)
ie. 100&200&CH&400&TV
- Service Description (string)
ie. Laundry&Plumbing&Cable and Heat&Wireless&Television
Known facts:
1) # of Service Description = # of Service Codes
2) 1st Service Description matches 1st Service Code, 2nd Service Description matches 2nd Service Code, etc.
I would like to combine these 2 strings to create one single string that would display like:
(100) Laundry
(200) Plumbing
(CH) Cable and Heat
(400) Wireless
(TV) Television
My code:
==========================================================
whileprintingrecords;
StringVar Array ServiceCodeVar;
StringVar Array ServiceDescVar;
StringVar Service;
NumberVar Counter;
ServiceCodeVar := Split({table.service_codes}, "&");
UBound(ServiceCodeVar);
ServiceDescVar := Split({table.service_desc}, "&");
UBound(ServiceDescVar);
For Counter:= 1 to UBound(ServiceCodeVar) do
(
Service:= "(" + ServiceCodeVar[Counter] + ") " + ServiceDescVar[Counter] + chr(10);
);
Service;
===========================================================
Unfortunately this formula I wrote did not seem to loop through all the elements, it only shows the last element on the report:
(TV) Television
Any help will be appreciated. Thanks!
- Service Code (string)
ie. 100&200&CH&400&TV
- Service Description (string)
ie. Laundry&Plumbing&Cable and Heat&Wireless&Television
Known facts:
1) # of Service Description = # of Service Codes
2) 1st Service Description matches 1st Service Code, 2nd Service Description matches 2nd Service Code, etc.
I would like to combine these 2 strings to create one single string that would display like:
(100) Laundry
(200) Plumbing
(CH) Cable and Heat
(400) Wireless
(TV) Television
My code:
==========================================================
whileprintingrecords;
StringVar Array ServiceCodeVar;
StringVar Array ServiceDescVar;
StringVar Service;
NumberVar Counter;
ServiceCodeVar := Split({table.service_codes}, "&");
UBound(ServiceCodeVar);
ServiceDescVar := Split({table.service_desc}, "&");
UBound(ServiceDescVar);
For Counter:= 1 to UBound(ServiceCodeVar) do
(
Service:= "(" + ServiceCodeVar[Counter] + ") " + ServiceDescVar[Counter] + chr(10);
);
Service;
===========================================================
Unfortunately this formula I wrote did not seem to loop through all the elements, it only shows the last element on the report:
(TV) Television
Any help will be appreciated. Thanks!