Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2017, 03:18 PM
vensas3181 vensas3181 is offline
Registered User
 
Join Date: May 2017
Posts: 11
Calling function within functions and/or loop conditions.

Hi There,

Can we call other loop condition with in first loop condition and/or if condition
Example,

If InStr(nProcesses,"CXL") <> 0 Then
ObjStream.WriteLine " Cancel Reservations: " & nProcesses
ObjStream.WriteLine " "
CreateObject("WScript.Shell").Popup nProcesses, 1, nProcesses
**call xyz
crt.Screen.Send chr(27) & "D"
Else if InStr(nProcesses,"C/O") <> 0 then
ObjStream.WriteLine " Check Out Reservations: " & nProcesses
ObjStream.WriteLine " "
CreateObject("WScript.Shell").Popup nProcesses, 1, nProcesses
crt.Screen.Send chr(27) & "D"
Else
ObjStream.WriteLine " Reservations: " & nProcesses
ObjStream.WriteLine " "
CreateObject("WScript.Shell").Popup nProcesses, 1, nProcesses
crt.Screen.Send chr(27) & "D"
End If
End If


Function xyz***

Statement line1
Statement line2
Statement linen

End sub


Can I call function xyz in any of the if condition ? if yes how to call that? does code require any exceptions need to provide.
Reply With Quote
  #2  
Old 05-26-2017, 04:24 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi vensas3181,

I've included an example of calling a function.

Code:
# $language = "VBScript"
# $interface = "1.0"
Dim strInput
Sub Main()
	
	strInput = crt.Dialog.Prompt("Enter Value", "Value", "")
	xyz
    
End Sub


Function xyz()

	crt.Dialog.MessageBox("This is inside the function." & vbcrlf & vbcrlf & strInput )

End Function
A function can be called from inside a Loop or If statement.

Does this help?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 04:18 AM.