I have an issue with pasting the clipboard. My code to comment other code with Ctrl-k almost works but pasting the result gives incorrect output.
I have this code:
Code: Select all
^k::
{
clipboard =
Send ^c
ClipWait, 1
if ErrorLevel <> 0
return
NewClip =
WaitingForFirstCharOfLine = y
AutoTrim, off
nLines:= CountLines(clipboard)
if(nLines = 1)
{
ss = % Substr( clipboard, 1, 1 )
If ( ss = "#" )
SendInput, {Home}{#}
Else
SendInput, {Home}{#}{Space}
}
else
{
NewClip = `#
Loop, parse, clipboard
{
if A_LoopField = `n
NewClip = %NewClip%%A_loopField%
else
NewClip = %NewClip%%A_LoopField%
}
clipboard = %NewClip%
msgbox %NewClip%
Send ^v
}
}
Code: Select all
If( DimensionExists( pDim ) > 0 );
vDim = Dimnm( '}Dimensions', Dimix( '}Dimensions', pDim ));
DimensionElementInsertDirect( vTempDimForDims, '', vDim, 'N' );
ElseIf( CubeExists( pDim ) > 0 );
Code: Select all
# If( DimensionExists( pDim ) > 0 );
#
# vDim = Dimnm( '}Dimensions', Dimix( '}Dimensions', pDim ));
# DimensionElementInsertDirect( vTempDimForDims, '', vDim, 'N' );
#
# ElseIf( CubeExists( pDim ) > 0 );
With msgbox I can see that the clipboard is fine but pasting the result fails. The result does not include the # character and removes spaces.
See 3 pictures attached please.
Wim