Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 04:14:26 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach Screens
| | |-+  Flash Screens
| | | |-+  How to save as in flash screen?
Pages: 1   Go Down
Print
Author Topic: How to save as in flash screen?  (Read 846 times)
0 Members and 1 Guest are viewing this topic.
azambuja
Active Member

Offline Offline

Posts: 10


View Profile
« on: June 25, 2008, 03: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.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #1 on: June 25, 2008, 06: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
Logged

All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!