Hi,
I have a little problem with a thread. It's only called when it's supposed to end. This is the calling code:
Code: Select all
Gosub OpenXpm
ProgressExitCode = 0
ThreadID = CreateThread(@Progress(), "Xpm")
Gosub Xpm2Bmp
ProgressExitCode = 1
Gosub ShowImage
Code: Select all
Procedure Progress(format.s)
done = 0
If OpenPopUpWindow(2, WindowX()+(WindowWidth()>>1)-128, WindowY()+(WindowHeight()>>1)-32, 256, 64, "Converting image")
If CreateGadgetList(PopUpWindowID())
TextGadget(2, 16, 28, 80, 20, format+" --> Bmp")
ProgressBarGadget(3, 16, 48, 80, 32, 0, 100)
SetGadgetState(3, done)
EndIf
EndIf
Repeat
If ProgressExitCode = 1
done = 100
Else
done = Round((Seeker/BmpSize)*100, 0)
SetGadgetState(3, done)
Sleep_(20)
EndIf
Until done = 100
ClosePopUpWindow(2)
EndProcedure
Any ideas are welcome (come back, Fred! XD),
Bye,
El_Choni
