Je voulais raccourcir le chemin, donc j'ai teste un truc, qui pourrait etre tres utile, seulement... ca plante
Code : Tout sélectionner
Procedure CreateIncludedFiles(FileName.s, *BinStart, *BinEnd)
Define a
If FileSize(FileName) = -1
Protected id.l = CreateFile(#PB_Any, FileName)
If id
a = WriteData(id, *BinStart, *BinEnd - *BinStart)
CloseFile(id)
EndIf
EndIf
ProcedureReturn a
EndProcedure
; Structure fileBinary
; debut.l
; fin.l
; nom.s
; EndStructure
;
; NewList file.fileBinary()
; AddElement(file()) : file()\debut = ?a_debut : AddElement(file()) : file()\fin = ?a_fin : AddElement(file()) : file()\nom = "a1.jpg"
; AddElement(file()) : file()\debut = ?b_debut : AddElement(file()) : file()\fin = ?b_fin : AddElement(file()) : file()\nom = "b1.jpg"
; AddElement(file()) : file()\debut = ?c_debut : AddElement(file()) : file()\fin = ?c_fin : AddElement(file()) : file()\nom = "c1.jpg"
;
; ForEach file()
; CreateIncludedFiles(file()\nom, file()\debut, file()\fin)
; Next
Define.s files, file
files = "a b c"
For i = 1 To CountString(files, " ") + 1
file = StringField(files, i, " ")
CreateIncludedFiles(file + ".jpg", ?file + "_debut", ?file + "_fin")
Next
;{- Data
DataSection
a_debut:
IncludeBinary "a.jpg": a_fin:
b_debut:
IncludeBinary "b.jpg": b_fin:
c_debut:
IncludeBinary "c.jpg": c_fin:
EndDataSection
;}