#64414 - 2002-04-11 12:38 AM
Re: HEADSUP: Intended behavior? "$=" creates a variable
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
The use of variables and macros within a quoted string is deprecated but supported. In other words it is bad programming practice and might not work at some future time, but it works now.
The only variables that you can't use in a quoted string are arrays and objects if I recall correctly.
I think the idea is that parsing strings for variables is expensive in terms of CPU, so Ruud was keen to drop it.
The problem is that it would break just about every script in live use
From the latest kix2001.doc manual: quote: A string expression can contain up to 32,000 characters. Any macros, or references to environment strings within a string (e.g.: “String with the macro @USERID in it.”) are resolved before the string is evaluated. For compatibility reasons, references to variables inside strings (e.g.: “String with a $Var in it.”) are also resolved before the string is displayed. The only exceptions to this rule are arrays and object references, which can not be used inside strings. To use arrays or object references in combination with strings, you have to use concatenation.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 657 anonymous users online.
|
|
|