Author Topic: How to save as in flash screen?  (Read 6393 times)

0 Members and 1 Guest are viewing this topic.

Offline azambuja

  • Active Member
  • Posts: 10
    • View Profile
How to save as in flash screen?
« on: June 25, 2008, 04:08:05 PM »
Hi
I want to create a button to save(save as) my GCode.
I create this button in Screen4(.set), with this code:

Set objDialog = CreateObject("SAFRCFileDlg.FileSave")
objDialog.FileName = ""
objDialog.FileType = "Arquivo TAP"
intReturn = objDialog.OpenFileSaveDlg

If intReturn Then

        Set objFSO = CreateObject("Scripting.FileSystemObject")

        If StrComp(Right(objDialog.FileName,4),".tap") Then
             objDialog.FileName = objDialog.FileName & ".tap"
        End If

        Set objFile = objFSO.CreateTextFile(objDialog.FileName)

        objFile.Close
       
   ArquivoTeach = objDialog.FileName
   
FileCopy "C:\Mach3\GCode\teach.tap", ArquivoTeach
A=MsgBox ("Arquivo salvo como " &  ArquivoTeach, 0, "SALVO")

End If

However, now I am working in development of flash screen and that code do not work.
If someone know the code to create this button tell me please.
That's it.

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: How to save as in flash screen?
« Reply #1 on: June 25, 2008, 07:32:03 PM »
Yea here is a way to do what you want:

On the Frame, or Frame number index that you want this button to execute put a Dynamic Text Box,
and Name it: "SaveAsGcode" (box immediatly under the Dynamic text selection dropdown in CS3.

Inside the Text Box put this text:

'**********start of Text****************

Set objDialog = CreateObject("SAFRCFileDlg.FileSave")
objDialog.FileName = ""
objDialog.FileType = "Arquivo TAP"
intReturn = objDialog.OpenFileSaveDlg

If intReturn Then

        Set objFSO = CreateObject("Scripting.FileSystemObject")

        If StrComp(Right(objDialog.FileName,4),".tap") Then
             objDialog.FileName = objDialog.FileName & ".tap"
        End If

        Set objFile = objFSO.CreateTextFile(objDialog.FileName)

        objFile.Close
       
   ArquivoTeach = objDialog.FileName
   
FileCopy "C:\Mach3\GCode\teach.tap", ArquivoTeach
A=MsgBox ("Arquivo salvo como " &  ArquivoTeach, 0, "SALVO")

End If

'*********End of Text************

THEN in your Button that does the above operation put this FS command.

on (release) {
   fscommand("VBMacro", SaveAsGcode.text);
}


// That will run your Original VB code from within flash

//scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/