Help with text array and newlines

teeterteeter Member Posts: 46
So I'm trying to have some kind of formatted body in an email I'm generating. I have an array of 6 text objects
EmailBody[1], EmailBody[2], etc.

I want these to be separated by a new line. How can I do this?

I've tried

BodyText := EmailBody[1]+ '\' +EmailBody[2]
BodyText := EmailBody[1]+ '/' +EmailBody[2]
BodyText := EmailBody[1]+ FORMAT(Char13) +FORMAT(Char10)+ +EmailBody[2]

and have also tried using the .AddBodyLine function with no success, as the .NewMessage seems to take priority.

Any thoughts, ideas, solutions?

Thanks in advance,

Joel

Answers

  • SavatageSavatage Member Posts: 7,142
    edited 2007-07-17
    do you get an error when you try the slash without the quotes?

    Why Add them together?
  • teeterteeter Member Posts: 46
    yeah a \ gives a syntax error, while / is trying to divide ;)

    The irony on this one is stifling as I just figured out how to use file paths WITHOUT creating newline #-o
  • SavatageSavatage Member Posts: 7,142
    perhaps you can see how it's done in the Format Address Codeunit (365)
    WITH BillOfLading DO
      FormatAddr(
        AddrArray,"Ship-to Name","Ship-to Name 2","Ship-to Contact",
        "Ship-to Address","Ship-to Address 2","Ship-to City",
        "Ship-to ZIP Code","Ship-to State","Ship-to Country Code");
    

    Even tho all these field are in an array , they print on seperate lines using the comma
    EmailBody[1],EmailBody[2],EmailBody[3],EmailBody[4],etc

    Look at COMPRESSARRAY in the c/side help for more info
  • teeterteeter Member Posts: 46
    I checked out the code unit, but IIRC its used in reporting, and you still have a text box for each element....however,

    :oops:
    I forgot to assign
    Char13 :=- 13;
    Char10 := 10;

    worked like a charm #-o

    Thanks for the help!

    its sooooo time for a beer
  • SavatageSavatage Member Posts: 7,142
    teeter wrote:
    its sooooo time for a beer

    I hear that! =P~
Sign In or Register to comment.