'Bu script input box görüntüleyerek kullanıcının girdiği değeri Tag'a yazar.
Imports System 'Gerekli classlar script'e dahil ediliyor.
Imports System.IO
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Namespace WinTr
Public Class MainClass
Public Tag_1 As Uint16 'WinTr tag değişkeni tanımlanıyor
Public Sub Load
'------- Script Start Line -------
Try
Dim myValue As Object
'Ekran klavyesi başlatılıyor
System.Diagnostics.Process.Start("osk") 'On screen key board open
'Input box, içerisinde Tag_1 in değeriyle görüntüleniyor.
Again: myValue = InputBox( "Please enter the Tag value and press 'OK'","Input Value", Tag_1)
If myValue = "" Then 'Eğer boş değer girilmişse
Exit Sub 'Prosedürden çıkılıyor.
End If
If isnumeric(myValue) = True then 'Girilen değer nümerikse
If myValue > 0 and myValue <= 100 Then 'girilen değer 0 ile 100 arasındaysa
Tag_1 = myValue 'Değeri Tag_1'e ata
Else
MsgBox("Value can be a number between 0 and 100")
Goto Again 'Again etiketli kod satırına git
End If
Else
MsgBox("Value can only be a number")
Goto Again
End If
Catch ex As Exception
MessageBox.Show(Ex.ToString,Ex.Message)
End Try
'------- Script End Line -------
End Sub
End Class
End Namespace