I have a dll that outputs text and uses threads however it is not instant.. it takes about a half a second to one full second.

my code uses the value too soon (before it is set)

What I do is:

set ANSWER = nothing

run the file through the DLL

then use the answer

The answer is being used to soon.

I've tried several things such as:

set ANSWER = nothing
run the file through DLL

do until not answer = nothing
loop

then use answer

but this freezes the program.

how can i wait until "answer" has a value before using it?