Page 1 of 1 1
Topic Options
#34727 - 2003-01-02 07:06 PM Max Length of a Variable
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
I searched the Kix2001.doc manual and Kix412help.chm and can not find the maimum length of a variable. [Confused]

Did I miss it?
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

Top
#34728 - 2003-01-02 07:21 PM Re: Max Length of a Variable
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Well, yeah.. you missed it.. from the manual:

"A variant of type string can contain up to 32,000 characters. Integer variables can contain any value between 2,147,483,648 and 2,147,483,647."

Brian

Top
#34729 - 2003-01-02 07:24 PM Re: Max Length of a Variable
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Brian, unfortunately slightly wrong [Wink]

He asked for the maximum length of the variables itself. Though I haven't seen anything definite, I would say that variable names that are longer than e.g. 30 characters might be overkill.
_________________________
There are two types of vessels, submarines and targets.

Top
#34730 - 2003-01-02 07:24 PM Re: Max Length of a Variable
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
Sorry, but I meant to say the Lenght of the Nname of a variable.

Steve
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

Top
#34731 - 2003-01-02 08:09 PM Re: Max Length of a Variable
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
In KiX-versions prior to 4.0 this was the rules for variablenames were:
  • Can't contain operator characters (+,-,*,/,&,<,>,=)
  • Must not exceed 14 characters.
  • Must be unique within the same scope, which is the range from which the variable can be referenced in a script, or script segment.
From KiX-version 4.0 and upwards the rule:
Must not exceed 14 characters.
Is omitted from the documenteation, so I gues we will have to ask Ruud if the length of variablenames can be anything up til 32000 in KiX 4.+ ???

Until then you might consider 14 as the maximum length.

I have seen somewhere in the old documentation, that you can use longer names than 14, but anything in the name after the 14’s char will be ignored.

Example:
$ThisIsLongChar
$ThisIsLongChar2

Will both be treated as the same variable:
$ThisIsLongCha

-Erik

Top
#34732 - 2003-01-02 08:19 PM Re: Max Length of a Variable
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, I tested vars of various lengths between 30 and 60 chars on 4.02 on up to 4.20 and they all worked.

code:
Break on
$123456789012345678901234567890 = 'test1'
$1234567890123456789012345678901234567890 = 'test2'
$12345678901234567890123456789012345678901234567890 = 'test3'
$123456789012345678901234567890123456789012345678901234567890 = 'test4'
$123456789012345678901234567890 ?
$1234567890123456789012345678901234567890 ?
$12345678901234567890123456789012345678901234567890 ?
$123456789012345678901234567890123456789012345678901234567890 ?
get $_

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

Top
#34733 - 2003-01-02 10:41 PM Re: Max Length of a Variable
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Hmm.. I took him to mean the length of a string.. Length of the identifier is a bit different.. [Smile]

After some testing, I haven't found a limit to the size of variables... I tried 2000 characters and it still worked. However, everything gets EXTREMELY slow, so shorter variable names are desirable!

Brian

Top
#34734 - 2003-01-02 11:45 PM Re: Max Length of a Variable
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Brian, I thought you had already discovered that shorter variable names are faster - especially after you published your SORT function - the one that blew CombSort away [Wink] I think short variable names can give a worth-while speed boost, especially for those types of intensive applications.

-Shawn

Top
#34735 - 2003-01-03 01:31 AM Re: Max Length of a Variable
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
Thanks for the responses!

I am glad I was able to fire up an interesting discussion. Perhaps the moderator should move this thread to the FAQ area because the subject is not included in any of the new documentation!

Steve
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

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 484 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.082 seconds in which 0.053 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