VBScript içinde function nasil kullanilir?

Katılım
25 Mart 2023
Mesajlar
552
Makaleler
1
Çözümler
3
Yer
Türkmenistan
Daha fazla  
Cinsiyet
Erkek
Meslek
Ögrenci programmist(programci, yazilimci), 3DS MAX ögrencisi
Selam herkese. Ben Visual Basic 6.0 da bir program yapiyorum. Bu programda msscript.ocx - activex dosyasini kullaniyorum. Bu ActiveX dosyasi VBScript kullanmayi sagliyor. Ben VBScript icinde kendi olusturdugum functionlari kullanmak istiyorum. Bu konuda bilgisi olanlar varsa yardim eder misiniz?

VBScript calistirirken textbox da bulunan kodlar calistiriliyor. Kendimden function olusturup VBScripte enjekte etmeye calistim ama hata veriyor.

Resim

Kod:
Private Sub Command1_Click()
Script.Reset
Script.AddCode "Sub Command1_Click()" & vbNewLine & Text1.Text & vbNewLine & "End Sub"
Script.Run "Command1_Click"
Kodlar1.HabarDialogy "Kompyuter", "Salam"
End Sub

Private Sub Command2_Click()
Script.Reset
Script.AddCode "Function Kod" & vbNewLine & Text1.Text & vbNewLine & "End function"
Script.Run "Kod"
Kodlar1.HabarDialogy "Kompyuter", "Salam"
End Sub

Private Sub Cyk_Click()
End
End Sub

Private Sub Form_Load()
Script.AddObject "IseGoyber", IseGoyber
Script.AddObject "Command1", Command1
Script.AddObject "Kodlar1", Kodlar1
Script.AddObject "Form1", Form1
End Sub

Private Sub Form_Resize()
Text1.Height = Form1.Height
Text1.Width = Form1.Width
End Sub

Private Sub IseGoyber_Click()
Command2_Click
End Sub

Private Sub ProgrammaBarada1_Click()
ProgrammaBarada.Show
End Sub

Private Sub Script_Error()
MsgBox "Kodda Yalnyslyklar bar!", vbInformation, "Compiler"
End Sub

Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then PopupMenu Redaktirle
End Sub
 

Dosya Ekleri

  • vbs.PNG
    vbs.PNG
    5,9 KB · Görüntüleme: 21
Son düzenleme:

Technopat Haberler

Yeni konular

Geri
Yukarı