View Full Version : LoadProgram into variable?


murphy625
04-11-2005, 03:27 PM
I am trying to make my interface pop up the file select window and store the filename into a var \50 instead of executing it.

Is there a neat and clean way to do this?
I understand that I could put the command !\50=C$/galiloi/work/xxxx.run right into each program itself, but this is not an option because I dont want the file to execute.
I came up with the idea that I could set a flag (!\49=1), then have each program that is loaded read that flag, set \50 and then EOP if the flag is 1 or continue executing if the flag is 0 but this just seems messy.

Is there not a better way to do this using a single command line under an Mcode?

Thanks
Murphy

Murphy's tip of the day! <<A new feature posted by the guy who asks to many questions .. :D
This code will create a file with a numerical value and add +1 to it each time its run. A new file will be created with a name that is 1 number higher than the last file. (\75 must be a number for this to work)
[[FILE_NAMING_ROUTINE]]
!\75={\75+1} :\76=\75.DMC :FILEOPEN WRITE;C$/GALILOI/WORK/\76 :FILEWRITE \999 :FILECLOSE WRITE

camsoft
04-11-2005, 06:47 PM
Murphy,

The LOADPROGRAM command all by itself will pop-up the Windows file and folders menu where you can select from any directory or NetWork drive.

The file will load into memory when doing so, but as long as you don't run the file, using CYCLESTART or RUN from the MDI window then it doesn't execute.

The LOADPROGRAM command can be put into an MCODE as you asked. If you also put on the next line the command FILENAME then you can store the file name you picked into a variable. There is also a FULL option that stores the complete filename and path into the variable too.

Tech Support
CamSoft Corp.
(951) 674-8100
support@camsoftcorp.com
www.cnccontrols.com

murphy625
04-11-2005, 08:07 PM
The FILENAME command is not listed in my Camsoft manual.

It is listed under the setup.exe help file. You just solved my 6 hour problem with less than 8 letters. LOL Thank you.!!

Murphy

camsoft
04-12-2005, 10:14 AM
Murphy,

The new version has the FILENAME command. When you go into diagnostics you see all the commands listed and spelled to you correctly as you type in interactively.

!FILENAME \1

Tech Support
CamSoft Corp.
(951) 674-8100
support@camsoftcorp.com
www.cnccontrols.com