Home > Available Help Files > PC-DMIS BASIC Language > Language Reference A – Z > Shell Function > Example - Shell Function
Current Help File: PC-DMIS Basic (View Core Help)
Example - Shell Function
' Calculator program included with Microsoft Windows; it then ' uses the SendKeys statement to send keystrokes to add some numbers. Sub Main () Dim I, X, Msg ' Declare variables. X = Shell("Calc.exe", 1) ' Shell Calculator.
For I = 1 To 5 ' Set up counting loop. SendKeys I & "{+}", True ' Send keystrokes to Calculator Next I ' to add each value of I.
AppActivate "Calculator" ' Return focus to Calculator. SendKeys "%{F4}", True ' Alt+F4 to close Calculator. End Sub