201
Flash Screens / Re: How to round numbers
« on: September 11, 2008, 07:12:16 PM »
Great

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
var rootMenu = new ContextMenu();
rootMenu.hideBuiltInItems();
_root.menu = rootMenu;
Stage.showMenu = false;
onEnterFrame = function () {
if (Key.isDown(2)) {
trace("Your right clicking")
}
}
Right Click Menu
//////////////////
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
///////////////////////////////////////////////////////////////////////////////////
var Load_menu:ContextMenuItem = new ContextMenuItem("LOAD GCODE", load_fun, true, true, true);
var edit_menu:ContextMenuItem = new ContextMenuItem("Edit GCODE", edit_fun, false, true, true);
myMenu.customItems.push(Load_menu,edit_menu);
_root.menu = myMenu;
/////////////////////////////////////
function load_fun() {
fscommand("Button", "216");
}
function edit_fun() {
fscommand("Button", "115");
}
'***Create file system object***
'File Sytem Object
Dim objFSO As Object
'Set VB System object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Folder path
folderpath= "C:\automation"
'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count
'Message number of files
Print "There are " & GetFileCount &" Files"
'How many to check for
If GetFileCount = 7 Then
Print "If statment True"
'Get current position Move Y up + 9mm
MoveY = getoemdro(801) + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
End If
'Clean up
Set objFSO = Nothing
'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count
'Ignore If loading a file
ProgLoading = IsLoading()
'***Make a Button to turn on/OFF LED2000 (This could be your run button)***
'Ignore If loading a file and if LED2000 is off
If(ProgLoading = 0 And GetUserLEd(2000)=1) Then
'***Create file system object***
'File Sytem Object
Dim objFSO As Object
'Set VB System object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Folder path
folderpath= "C:\automation"
'Check to see if the folder is there
If objFSO.FolderExists(folderpath) Then
'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count
'No files
If GetFileCount = 0 Then
'***Set Default Values***
'Clear interLock
Call SetUserDRO(2000,"0")
Print "File Count Zero"
'Send Machine to Zero's !!! You might want to set a LED before doing this and send the axis to zero :)
'Code("G1 X0 Y0")
'***File Number return larger then 0 see how many***
Else
'If new file added Store in a DRO InterLock
If Not GetOEMDRO(2000) = StoredFileCount Then
Print("Stored Value " & GetOEMDRO(2000))
'Store new value
StoredFileCount = GetFileCount
'Store interLock User DRO 2000
SetOEMDRO(2000,StoredFileCount)
'***Depending on File count will depend will trigger one of the Case statments***
'***Check Row Count***
Select Case GetFileCount
Case 8
'Move Y up + 9mm
MoveY = getoemdro(801) + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 16
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 24
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 32
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 40
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 48
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 56
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 64
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 72
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 80
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 88
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 96
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
'End Case Statment
Case Else
End Select
'END If new file added Store in a DRO InterLock
End If
'END No files
End If
Else
'No folder exist
MsgBox "Bad File Path"
'END Folder exists
End If
'END Ignore If loading a file
End If
'Clean up
Set objFSO = Nothing
"%D:%H:%M:%S"
"+%.4f"
"%i"
"%x"