FileSaveAs command

Q&A for Visual Basic, Visual Basic .NET, and PowerBasic developers using DPlot
Post Reply
cbkotura
Posts: 6
Joined: Thu Nov 05, 2009 6:11 pm

FileSaveAs command

Post by cbkotura »

In the manual the syntax for the FileSaveAs command is [FileSaveAs(1,"c:\mydata\|TITLE1|.grf")], but is it possible to input a variable using VB6? If I put [FileSaveAs(1, "dirMain.Path & "\test.grf"")] it will not compile. However if the variable is not at the beginning of the file name such as [FileSaveAs(1, ""C:\test" & I & ".grf"")] it can compile. Is it possible for the file name to begin with a variable or for the entire file name to be a variable? If so please help with the syntax. Thanks
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

This should work:

"[FileSaveAs(1,""" & dirMain.Path & "\test.grf"")]"

As should this:

Dim fname as String
fname = dirMain.Path & "\test.grf"
"FileSaveAs(1,""" & fname & """)]"
Visualize Your Data
support@dplot.com
cbkotura
Posts: 6
Joined: Thu Nov 05, 2009 6:11 pm

Post by cbkotura »

Thank you very much, that worked!!!
Post Reply