Converting List to Printable Container

Hi,

I know I am probably missing the obvious here but hope I can get a little help.

I have trapped errors in a list using an agent to import some Excel data. Would like to print the list in a Message box window such that ALL the errors are seen together in one window. Tried the code below but get ‘Type Mismatch’ when try to save it.

Msgbox “Got error Type” & Cstr (errlist) & " Stopped processing", MB_OK, “ERROR”

I know I can cycle thru each error but would rather move the data to some other container that can be displayed in one Message window.

Anyone have any ideas on how to do this?

Thanks in advance,

Tim

Subject: Converting List to Printable Container

How are you building errlist?What does errlist look like in the debugger?

When I want to collect stuff and display a single message I’ll do something like

tmp = tmp & CRLF & currentError

Where CRLF is defined elsewhere for carriage return and line feed. In this way, I’m just building a string.

HTH

Doug

Subject: RE: Converting List to Printable Container

I am doing pretty much the same thing you did - only with a list. Below is the code:

    errList (Cstr (idx)) = Cstr (Error) + " - - - " + Cstr (row)

idx = idx + 1

Will look closer at your technique.

But can you answer my original question. Is there a ‘container’ that you can put a list in that can be printed (shown in a Message window) so see the entire list?

Thanks very much for the help,

Tim

Subject: Converting List to Printable Container

Tim,No, there is nothing into which you can put a list for display. You will need to first convert it (using Forall) to a string or an array. Or, you could capture it in a string or an array in the first place. But a list is usable only within LS.

regards,

Andrew

Subject: RE: Converting List to Printable Container

Thanks Andrew. That is not the answer I wanted to hear but it is the answer I was looking for.

I will probably use one of the previous recommendations to accomplish what I need to do.

Thanks again,

Tim

Subject: Converting List to Printable Container

It looks like there is a space in your Cstr (errlist). I don’t think that will work.

Subject: RE: Converting List to Printable Container

Sam,

Thanks for the response. But the space is not the problem. Get same error even when take out space.

Error says ‘Type Mismatch’ on errlist.

Tim

Subject: Converting List to Printable Container

Try the Join function? Take a peek in help on how it works, but basically its like an @Implode…

I use Join() and Split() all the time now when I need to move strings from one value to an array and back again…

Subject: RE: Converting List to Printable Container

Tried both the Join and Split and got errors when tried to save agent. Seems like they both do not work with LISTS.

If you know something besides what is in Notes help please respond here.

Thanks,

Tim