How to prevent figures from floating 'into' listings [closed]

I have a problem with floats and listings. Sometimes it happens that a listing is split over two pages and when a figure is near the listing it happens that the listing starts on the first page, on the next page the figure is on top of the second page and below the figure the listing continues. Is it possible to let the remainder of the listing be on the top of the second page and the figure start below the listing or on top of the third page?

-

closed as unclear what you're asking by Jubobs, Martin Schröder, Jesse, T. Verron, Sean AllredMar 2 '14 at 16:49

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Martin Schröder Mar 2 '14 at 14:29

\global\csname @topnum\endcsname 0

well... i dont know what that command means but it solved two of my issues. :) Some others i solved by rearranging the figures and lstinputlisting. I will try to put a MWE. Thanks so far :) –  Joysn Nov 12 '12 at 22:29