How do I convert a Variant (bigger than 1024 chars) to Text?

lollygaglollygag Member Posts: 7
Hi

I have read text from an automation into a variant variable because it would overflow a text variable.
What I want to do is just convert the fist part of the text (truncate) into a text variable so that I can read it.

Has anyone got any ideas how to do this.

I have an idea that it may be with a stream? But I'm not really sure.

Any ideas/suggestions very welcome.

Cheers

Comments

  • VjekoVjeko Member Posts: 55
    I'm not 100% sure here, but you may try using a bigtext variable, and then do ADDTEXT over the variant variable.
    // big = BigText
    // v = Variant
    big.ADDTEXT(v);
    

    This might fail, however, because your variant doesn't actually hold a text variable. Can you replace the variant with the bigtext in the first place? Depending on how you populate the value of the variant, it might be possible to simply replace it with a bigtext. This works quite nice in .NET interop, I am not sure about automation, though.
    (Co-)author of "Implementing Microsoft Dynamics NAV 2009"
    http://vjeko.com/
Sign In or Register to comment.