hi James,
thx for Answer
to use a Function twice (or more) is not Problem ... IF Function is "short" and "quick"
but i have to do a lot in Function and have a Variable "ii" in a FOR / NEXT
Code: Select all | Expand
FOR ii := 1 TO nMax
cFilename := TRIM( ::aSource[ ii ] [ F_NAME ] )
as i have 2 x TGrid() which each start a Thread so both "may" use Function at "same Time"
but what if Thread 1 is at ii = 99 and 2nd Thread start at ii = 1
---
my "Problem" was while i use a CLASS and can not call a Method using hb_threadStart()
Code: Select all | Expand
hb_threadStart(@::MyMethod)
hb_threadStart(@oSelf:MyMethod)
hb_threadStart(@&MyMethod)
all of them fail ...
so i use a Function which work but i´m not sure if it is "safe" this Way
now i found a Solution to use a Method "in" CLASS when using hb_threadStart()
Code: Select all | Expand
bMethod := { || ::ImageThread() }
::hThread := hb_threadStart( HB_BITOR( HB_THREAD_INHERIT_PUBLIC, HB_THREAD_MEMVARS_COPY ), @bMethod )
i "think" that this is "safe" as each Object have its own Instance so Variable are not "visible Outside"