Privat erkan kaplan Eval Funktion

From NSB App Studio
Jump to navigation Jump to search
  • Eval()

The Eval() function executes a JavaScript string. Consider the following:

For i= 1 To 3
  myControl = Eval("Button" + i)
  Print myControl.value
Next


Rem Constant Variables
Dim c1
c1=10           
     
Function Hesapla(controlNr)
  Dim iTop, iLeft, iWidth, iHeight, iMiddle
  iTop = Eval("btn"&controlNr).Top               '300
  iLeft = Eval("btn"&controlNr).Left             '50
  iWidth = Eval("btn"&controlNr).Width           '100
  iHeight = Eval("btn"&controlNr).Height         '30
  iMiddle = iLeft+(iWidth/2)      '101
  
  Icon.Left = (iMiddle-(Icon.Width/2))
  Icon.Top = (iTop-c1)-Icon.Height 
End Function

Function btn1_onclick()
  Call Hesapla("1")     'btn1
End Function

Function btn2_onclick()
    Call Hesapla("2")     'btn2
End Function