Jon_Dolinar
(Fresh Scripter)
2017-03-14 06:03 PM
Call with UNC

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.


AllenAdministrator
(KiX Supporter)
2017-03-14 06:41 PM
Re: Call with UNC

Maybe this applies to you...
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=212308


ShaneEP
(MM club member)
2017-03-14 06:52 PM
Re: Call with UNC

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


Jon_Dolinar
(Fresh Scripter)
2017-03-14 07:43 PM
Re: Call with UNC

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


Jon_Dolinar
(Fresh Scripter)
2017-03-14 07:47 PM
Re: Call with UNC

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.


AllenAdministrator
(KiX Supporter)
2017-03-14 08:54 PM
Re: Call with UNC

Can you post your called script in its entirety?

Jon_Dolinar
(Fresh Scripter)
2017-03-14 09:17 PM
Re: Call with UNC

Nothing fancy just a test script with

messagebox("Test","test3")


ShaneEP
(MM club member)
2017-03-15 03:19 PM
Re: Call with UNC

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"


Jon_Dolinar
(Fresh Scripter)
2017-03-15 07:18 PM
Re: Call with UNC

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


AllenAdministrator
(KiX Supporter)
2017-03-15 08:14 PM
Re: Call with UNC

Shouldn't need to do the chr34s. That's just weird.

Shane will you verify this?


ShaneEP
(MM club member)
2017-03-15 10:48 PM
Re: Call with UNC

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)


AllenAdministrator
(KiX Supporter)
2017-03-15 10:51 PM
Re: Call with UNC

Thanks. I'll second the verification when I get a few minutes.

Glenn BarnasAdministrator
(KiX Supporter)
2017-03-15 11:37 PM
Re: Call with UNC

Shouldn't ALL "REAL" servers have a number (or two) in their name? \:D

Glenn BarnasAdministrator
(KiX Supporter)
2017-03-15 11:46 PM
Re: Call with UNC

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