$TEXT seems to be reading the TAB character (#9) as a SPACE (#32).
Here is the file DI.m, as displayed in the JOE editor. I contains leading TABS.
DI ;SFISC/GFT-DIRECT ENTRY TO VA FILEMAN ;2OCT2012
V ;;22.2V1;VA FILEMAN;;Jan 31, 2013
;Per VHA Directive 2004-038, this routine should not be modified.
;
G QQ:$G(^DI(.84,0))']""
C G QQ:$G(^DI(.84,0))']"" K (DTIME,DUZ) G ^DII
D G QQ:$G(^DI(.84,0))']"" G ^DII
P G QQ:$G(^DI(.84,0))']"" K (DTIME,DUZ)
Q G QQ:$G(^DI(.84,0))']"" S DUZ(0)="@" G ^DII
VERSION ;
S VERSION=$P($T(V),";",3),X=$P($T(V),";",4)_" "_VERSION Q
;
QQ ;
W $C(7),!!,"You must run ^DINIT first."
Q
When I copy the display from the console into this Email, it converts the TAB to spaces, but it is actually a TAB char. I highlighted the first several of them.
Here is screen shot of a hex editor with many (but not all) of the tab characters highlighted.
Here is a simple mumps routine that explores this routine
WRITE !!
NEW TEST SET TEST="AB "_$CHAR(9)_"CDE"
DO ASCIILINE(TEST)
WRITE "--------------",!
NEW TMGI
FOR TMGI=1:1:10 DO
. NEW LINE SET LINE=$TEXT(+TMGI^DI)
. WRITE LINE,!
. DO ASCIILINE(LINE)
QUIT
ASCIILINE(S) ;DUMP OUT FIRST FEW CHARACTERS OF INPUT AS ACII-CODE AND CHARACTER
NEW TMGJ
FOR TMGJ=1:1:10 DO
. NEW CH SET CH=$EXTRACT(S,TMGJ)
. WRITE "[",$ASCII(CH),"]",CH
WRITE !
QUIT
And here is it's output
ASTRON>do TESTTEXT^TMGFIX
[65]A[66]B[32] [9] [67]C[68]D[69]E[-1][-1][-1]
--------------
DI ;SFISC/GFT-DIRECT ENTRY TO VA FILEMAN ;2OCT2012
[68]D[73]I[32] [59];[83]S[70]F[73]I[83]S[67]C[47]/
V ;;22.2V1;VA FILEMAN;;Jan 31, 2013
[86]V[32] [59];[59];[50]2[50]2[46].[50]2[86]V[49]1
;Per VHA Directive 2004-038, this routine should not be modified.
[32] [59];[80]P[101]e[114]r[32] [86]V[72]H[65]A[32]
;
[32] [59];[-1][-1][-1][-1][-1][-1][-1][-1]
G QQ:$G(^DI(.84,0))']""
[32] [71]G[32] [81]Q[81]Q[58]:[36]$[71]G[40]([94]^
C G QQ:$G(^DI(.84,0))']"" K (DTIME,DUZ) G ^DII
[67]C[32] [71]G[32] [81]Q[81]Q[58]:[36]$[71]G[40](
D G QQ:$G(^DI(.84,0))']"" G ^DII
[68]D[32] [71]G[32] [81]Q[81]Q[58]:[36]$[71]G[40](
P G QQ:$G(^DI(.84,0))']"" K (DTIME,DUZ)
[80]P[32] [71]G[32] [81]Q[81]Q[58]:[36]$[71]G[40](
Q G QQ:$G(^DI(.84,0))']"" S DUZ(0)="@" G ^DII
[81]Q[32] [71]G[32] [81]Q[81]Q[58]:[36]$[71]G[40](
VERSION ;
[86]V[69]E[82]R[83]S[73]I[79]O[78]N[32] [59];[-1]
ASTRON>
Notice that my ASCIILINE() function works just fine when I manually create a string that contains a tab (#9), but that the line that is retrieved from $TEXT() does NOT contain a TAB!
Just in case anyone needs a reference of ASCII control characters, here is a table showing that #9 is a horizontal TAB
I looked up in the GT.m manual, here
And it doesn't given any hint of this behavior.
And my favorite "Mumps By Example" site, here
http://71.174.62.16/Demo/AnnoStd?Frame=Main&Edition=examples&Page=a107109#Def_0001doesn't give any hint of it either.
SO WHAT'S GOING ON???
Why is $TEXT() pulling in #9's and turning them to #32's ???
Thanks
Kevin