kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Brian,
Nice script
Just checked your score 716 (hereby verified)
I wil post my own code even if the score is 777, here it is
code:
Function ImportRegfile($p) Dim $,$a[0],$f,$n,$r,$t,$v,$x If VarType($p)=8 $a[0]=$p Else $a=$p EndIf For Each $f In $a Open(1,$f) Do Do $=ReadLine(1) $p=Left($,1)='[' Until @Error+$p If $p $t=SubStr($,2,Len($)-2) If Left($t,1)='-' DelKey(SubStr($t,2)) Else AddKey($t) Do $='' Do $=Left($,Len($)-1)+Trim(ReadLine(1)) Until Right($,1)<>'\' If $ $x=Split($,'=') $n=Split($x[0]+'"','"')[1] $x=$x[1] If Left($x,1)='-' DelValue($t,$n) Else $r=Split(SubStr($x,InStr($x,':')+1),',') $v='' For $=0 To UBound($r)-1 $p=Val('&'+$r[$]) $v=$v+Chr($p+($p=0)*124) Next $=SubStr($x,5,1) Select Case Left($x,1)='"' $v=Split($x,'"')[1] $x='SZ' Case $='d' $v=Val('&'+$r[0]) $x='DWORD' Case $='2' $x='EXPAND_SZ' Case $='7' $x='MULTI_SZ' Case 1 $v=Join($r,'') $x='BINARY' EndSelect WriteValue($t,$n,$v,'REG_'+$x) EndIf EndIf Until $='' EndIf EndIf Until @Error Close(1) Next EndFunction
I wil reread your script tomorrow, it's getting late here. Allready in the parametercheck you gain some points, but the rest i thought looked very similar to mine, but there must be some small tricks.
-Erik
|