Hello Guest it is March 28, 2024, 01:30:12 PM

Author Topic: openteachfile name  (Read 4188 times)

0 Members and 1 Guest are viewing this topic.

Offline Bodini

*
  •  216 216
    • View Profile
openteachfile name
« on: August 27, 2008, 09: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

Offline Bodini

*
  •  216 216
    • View Profile
Re: openteachfile name
« Reply #1 on: August 29, 2008, 12:56:46 PM »
Code: [Select]
ppp = InputBox("Enter a File Name:")
OpenTeachFile ppp + ".tap"
code " (Code Here) "
CloseTeachFile
Call LoadStandardLayout()
Call LoadTeachFile()
« Last Edit: August 29, 2008, 12:58:39 PM by Bodini »

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: openteachfile name
« Reply #2 on: September 05, 2008, 07:36:54 PM »
Hey Nick,

I stubbled across this  :) 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: [Select]
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, 07:51:53 PM by zealous »

Offline Bodini

*
  •  216 216
    • View Profile
Re: openteachfile name
« Reply #3 on: September 07, 2008, 10:08:39 AM »
 :DThanks much, Jason.   I'll try it.

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: openteachfile name
« Reply #4 on: September 11, 2008, 07:13:45 PM »
Great  ;D