AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Concatenating Text using ^JOIN results in extra spaces when using output macros
 
 

Bruce,

I would like to be able to use the results of an output macro in a ^JOIN function without using a match variable and without getting extra spaces in the results.  I would like the Test1 logic to result in the same output as the test 3 logic below.  Please let me know if there is an alternative syntax to what I am using.

outputmacro: ^TEST()
        $$Answer = ^JOIN(4 _ 5)
        $$Answer

s: (test concatenation) ^noerase() ^repeat()
  \n
  ^join(Test1: _ 1 _ 2 _ 3 _ ^TEST()) \n
  ^join(Test2: _ 1 _ 2 _ 3 ^TEST()) \n
  _4 = ^TEST()
  ^join(Test3: _ 1 _ 2 _ 3 _ _4) \n

OUTPUT:
alaric:_> test concatenation
HARRY:_
Test1: 1 2 3   4 5
Test2: 1 2 3 4 5
Test3: 1 2 3 4 5

Thanks!

 

 
  [ # 1 ]

OK. I have fixed a bug in calling functions which would create the extra space.
So output would now be:
Test1: 1 2 3 4 5
Test2: 1 2 34 5
Test3: 1 2 3 4 5

You can patch your code temporarily to not call the function, but store it on a variable
$$tmp = ^test()
^join(Test1: _ 1 _ 2 _ 3 _ $$tmp)

 

 
  login or register to react