LoginSignup
0
0

More than 5 years have passed since last update.

smallbasicでcsc

Posted at

smallbasicから、C#をコンパイルします。
自前のエクステンション使います。

サンプル

GraphicsWindow.BackgroundColor = "skyblue"
button = Controls.AddButton("run", 200, 100)
Controls.ButtonClicked = onclick
Sub onclick
  C = Text.GetCharacter(34)
  R = Text.GetCharacter(13) + Text.GetCharacter(10)
  code = ""
  code = code + "Function setup(a)" + R 
  code = code + "csc = " + C + "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" + C + R
  code = code + "src = " + C + "D:\hello.cs" + C + R
  code = code + "Set obj = CreateObject(" + C + "WScript.Shell" + C + ")" + R
  code = code + "Set ex = obj.Exec(csc & " + C + " " + C + " & src)" + R
  code = code + "str = " + C + C + R
  code = code + "Do" + R
  code = code + "str = str & ex.StdOut.ReadAll" + R
  code = code + "Loop While ex.Status = 0" + R
  code = code + "msgbox str" + R
  code = code + "setup = str" + R
  code = code + "End Function" + R
  a = Class1.VBSrun(code)
EndSub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0