Page 1 of 1 1
Topic Options
#78009 - 2001-06-30 03:46 PM Discussion: remove $var = "hello $name"
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi all,

The part below is a part of an interview with Ruud van Velsen. You can find the complete interview at: http://home.wanadoo.nl/scripting/specials/interview.htm

quote:

Ruud:
Backwards compatibility is very important to me. This is why I still support some of the quirky language things of the past.
Steve:
By quirky do you mean this:

"Hello $YourName, How are you?"
Ruud:
Yes, yes, indeed. Do you think I could get away with dropping that kind of stuff? I'd love to...
Steve:
Well, one thing that you can't eliminate is this:

$SUM = 1 + 1

$TextSum = "$SUM"

To convert an Integer to a string. Unless you wrote a function...
Ruud:
Mmm. I'll think about the options.


And:

quote:

Ruud:
Getting rid of ? "Hello $UserName..." would be very nice...
Steve:
If that feature were removed, would that speed up the compiler's execution?
Ruud:
Removing variables-inside-strings would add some speed, and would certainly allow me to get rid of some ugly coding.
Steve:
So that would also decrease the EXE size?
Ruud:
Yes, a bit. Well, a few bits really. But is that an issue?
Steve:
Not on a LAN. But of course, in a RAS environment, every KB helps.
Ruud:
RAS, I see.


I was testing the new version against the old version with this:

code:
BREAK ON CLS

open (1,"setuplog.txt")

$Begin=@TIME

$line=readline(1)
While @ERROR=0
? $line
$line=readline(1)
loop

$End=@TIME

CLS

$Bh=substr($Begin,1,instr($Begin,":")-1) $Bl=substr($Begin,instr($Begin,":")+1,len($Begin))
$Bm=substr($Bl,1,instr($Bl,":")-1) $Bs=substr($Bl,instr($Bl,":")+1,len($Bl))

$Eh=substr($End,1,instr($End,":")-1) $El=substr($End,instr($End,":")+1,len($End))
$Em=substr($El,1,instr($El,":")-1) $Es=substr($El,instr($El,":")+1,len($El))

$Bd=val($Bh)*3600+val($Bm)*60+val($Bs)
$Ed=val($Eh)*3600+val($Em)*60+val($Es)

? "Begin = " $Begin
? "End = " $End
? "Diff = " $Ed-$Bd

exit


And started thinking about it. If someone would switch to the new version, you would convert your scripts anyway.

So can anyone give a good reason why it should stay in? Personally, I think the issue about speed and size would be better than keeping this feature.

[ 03 July 2001: Message edited by: DrillSergeant ]

[ 03 July 2001: Message edited by: DrillSergeant ]

_________________________
The Code is out there

Top
#78010 - 2001-07-04 12:19 AM Re: Discussion: remove $var = "hello $name"
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
{Bump}

Sorry for this, but I really like to see this discussion before it went of the board.

_________________________
The Code is out there

Top
#78011 - 2001-07-03 01:23 PM Re: Discussion: remove $var = "hello $name"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nice sunny day not working so much and time for interviews...
which was ok.
but don't like da think that ruud is staying in logonscript-policy.
I'm - and i think many others too - using kix as script processor for all scripting task it just is capable of doing.
it means that I do my every m$ script with it, but if i can't i've had to use TCL or js.

kix could have much wider usergroup around if it could spread in every way... I think.

_________________________
!

download KiXnet

Top
#78012 - 2001-07-03 01:31 PM Re: Discussion: remove $var = "hello $name"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
haa.
sun is melting my brains now.
forgot to answer the question...

drillsergeant, I think you are right. who really even needs that feature.
and splitting string to ""+$var+"" instead of "$var" isn't making so huge difference in script size.

_________________________
!

download KiXnet

Top
#78013 - 2001-07-03 03:35 PM Re: Discussion: remove $var = "hello $name"
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Your sig is correct.
_________________________
The Code is out there

Top
#78014 - 2001-07-04 04:41 AM Re: Discussion: remove $var = "hello $name"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hey Roger

My two cents ...

OK - I'll come out of the closet on this one - I'm not ashamed to admit it - I'm a KiXtart embedded string variable junkie !!!

[there - I got that off my chest - whew - I feel better now]

Yes - it would be a sad day for me if Ruud ever pulled support for "Hello $username...". This is exactly the kind of quirky, natural and free-flowing language syntax that attracted me to KiXtart in the first place ... and I still think it one of her most endearing features (imho) ...

However, by the same token - ever since reading Ruuds' interview - I've been making a concerted effort to avoid using embedded string variables. I've also been doing this since working with the new beta. A few of the old OLE tricks (like displaying object pointers in strings) don't work anymore with the beta - so I guess maybe your right Roger - the writing may be on the wall ... the party may soon be over.

