[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    Re: help.
From:       John Bollinger <bbands () yahoo ! com>
Date:       2002-05-29 21:37:47
[Download RAW message or body]

--- Arkajyoti Misra <arko@bama.ua.edu> wrote:
> >
> > One is to have another program repeatedly pipe the commands to gnuplot. I
> have done this with VB and pgnuplot.
> >
>   Can you give me a small example how to do that?
> 
>  A. Misra

Here it is. I use it to make plots for different terms, but you could adapt it
to your needs as well. The arguments$ are the path and files names of my gp
command files.

---

Private Sub gnuplot_pipe(WinScript$, PsScript$, EmfScript$, SvgScript$)
Dim Cmd$ 'holds the gp commands
Dim i As Integer 'local counter
Dim Response As String 'OK?
Dim WshShell As Object
Dim oPipes As Object

Set WshShell = CreateObject("WScript.Shell")
Set oPipes = WshShell.Exec("d:\charts\pgnuplot.exe")

Select Case oPipes.Status
    Case 0
        Message_Box.Print "pgnuplot running"
    Case 1
        Message_Box.Print "pgnuplot stopped"
    Case Else
        Message_Box.Print "status oops"
End Select

For i = 1 To 4
    Select Case i
            Case 1
                Open WinScript$ For Input As #5
                Message_Box.Print "piping win"
            Case 2
                Open PsScript$ For Input As #5
                Message_Box.Print "piping ps"
            Case 3
                Open EmfScript$ For Input As #5
                Message_Box.Print "piping emf"
            Case 4
                Open SvgScript$ For Input As #5
                Message_Box.Print "piping svg"
    End Select
    Do
        Line Input #5, Cmd$
        oPipes.StdIn.write Cmd$ + vbCrLf
    Loop Until (EOF(5))
    Close #5
Next i

'pause to let the user check the chart
    Response = MsgBox("Does the chart look OK?", (vbOKOnly +
vbMsgBoxSetForeground), "gnuchart pipe")

'close gnuplot
    oPipes.StdIn.write "exit" + vbCrLf

'kill the object
    Set oPipes = Nothing

End Sub
 
---

Good luck,

     --jab



=====
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic