#182997 - 2007-11-28 05:18 PM
VB to Kix - Help!
|
n1st
Fresh Scripter
Registered: 2006-06-08
Posts: 14
|
Hi Folks,
I need to covert the following from vb to kix and haven't figured it out yet...
Set MySite = CreateObject("CuteFTPPro.TEConnection") MySite.Option("AutoCloseDelay") = 5
...If there wasn't the "= 5" at the end, I would do it like this... $MySite_AutoCloseDelay = $MySite.Option("AutoCloseDelay")
...but taking it 1 step further doesn't seem to work... $MySite_AutoCloseDelay = 5
Your thoughts please.
|
|
Top
|
|
|
|
#183007 - 2007-11-28 09:10 PM
Re: VB to Kix - Help!
[Re: n1st]
|
n1st
Fresh Scripter
Registered: 2006-06-08
Posts: 14
|
Update: I tried $MySite.Option("AutoCloseDelay").value = 5 and this didn't work, it just displayed 5 when I ran it.
Anybody?
|
|
Top
|
|
|
|
#183012 - 2007-11-28 11:20 PM
Re: VB to Kix - Help!
[Re: Lonkero]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
What does this return?
Break On
Dim $RC
$RC = SetOption('Explicit','On')
Dim $MySite
$MySite = CreateObject('CuteFTPPro.TEConnection')
'Error ' @ERROR ': ' @SERROR ?
Get $RC
|
|
Top
|
|
|
|
#183023 - 2007-11-29 02:29 AM
Re: VB to Kix - Help!
[Re: Witto]
|
n1st
Fresh Scripter
Registered: 2006-06-08
Posts: 14
|
When run, it generated...
Break On Dim $RC $RC = SetOption( ERROR : unknown command [Explicit]! Script: D:\ECG\Kix\source\SFTP4.kix Line : 4
After that line was commented out, it generated...
Break On Dim $RC Error 0: The operation completed successfully.
...so yes, I have no problem creating the object. I can do an operation like this: $MySite.Protocol = "SFTP"
But I can't assign a value to something like this: $MySite.Option("AutoCloseDelay") But it's easy in vbs: MySite.Option("AutoCloseDelay") = 5
Thanks.
Edited by n1st (2007-11-29 02:35 AM)
|
|
Top
|
|
|
|
#183063 - 2007-11-30 12:44 AM
Re: VB to Kix - Help!
[Re: Lonkero]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
It seems you can only Get the value for the AutoCloseDelay option and not Set it
Break On DIM $RC $RC = SetOption("Explicit", "On") DIM $MySite $MySite = CreateObject("CuteFTPPro.TEConnection") 'Error ' @ERROR ': ' @SERROR ? $MySite.Option("AutoCloseDelay") ? 'Error ' @ERROR ': ' @SERROR ? Get $RC |
Returns
Error 0: The operation completed successfully.
60
Error 0: The operation completed successfully.
Trying to Set the value by adding
| $MySite.Option("AutoCloseDelay") = 60 |
returns
AutoCloseDelay
ERROR : unexpected command!
Script: C:\Script\untitled.kix
Line : 10
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 483 anonymous users online.
|
|
|