Question
· May 9, 2022

Convert %CharacterStream to JSON and JSON to %Stream.GlobalCharacter

Hi Guys,

Can you pls let me how to convert  %CharacterStream to JSON and also how to Convert JSON to  %Stream.GlobalCharacter?

 

Thanks

Product version: Ensemble 2014.1
Discussion (3)3
Log in or sign up to continue

Are you just trying to get the json contained in a character stream into a string a vice versa? If so, just read and write to and from the stream:

set json = ""
while 'stream.AtEnd
{
    set json = json_stream.Read()
}

That should get you the contents of the stream into a string.

do stream.Write(json)

That should write the json to a stream.

Or is that not what you're trying to do?