Page 1 of 1

Adding more than one documents doesn't work

Posted: Mon Mar 05, 2007 7:30 am
by mlomonaco
Hi there,
I recently upgraded DPlotJr to a newest version, and installed also latest DPlot trial.
I have trouble with creating a new document with the [FileNew()] command: every time I always get the DocNum = 1 (or the active one) and it does not increment itself at each DPlot_Command() call with FileNew directivel. Of course I always pass 0 as DocNum in the creation of the new document. What I need is to update in realtime witgh DPlotLib a different curve on differents windows (DPlot documents)

Any suggestions? I remember that my code worked on older versions...

Thanks

Marco

Posted: Mon Mar 05, 2007 10:05 am
by DPlotAdmin
Any suggestions? I remember that my code worked on older versions...
I may be mistaken but I don't think so. FileNew has always worked pretty much the same way: it returns the document index of an empty document window, not necessarily a new one. If you don't use FileNew until you need it - that is when you've already added data to the currently open documents, then it will work as you expect.

Posted: Mon Mar 05, 2007 11:16 am
by mlomonaco
Ok, so what I understand is:
1) if I DPlot_Command("FileNew" ...) n times and between calls I dont do nothing (nor add points nor change legends/axis params) it could open always the same empty window
2) if I DPlot_Command("FileNew" ...) n times and between each call I add some points then a new window is given every time.

Actually I:
a) DPlot_Command("FileNew" ...) then DPlot_Command("Legends..." ...) and DPlot_Command("Axis..." ...) N-times
b) DPlot_AddData on the N documents in sequence

and as i understand I got this behaviour. A workaoround is to add a dummy point every time i do a FileNew(): could it work?

M.

Posted: Mon Mar 05, 2007 11:22 am
by DPlotAdmin
A workaoround is to add a dummy point every time i do a FileNew(): could it work?
Yes, that will work as you want.

Posted: Mon Mar 05, 2007 11:38 am
by mlomonaco
... yep and it did!

Thank you.

Suggestion: in the manuals according to me this matter is not clear . It could be nice to add some info about how to open multiple windows.