Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:06:00 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  openteachfile name
Pages: 1   Go Down
Print
Author Topic: openteachfile name  (Read 1038 times)
0 Members and 2 Guests are viewing this topic.
Bodini
Active Member

Offline Offline

Posts: 112



View Profile
« on: August 27, 2008, 08:57:47 AM »

Is it possible to have Mach prompt the user for the file name to save 'openteachfile' as?  I know, i know... it can be set to 'temp' or whatever you want, and the user can rename it after the file is created, but I forget to do that quite often.  Anyway, thats a crappy workaround and I'd like to nip it in the bud and name it from the start.

-Nick
Logged
Bodini
Active Member

Offline Offline

Posts: 112



View Profile
« Reply #1 on: August 29, 2008, 11:56:46 AM »

Code:
ppp = InputBox("Enter a File Name:")
OpenTeachFile ppp + ".tap"
code " (Code Here) "
CloseTeachFile
Call LoadStandardLayout()
Call LoadTeachFile()
« Last Edit: August 29, 2008, 11:58:39 AM by Bodini » Logged
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #2 on: September 05, 2008, 06:36:54 PM »

Hey Nick,

I stubbled across this  Smiley I dont get much time to come to the forum lately...working on the Mach screen development stuff...

This is what I would do:

Code:
Dim fso, fldr, s
Set fso = CreateObject("Scripting.FileSystemObject")

'Prompt For Teach file new Name And location
ppp = InputBox("Enter a File Name:")

'Default to C:\ if you just want the name you can allow them to make the file type too
filePath="C:\" + ppp + ".tap"

'Verify
MsgBox ("Copy File: "+ "C:\Mach3\Teach.tap" + " TO: "+ filePath + " ? ")

'Close the FIle if loaded in Mach
DOOEMButton (169)

'If you need to make the user aware there is already a file with that name
If fso.FileExists (filePath) = true Then

'Promt User

End If

'Copy it
fso.CopyFile "C:\Mach3\Teach.tap", filePath


'Open the file
loadfile filePath

'Remove System object Clean up
Set fso = Nothing


Thanks,
Jason Blake
« Last Edit: September 05, 2008, 06:51:53 PM by zealous » Logged

Regards, Jason Blake

www.Fusioncnc.com
Bodini
Active Member

Offline Offline

Posts: 112



View Profile
« Reply #3 on: September 07, 2008, 09:08:39 AM »

 :DThanks much, Jason.   I'll try it.
Logged
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #4 on: September 11, 2008, 06:13:45 PM »

Great  Grin
Logged

Regards, Jason Blake

www.Fusioncnc.com
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!