Page 1 of 1 1
Topic Options
#182997 - 2007-11-28 05:18 PM VB to Kix - Help!
n1st Offline
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 Offline
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
#183010 - 2007-11-28 10:49 PM Re: VB to Kix - Help! [Re: n1st]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not supported would be my answer.
_________________________
!

download KiXnet

Top
#183012 - 2007-11-28 11:20 PM Re: VB to Kix - Help! [Re: Lonkero]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
What does this return?
 Code:
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 Offline
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
#183027 - 2007-11-29 03:51 AM Re: VB to Kix - Help! [Re: n1st]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it's the old property method thingie.

as far as I know, kixtart still doesn't support property-methods.
that is, a method that can be feeded a value.

some com-objects let you overcome that by having something like .value property to play with. like excel. But if you can't find that kinda thing in the cuteFTP com docs, I bet you are out of luck.
_________________________
!

download KiXnet

Top
#183063 - 2007-11-30 12:44 AM Re: VB to Kix - Help! [Re: Lonkero]
Witto Offline
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
 Code:
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
 Code:
AutoCloseDelay
ERROR : unexpected command!
Script: C:\Script\untitled.kix
Line  : 10

Top
#183102 - 2007-11-30 07:32 PM Re: VB to Kix - Help! [Re: Witto]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
just like I said.
$mysite.option() looks like a method/function to kixtart.

and thus the "AutoCloseDelay" is the argument, input for it.
when you then add the "= 60" to the end, kixtart doesn't get it.

but. there is a catch.
it behaves really badly.
when you parse this in your mind, kixtart actually SHOULD translate it like:
get method value for $MySite.Option("AutoCloseDelay")
then compare it with 60

and that should not return the error you got there.
so, either there is a parser bug or Ruud has tried to implement that stuff and failed, thus causing a bug in the parser.

hey, it's a bug, again.
_________________________
!

download KiXnet

Top
#183103 - 2007-11-30 07:48 PM Re: VB to Kix - Help! [Re: Lonkero]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I may be way off base but ISTR that some COM objects had a workaround for KiX by keeping all the parms inside the parens.
$MySite.Option("AutoCloseDelay",60)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#183104 - 2007-11-30 08:14 PM Re: VB to Kix - Help! [Re: Les]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Plus this syntax:

$MySite.Option("AutoCloseDelay") = 60

is NOT supported by Kixtart - VBScript supports it - Kix no.

-Shawn

Top
#183105 - 2007-11-30 08:19 PM Re: VB to Kix - Help! [Re: Shawn]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
plus, thanks. I said "I think" and you clarified it.

sheepshagga, saabsucka.
_________________________
!

download KiXnet

Top
#183108 - 2007-11-30 09:12 PM Re: VB to Kix - Help! [Re: Les]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
les, what ISTR?
I surely think remembering?
_________________________
!

download KiXnet

Top
#183109 - 2007-11-30 09:39 PM Re: VB to Kix - Help! [Re: Lonkero]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I Seem To Recall it was something like that.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#183110 - 2007-11-30 09:44 PM Re: VB to Kix - Help! [Re: Les]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
saabsucka ? rofl

btw - it took me forever to figure out what YMMV meant.

Top
#183111 - 2007-11-30 10:14 PM Re: VB to Kix - Help! [Re: Shawn]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Can this be a suggestion for Ruud to try to resolve this kind of problems?
Top
#183112 - 2007-11-30 11:05 PM Re: VB to Kix - Help! [Re: Witto]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
this issue has been discussed quite much way back.
but, I still think, that if the syntax is not supported, that is, it's supposed to work as normal kixtart syntax, then, it's a bug and that can be corrected.

to clarify, doing:
 Code:
left("some",2) = "mama"

does not produce "some" on the console and kixtart to crash.
why this should be different?
does not produce
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 699 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.068 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org