te salut @sadicq
very usefull for me too this script . thank you very much . . .
but i have so many programs without install order and also with same install order .
so , i modified your script for my needs .
1. now show all entries , including here those who havent (yet) install order number
(this was possible because the original script show the doubled entries)
i modified only the
Read() function, with
red are the
changes
Quote
Func Read()
Local $nametemp_bak = ""
$file = FileOpen($folderin & "\" & $input, 0)
; Check if file opened for reading OK
While $file = -1
MsgBox(0, "Error", "Unable to open " & $input & ".")
If MsgBox(4,"Cannot open " & $input & ".","Do you want to open it from another location?")==6 Then
$aux=FileOpenDialog("Please select the import file:","","All (*.*)",1+2,"config.js")
If StringInStr($aux,"\",1,-1) Then
$input=StringTrimLeft($aux,StringInStr($aux,"\",1,-1))
$folderin=StringTrimRight($aux,StringLen($aux)-StringInStr($aux,"\",1,-1)+1)
Else
$input=$aux
EndIf
$file = FileOpen($folderin & "\" & $input, 0)
Else
Exit
EndIf
WEnd
; Read in lines of text until the EOF is reached
While 1
$a=FileReadLine($file)
If @error = -1 Then
Insert("-" ,$nametemp_bak)
ExitLoop
EndIf
;Line read, need to analize it now
If StringInStr($a,"ordr[pn]=[",1,1) And StringInStr($a,"//",1,1)<>1 Then
$temp=StringStripCR($a)
$temp=StringTrimLeft($temp,10)
$temp=StringTrimRight($temp,1)
If Not StringIsAlNum($temp) Then
MsgBox(0, "Error", "Possibly corrupted " & $input & ". Cannot continue.")
Exit
Else
Insert( Int($temp) ,$nametemp)
$nametemp_bak = ""
EndIf
ElseIf StringInStr($a,"prog[pn]=[",1,1) And StringInStr($a,"//",1,1)<>1 Then
$nametemp=StringStripCR($a)
$nametemp=StringTrimLeft($nametemp,11)
$nametemp=StringTrimRight($nametemp,2)
$nametemp = MyTrim ( $nametemp ) ; <<--- you can delete this line if you dont want to trim the colours codes
if $nametemp_bak <> "" then Insert("-" ,$nametemp_bak)
$nametemp_bak = $nametemp
EndIf
Wend
FileClose($file)
EndFunc
2. and i added a new function
MyTrim() ,
because i use a lots of colours , i trim this part from the name of program writed in config.txt
; ----------------------------------------------------------------------------
Func MyTrim($sir)
Local $kk , $sirulet , $tampon = "" , $logic = 0
For $kk = 1 To StringLen($sir) Step 1
$sirulet = StringMid ( $sir , $kk , 1 )
if $sirulet = "<" then $logic = 1
if $logic = 0 then $tampon = $tampon & $sirulet
if $sirulet = ">" then $logic = 0
Next
Return $tampon
EndFunc
; ----------------------------------------------------------------------------