SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
VBS. Accessing JAL variable in VB Script

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
VBS. Accessing JAL variable in VB Script
Author Message
Sotiris Georgiou



Joined: 04 Nov 2004
Posts: 18

Post VBS. Accessing JAL variable in VB Script Reply with quote

Hi,

I am using the following VBS code:

sub main()

dim JALCommand

JALCommand = "Dim numr, number" & vbCrLf & "runandwait ""UFRECV -B411111 -V192.168.1.1 -Lufrecv.log -Nall -Pundif"", """", 0, numr"

JALScript.Execute JALCommand

JALSCRIPT.Execute "Dim numr, number" & vbCrLf & "processgetexitcode numr"

if(numr = 0) then

JALCommand = "Dim numr, number" & vbCrLf & "runandwait ""EXE3IN -IINTEMPITF.TMP -Lepin.log -DC:\EPWIN303\EPSERVER\411111"", """", 0, numr"

JALScript.Execute JALCommand

JALSCRIPT.Execute "Dim numr, number" & vbCrLf & "processgetexitcode numr"

end if

end sub

I want to use the value of the JAL variable "numr" in VBS.
How do I transfer this accross from JAL
to VBS in the script above??

Thanks
Sotiris

Fri Nov 05, 2004 8:15 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: VBS. Accessing JAL variable in VB Script Reply with quote

You can save the value of this variable to a .INI file or simply to a text file and then read it from VBS.

I would like to suggest a better solution since you only make cross-language call to run a process and then wait for it.
Recent versions of 24x7 include VBS extension objects, one of them provides to VBS native RunAndWait method.

Here is a copy&paste from the on-line help. For more info see "VBScript RunAndWait method" topic in the on-line help (click the Examples buttons while in that topic).

'Sub Main()
' Dim vb24x7
' Set vb24x7 = CreateObject("vb24x7.Process")
' ProcessId = vb24x7.RunAndWait("Notepad.exe", 50)
' If ProcessId < 0 Then MsgBox("Unable to start process. " & vb24x7.LastError)
' Set vb24x7 = Nothing
'End Sub

: Hi,

: I am using the following VBS code: sub main()

: dim JALCommand

: JALCommand = "Dim numr, number" & vbCrLf & "runandwait
: ""UFRECV -B411111 -V192.168.1.1 -Lufrecv.log -Nall
: -Pundif"", """", 0, numr"

: JALScript.Execute JALCommand

: JALSCRIPT.Execute "Dim numr, number" & vbCrLf &
: "processgetexitcode numr"

: if(numr = 0) then

: JALCommand = "Dim numr, number" & vbCrLf & "runandwait
: ""EXE3IN -IINTEMPITF.TMP -Lepin.log
: -DC:\EPWIN303\EPSERVER\411111"", """", 0,
: numr"

: JALScript.Execute JALCommand

: JALSCRIPT.Execute "Dim numr, number" & vbCrLf &
: "processgetexitcode numr"

: end if

: end sub

: I want to use the value of the JAL variable "numr" in VBS.
: How do I transfer this accross from JAL
: to VBS in the script above??

: Thanks
: Sotiris

Fri Nov 05, 2004 10:12 am View user's profile Send private message
Sotiris Georgiou



Joined: 04 Nov 2004
Posts: 18

Post Re: VBS. Accessing JAL variable in VB Script Reply with quote

Thanks again. The RunAndWait method works as you
propose.

I also need to get back the result of running
the command by RunAndWait. This I did in JAL
using ProcessGetExitCode.

Is there a way to do this in VBS?

Thanks
Sotiris

: You can save the value of this variable to a .INI file or simply to a text
: file and then read it from VBS.

: I would like to suggest a better solution since you only make cross-language
: call to run a process and then wait for it.
: Recent versions of 24x7 include VBS extension objects, one of them provides
: to VBS native RunAndWait method.

: Here is a copy&paste from the on-line help. For more info see "VBScript
: RunAndWait method" topic in the on-line help (click the Examples
: buttons while in that topic).

: 'Sub Main()
: ' Dim vb24x7
: ' Set vb24x7 = CreateObject("vb24x7.Process")
: ' ProcessId = vb24x7.RunAndWait("Notepad.exe", 50)
: ' If ProcessId < 0 Then MsgBox("Unable to start process. " &
: vb24x7.LastError)
: ' Set vb24x7 = Nothing
: 'End Sub

Fri Nov 05, 2004 12:20 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: VBS. Accessing JAL variable in VB Script Reply with quote

The is no matching method available in VBScript at this time.

: Thanks again. The RunAndWait method works as you
: propose.

: I also need to get back the result of running
: the command by RunAndWait. This I did in JAL
: using ProcessGetExitCode.

: Is there a way to do this in VBS?

: Thanks
: Sotiris

Fri Nov 05, 2004 1:15 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.