My vote:

If it only uses a few bits and cycles - keep it in. If not just to maintain backward compatibility.

-Shawn
------------
Weird - but not quite as weird as Lonkero

Top
#78015 - 2001-07-04 04:57 AM Re: Discussion: remove $var = "hello $name"
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
TBH I leave the vars out of the strings so that they are a different colour in TextPad

I will do some speedtests later.

cj

Top
#78016 - 2001-07-05 02:33 PM Re: Discussion: remove $var = "hello $name"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ...

would that have influence also to execute() ?


eg. : $ = execute("$$var = $$var + substr($arraypart1$arraypart2[$i],1,1)")

(if I put substr... outside the quotes it won't work anymore because of the doubled reference to $array)

Jochen

ps: my current project contains by now 59 execute() functions !

_________________________



Top
#78017 - 2001-07-05 03:02 PM Re: Discussion: remove $var = "hello $name"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jpols,

ain't it then like this

execute("$$var = $$var + substr("+$arraypart1$arraypart2+"["+$i+"],1,1)")

or have you tried that out?

_________________________
!

download KiXnet

Top
#78018 - 2001-07-05 03:10 PM Re: Discussion: remove $var = "hello $name"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
lonkero,

= invalid method or function ... think you can't break functions to parts in execute statements ! (Yes , i tried that )

Ok, i can do :

code:

dim $array[4]
$array[0] = 1,2,3,4,5
$array[1] = etc

$var = $var + substr($array[$ref1][$ref2],1,1)


and leave the execute()'s out ....

And another hour of rewriting functioning code ....


Jochen

ps: the post # of the beast is reached *evil grin*

pps: The usage of 2 dimensional Arrays reduced the execute() calls from 59 to 23 in my hearts script !!!

[ 10 July 2001: Message edited by: jpols ]

_________________________



Top
#78019 - 2001-07-05 03:50 PM Re: Discussion: remove $var = "hello $name"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so what's the use of execute then?
if that stuff is no can do and you can execute only kix-code... why somebody uses execute instead of writing the code directly to script. or am I too simple again to see the small picture
_________________________
!

download KiXnet

Top
#78020 - 2001-07-05 03:58 PM Re: Discussion: remove $var = "hello $name"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Lonkero,

simple example (for a better understanding)

try :

code:

$fg = "w+"
$bg = "b+"
color $fg/$bg

won't work !

but :

code:

$fg = "w+"
$bg = "b+"
$ = execute("color $fg/$bg")

will work !

Jochen

(and again we have vars inside a string !=)

[ 05 July 2001: Message edited by: jpols ]

_________________________



Top
#78021 - 2001-07-05 04:06 PM Re: Discussion: remove $var = "hello $name"
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
But...

code:

$fg = "w+"
$bg = "b+"

$ = execute( "color " + $fg + "/" + $bg )


does also work...

_________________________
The Code is out there

Top
#78022 - 2001-07-05 04:13 PM Re: Discussion: remove $var = "hello $name"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
but
code:

execute("$$var = $$var + substr("+$arraypart1+$arraypart2+"[$i],1,1)")

won't

Ok, stop playing ping pong !

greetz
Jochen

ps: ok , tell the Truth ! How many scripts do you have to modify if this gets really actual ???

[ 05 July 2001: Message edited by: jpols ]

[ 05 July 2001: Message edited by: jpols ]

_________________________



Top
#78023 - 2001-07-05 04:43 PM Re: Discussion: remove $var = "hello $name"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah...
that's pretty triggy thing... the problem with color is that it is a command not a function. it does not support variables (which are strings) only switches that are hardcoded.
but
strings inside function call like execute isn't neccessary.

code:

$fg = "b+/w+"
$x=execute("color "+$fg)

works fine on my machine!
but there is a bug in beta 2
on kix3.63 it works fine, but with kix2k1 (read 2001)
does nothing. not even errors.

_________________________
!

download KiXnet

Top
#78024 - 2001-07-06 12:52 AM Re: Discussion: remove $var = "hello $name"
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
My vote is to keep them, but I will live if they leave...
Top
#78025 - 2001-07-06 03:36 AM Re: Discussion: remove $var = "hello $name"
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
ok, EXECUTE is an exception...

Inside an execute the $var becomes the value of the $var, so it is not the same. But, $$var becomes the name of the $var, so I am obviously just trying to confuse myself, oops too late

I consider "" to be a function anyway, so "$var" is quite valid.

By highest number of executes is 29

cj

Top
#78026 - 2001-07-18 07:44 PM Re: Discussion: remove $var = "hello $name"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ok guys, to give this disussion the 'coup de grāce' :

use with user:'$domain\@userid' won't work anymore !

Am I right ?

Jochen

_________________________



Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

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