[ここをクリックすると内容が表示されます]
4.23で動作を確認しました。コード: 全て選択
#console
Sub a(b As String)
Print b+Ex"\na(Ex\q"+c(b)+Ex"\q)\nSleep(-1)"
End Sub
Function c(a As String) As String
Dim i As Long,j As Long,k=0 As Long,h As *Byte
j=Len(a)
h=calloc(j*2)
For i=0 To j
If a=10 then
h[k]=92
h[k+1]=110
k++
Else If a=34 then
h[k]=92
h[k+1]=113
k++
Else If a=92 then
h[k]=92
h[k+1]=92
k++
Else
h[k]=a
End If
k++
Next
c=MakeStr(h)
free(h)
End Function
a(Ex"#console\nSub a(b As String)\n Print b+Ex\q\\na(Ex\\q\q+c(b)+Ex\q\\q)\\nSleep(-1)\q\nEnd Sub\nFunction c(a As String) As String\n Dim i As Long,j As Long,k=0 As Long,h As *Byte\n j=Len(a)\n h=calloc(j*2)\n For i=0 To j\n If a=10 then\n h[k]=92\n h[k+1]=110\n k++\n Else If a=34 then\n h[k]=92\n h[k+1]=113\n k++\n Else If a=92 then\n h[k]=92\n h[k+1]=92\n k++\n Else\n h[k]=a\n End If\n k++\n Next\n c=MakeStr(h)\n free(h)\nEnd Function")
Sleep(-1)
どうやら定数文字列の文字数に何らかの制限がある模様で、それの回避に苦労しました。
誰かもっと短い奴か、又は異なる方法を用いた奴書いてください(メモリリークを無視するような短縮方法は遠慮してください)