#78009 - 2001-06-30 03:46 PM
Discussion: remove $var = "hello $name"
|
DrillSergeant
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 CLSopen (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
|
|
|
|
#78014 - 2001-07-04 04:41 AM
Re: Discussion: remove $var = "hello $name"
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Hey RogerMy 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
|
|
|
|
#78017 - 2001-07-05 03:02 PM
Re: Discussion: remove $var = "hello $name"
|
Lonkero
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
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
|
|
|
|
#78020 - 2001-07-05 03:58 PM
Re: Discussion: remove $var = "hello $name"
|
Jochen
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
|
|
|
|
#78022 - 2001-07-05 04:13 PM
Re: Discussion: remove $var = "hello $name"
|
Jochen
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
|
|
|
|
#78024 - 2001-07-06 12:52 AM
Re: Discussion: remove $var = "hello $name"
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
My vote is to keep them, but I will live if they leave...
|
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|