Page 1 of 1 1
Topic Options
#129375 - 2004-11-11 09:06 PM Proper Variable Syntax
Anonymous
Unregistered


Which of these is correct? Since both seem to work.

$server = "MyServer"
USE Z: "\\$server\share"

-or-

$server = "MyServer"
USE Z: "\\" + $server + "\share"

--



Top
#129376 - 2004-11-11 09:11 PM Re: Proper Variable Syntax
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
$server = "MyServer"
USE Z: "\\" + $server + "\share"

is more correct.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#129377 - 2004-11-11 09:11 PM Re: Proper Variable Syntax
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Add this to your code and tell us which one works.

Code:

Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')



Top
#129378 - 2004-11-11 09:13 PM Re: Proper Variable Syntax
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Using the NoVarInStrings option forces one to write cleaner code. KiXtart is very forgiving language, but that can also get you in trouble in some places. Thus it would be better to use the option and get in the habit of writing cleaner code.
Top
#129379 - 2004-11-11 09:26 PM Re: Proper Variable Syntax
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
LOL

with $SO=SetOption('Explicit','On') neither would work.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#129380 - 2004-11-11 09:29 PM Re: Proper Variable Syntax
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Okay boss U right. Is better to read the manual for these options as well.
Action: SetOption can be used to configure certain options of the KiXtart script engine

This will work.
Code:
Break On

Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')

Dim $server
$server = "MyServer"
USE Z: "\\" + $server + "\share"


Top
#129381 - 2004-11-11 10:23 PM Re: Proper Variable Syntax
Anonymous
Unregistered


Thanks guys. Seems KiXtart is a lot like VB.

--

Top
#129382 - 2004-11-11 10:37 PM Re: Proper Variable Syntax
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hey.
I don't tolerate much of that level blashemy on this board...
take that as warning #1

_________________________
!

download KiXnet

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

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