Skip to main content
Hi Everyone,
I have encountered some unexpected behavior using the SPLICE function.  I'm hoping someone can tell me what I'm missing.
I'm on UniVerse 11.1.9 (yeah, i know it's old) running on Linux. 

Consider the following code.
ARRAY1 = 'ONE'
ARRAY2 = CHAR(246):CHAR(247):CHAR(248):CHAR(249):CHAR(250)
CRT
CRT 'System Delimiters'
CRT 'CHAR(251) = ':CHAR(251)
CRT 'CHAR(252) = ':CHAR(252)
CRT 'CHAR(253) = ':CHAR(253)
CRT 'CHAR(254) = ':CHAR(254)
CRT 'CHAR(255) = ':CHAR(255)
CRT
CRT 'ARRAY1 = ':ARRAY1
CRT 'ARRAY2 = ':ARRAY2
CRT
CRT 'Expected = ONE:':ARRAY2
CRT 'Actual   = ':SPLICE(ARRAY1, ':', ARRAY2)​


Here is a screenshot of the output.

Notice all the colon (":") characters.  Notice also that char(247) seems to have been changed to char(255).
What is going on here?
Hi Everyone,
I have encountered some unexpected behavior using the SPLICE function.  I'm hoping someone can tell me what I'm missing.
I'm on UniVerse 11.1.9 (yeah, i know it's old) running on Linux. 

Consider the following code.
ARRAY1 = 'ONE'
ARRAY2 = CHAR(246):CHAR(247):CHAR(248):CHAR(249):CHAR(250)
CRT
CRT 'System Delimiters'
CRT 'CHAR(251) = ':CHAR(251)
CRT 'CHAR(252) = ':CHAR(252)
CRT 'CHAR(253) = ':CHAR(253)
CRT 'CHAR(254) = ':CHAR(254)
CRT 'CHAR(255) = ':CHAR(255)
CRT
CRT 'ARRAY1 = ':ARRAY1
CRT 'ARRAY2 = ':ARRAY2
CRT
CRT 'Expected = ONE:':ARRAY2
CRT 'Actual   = ':SPLICE(ARRAY1, ':', ARRAY2)​


Here is a screenshot of the output.

Notice all the colon (":") characters.  Notice also that char(247) seems to have been changed to char(255).
What is going on here?
This does seem to be in contradiction to what I can find in the documentation.  If you try doing a LOWER or a RAISE on ARRAY2, that also changes the array.  So clearly UniVerse is treating some of those characters as if they were system delimiters.  (BTW - I'm not using NLS, and I assume you're not either.)

... I dug a bit more into the documentation, and it appears that CHARs 248-250 are treated like text-marks (e.g. LOWER, RAISE, REMOVE).  I guess I never realized this, but it does seem to be a thing.

... Just looked at the BYTETYPE function and sure enough, 248-250 return a type of 5, which means "system delimiter".
Hi Everyone,
I have encountered some unexpected behavior using the SPLICE function.  I'm hoping someone can tell me what I'm missing.
I'm on UniVerse 11.1.9 (yeah, i know it's old) running on Linux. 

Consider the following code.
ARRAY1 = 'ONE'
ARRAY2 = CHAR(246):CHAR(247):CHAR(248):CHAR(249):CHAR(250)
CRT
CRT 'System Delimiters'
CRT 'CHAR(251) = ':CHAR(251)
CRT 'CHAR(252) = ':CHAR(252)
CRT 'CHAR(253) = ':CHAR(253)
CRT 'CHAR(254) = ':CHAR(254)
CRT 'CHAR(255) = ':CHAR(255)
CRT
CRT 'ARRAY1 = ':ARRAY1
CRT 'ARRAY2 = ':ARRAY2
CRT
CRT 'Expected = ONE:':ARRAY2
CRT 'Actual   = ':SPLICE(ARRAY1, ':', ARRAY2)​


Here is a screenshot of the output.

Notice all the colon (":") characters.  Notice also that char(247) seems to have been changed to char(255).
What is going on here?
From what I can tell, the SPLICE function will consider CHAR(247) and higher as a delimiter characters.
And it has apparently always behaved in this manner. Not sure if this was done for compatibility with another MV database.
I'm not sure why the CHAR(247) gets converted to CHAR(255) and will need to do some more research on that behavior.
Hi Everyone,
I have encountered some unexpected behavior using the SPLICE function.  I'm hoping someone can tell me what I'm missing.
I'm on UniVerse 11.1.9 (yeah, i know it's old) running on Linux. 

Consider the following code.
ARRAY1 = 'ONE'
ARRAY2 = CHAR(246):CHAR(247):CHAR(248):CHAR(249):CHAR(250)
CRT
CRT 'System Delimiters'
CRT 'CHAR(251) = ':CHAR(251)
CRT 'CHAR(252) = ':CHAR(252)
CRT 'CHAR(253) = ':CHAR(253)
CRT 'CHAR(254) = ':CHAR(254)
CRT 'CHAR(255) = ':CHAR(255)
CRT
CRT 'ARRAY1 = ':ARRAY1
CRT 'ARRAY2 = ':ARRAY2
CRT
CRT 'Expected = ONE:':ARRAY2
CRT 'Actual   = ':SPLICE(ARRAY1, ':', ARRAY2)​


Here is a screenshot of the output.

Notice all the colon (":") characters.  Notice also that char(247) seems to have been changed to char(255).
What is going on here?
@Tyrel Marak Correct. Not using NLS.  I forgot to mention that.

@Neil Morris Fascinating.  If you find anything interesting, i'm looking forward to hearing it.  Otherwise no worries.​​