; JobErrorLine Example ; -------------------- ; Requires Extended mode. Graphics 640,480,0,2 SetBuffer BackBuffer() ; This worker fails on purpose while loading a corrupted save file Worker Function LoadCorruptSave(inputBank) SetJobProgress 1L,2L,"Verifying checksum" ; Busy work standing in for real parsing For parse=1 To 4000000 noise#=Sin(parse) Next ; The checksum does not match - fail the Job deliberately RuntimeError "Save file checksum mismatch" Return CreateBank() End Function job=StartJob(LoadCorruptSave) While Not KeyDown(1) Cls Text 0,0,"Esc: exit" Text 70,160,"Loading save file on a worker thread..." If JobState(job)=JOB_FAILED ; JobErrorLine reports the one-based line of the RuntimeError above Text 70,210,"JobErrorLine(job) = "+JobErrorLine(job) Text 70,240,"JobError(job) = "+Chr(34)+JobError(job)+Chr(34) Text 70,270,"Zero is returned for Jobs that did not fail" Else Text 70,210,"Still loading..." EndIf Flip Wend FreeJob job End