Page 1 of 1 1
Topic Options
#212333 - 2017-03-14 06:03 PM Call with UNC
Jon_Dolinar Offline
Fresh Scripter

Registered: 2005-04-01
Posts: 5
Loc: Ohio
Seems now with version 4.67 (Which I just found) I can no longer do a

Call \\server\path\script.kix it returns an error Function expected.

Is this by design or a bug?

If I go back to the old version all works.

Top
#212334 - 2017-03-14 06:41 PM Re: Call with UNC [Re: Jon_Dolinar]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4467
Loc: USA
Maybe this applies to you...
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=212308

Top
#212335 - 2017-03-14 06:52 PM Re: Call with UNC [Re: Jon_Dolinar]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2081
Loc: Tulsa, OK
I used the below scripts to test with both 4.66 and 4.67. The Call command seems to call the the second script fine with both. I was not able to reproduce the error you are getting. Are you certain the error is not being generated by the Called script, as the call will get an error returned from the second script.

Call.kix
 Code:
Call "\\server\share\userdata$\user\call2.kix"

? @Error
? @SError
get $
Call2.kix
 Code:
$nul = messagebox(@Kix + @CRLF + @ScriptDir, "test", 0)

Exit 0

Top
#212336 - 2017-03-14 07:43 PM Re: Call with UNC [Re: ShaneEP]
Jon_Dolinar Offline
Fresh Scripter

Registered: 2005-04-01
Posts: 5
Loc: Ohio
I have a script test.kix which has the following

call test2.kix
call \\server1\netlogon\test3.kix

the call to test2.kix which lives in the same local directory as test.kix runs

I then get an error
ERROR: expected FUNCTION name!
Script: \\server1\netlogon\test3.kix

running the same script with a previous version works


Edited by Jon_Dolinar (2017-03-14 07:44 PM)

Top
#212337 - 2017-03-14 07:47 PM Re: Call with UNC [Re: Jon_Dolinar]
Jon_Dolinar Offline
Fresh Scripter

Registered: 2005-04-01
Posts: 5
Loc: Ohio
So interesting I seem to get the error only when the server name has a numeric character

another test of \\server\dir\subdir\test2.kix works?

I also changed my hostfile to have server1 resolve as an alias of servera

putting servera in the script works.


Edited by Jon_Dolinar (2017-03-14 08:05 PM)

Top
#212338 - 2017-03-14 08:54 PM Re: Call with UNC [Re: Jon_Dolinar]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4467
Loc: USA
Can you post your called script in its entirety?
Top
#212339 - 2017-03-14 09:17 PM Re: Call with UNC [Re: Allen]
Jon_Dolinar Offline
Fresh Scripter

Registered: 2005-04-01
Posts: 5
Loc: Ohio
Nothing fancy just a test script with

messagebox("Test","test3")

Top
#212342 - 2017-03-15 03:19 PM Re: Call with UNC [Re: Jon_Dolinar]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2081
Loc: Tulsa, OK
Is it a quotes issue? have you tried wrapping the scripts you're calling in quotes?
 Code:
call "test2.kix"
call "\\server1\netlogon\test3.kix"

Or putting the full path to both scripts?
 Code:
call @ScriptDir+"\test2.kix"
call "\\server1\netlogon\test3.kix"


Edited by ShaneEP (2017-03-15 03:20 PM)

Top
#212343 - 2017-03-15 07:18 PM Re: Call with UNC [Re: ShaneEP]
Jon_Dolinar Offline
Fresh Scripter

Registered: 2005-04-01
Posts: 5
Loc: Ohio
If I put quotes around the call with the number it does now work in 4.67

Since the original program was a variable I had to use
$var = "\\server1\netlogon\test.kix"
$var = chr(34) + $var + chr(34)
call $var

Top
#212344 - 2017-03-15 08:14 PM Re: Call with UNC [Re: Jon_Dolinar]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4467
Loc: USA
Shouldn't need to do the chr34s. That's just weird.

Shane will you verify this?

Top
#212345 - 2017-03-15 10:48 PM Re: Call with UNC [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2081
Loc: Tulsa, OK
Changed my call.kix to the below...
 Code:
$file = "\\server\share\call2.kix"
Call $file

? @Error
? @SError
get $
Left call2.kix as...
 Code:
$nul = messagebox(@Kix + @CRLF + @ScriptDir, "test", 0)

Exit 0

And all still works for both 4.66 and 4.67. (And the real server name does have a number in it)

Top
#212346 - 2017-03-15 10:51 PM Re: Call with UNC [Re: ShaneEP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4467
Loc: USA
Thanks. I'll second the verification when I get a few minutes.
Top
#212347 - 2017-03-15 11:37 PM Re: Call with UNC [Re: ShaneEP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4297
Loc: New Jersey
Shouldn't ALL "REAL" servers have a number (or two) in their name? \:D
_________________________
Actually I am a Rocket Scientist! \:D

Top
#212348 - 2017-03-15 11:46 PM Re: Call with UNC [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4297
Loc: New Jersey
Regarding the original question - While Kix is forgiving and may work when things aren't quite right, the name of the file being called is an argument to the Call command. The argument is a text string, and as such, should be enclosed in quotes. The problem would be exacerbated if the string began with a number. (OK - not likely [possible!!] with a UNC path, but think about assigning a simple file named "40Lines.udf" to the call command.. what do you think Call would search for?

I've never not quoted this argument and treat it just like variable assignment, which should place strings in quotes.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Dr_Rick) and 178 anonymous users online.
Newest Members
PureKoala, 7hjd2, jswizz, Andrewpaul, emmamillathompso
17649 Registered Users

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