
aslani
Active Members-
Posts
303 -
Joined
-
Last visited
Profile Information
-
Location
3-dim array
aslani's Achievements

Universalist (7/7)
2
Reputation
-
mawaissharif reacted to a post in a topic: ExcelCOM_UDF
-
mawaissharif reacted to a post in a topic: ExcelCOM_UDF
-
I'm sorry but I found the culprit, it's my StringReg. StringRegExp($rev, ".{1,60}\b\.?", 3) Ok start over. The StringReg is to insure that the characters per line won't exceed 60 characters, but as you can see, it strips the last quotation because of the "\b" and to get the quotation, I have to use "\B", but not both of them at the same time (or can I?). Any idea how to fix my StringReg pattern?
-
$var1 = "REV """ & $rev & """" $var2 = "REV " & Chr(34) & $rev & Chr(34) $var3 = 'REV "' & $rev & '"' Send($var1) Send($var2) Send($var3) They all come out like this; REV "A1 without the end quotation mark. Not really sure why. Any advice? EDIT: By the way, when I view it using MsgBox(), the end quotation is there.
-
Ah thanks, that's what i'm looking for. ty.
-
Ok here's the whole story. I have a list/array of all part numbers with revisions, I want to separate the parts with solid revisions from the parts with bumped revisions (i.e. "A1", "A2", etc). Since there's only few bumped revisions, I just want to simply delete them from the list, then have their own list/array (which I have not done yet because I'm still trying to figure out how to identify that number) later on. Each list goes on to their own database later down the scripts. I hope that's clear.
-
I have a variable that can have different values ranging from "A", "A1" - "A9", "AA", "AB",etc. Example: $var1 = "A" ;or $var1 = "A1" ;or $var1 = "AA" Now I have this in place: If StringRight($var1, 1) == "1" Then _ArrayDelete($m22bmp, 1) EndIf Now I'm stuck on the part that if the number is not "1". I need a command that if the StringRight($var, 1) is of any number, then delete it from the array. How do I write that command? My gut says to use StringRegExp(), but how would I write it? Thanks in advance.
-
Oh wow, that work. I misunderstood the "if the destination already exist" thinking that if the folder I'm transfering is already in the destination that's why I didn't flag it. Thank you. EDIT: Ok, it worked but it dumps everything on the Desktop rather than inside the folder. Example: Folder_1 - File_1 - File_2 After DirMove(), it looks like this; Desktop - Folder_1 - File_1 - File_2 Instead of; Desktop - Folder_1 -- File_1 -- File_2 Any suggestion? EDIT 2: nvm I figured it out, it came to me as I was typing the first edit. DirMove("N:\Temp\" & $g_kECO, @DesktopDir & "\" & $g_kECO, 1) Thank you all for you help.
-
I tried both suggestions...still didn't work. I'm wondering because FileExists() works just fine with mapped directory, what makes moving the folder special?
-
Ok sift thru the search already and nada. Basically, we get our work from a network directory and we move that folder into our desktop and start on working on the contents. I made a program that assists on the work load in the folder and it will be really helpful to add a function that automatically moves the folder into the desktop, but using either of the move function doesn't seems to work. Here's what I have. Case $msg = $k_mECO $g_kECO = GUICtrlRead($k_eco) If FileExists("N:\Temp\" & $g_kECO) Then DirMove("N:\Temp\" & $g_kECO, @DesktopDir) Else MsgBox(0, $g_kECO, $g_kECO & " not found!") EndIf If FileExists(@DesktopDir & "\" & $g_kECO) Then MsgBox(0, $g_kECO, $g_kECO & " move was a success!") Else MsgBox(0, $g_kECO, $g_kECO & " move failed!") EndIf $g_kECO is the folder name. Any help is appreciated.
-
can a variable be used with a variable in the name?
aslani replied to loki1982's topic in AutoIt General Help and Support
I think you kinda have to since how do you intend to check each value and return the appropriate result? Edit: I completely missed what you're trying to do Hubertus72 got it right. -
Nevermind I found the answer in the GUI Forum. WinMove("Untitled -", "", 0, 0, 200, 200) Please close/delete. *resolved*
-
I'm not sure how to search for this, I tried but is returned other unrelated results, so here goes. When I Run() Notepad for example, it opens to the last window size. So if I closed is as 200x200, it opens as 200x200. What I want to do is, if Notepad was closed as 150x150, I want to Run() it as 200x200. This is where I need help. I can read the window size, but how can I manipulate it? The reason why I want to control this because the control coordinates is so dependant to the size of the window and my program doesn't run properly if the user has a different window size. Any help is appreciated.
-
Thanks, it's a great script but it can't find the file/folder I specified...even giving the whole filename. I don't know why because I can only understand half of what's going on on that script. Although I like the fact that it looks into subfolder even only giving the main folder, so that's a good start for me. But the script runs too slow because it's searching into every folder. What I want to do is create a smart search using the prefix of the filename because that's how they are sorted in the Main folder. Main Folder -Assemblies -- 100 --- 1001001.extasm --- 1001002.extasm -- 200 --- 2009001.extasm --- 2009002.extasm etc. -Parts -- 100 --- 1001001.extprt --- 1001002.extprt -- 200 --- 2009001.extprt --- 2009002.extprt etc. So basically I want the script to jump into the Main folder, strip the search keyword of the first 3 number, then add that 3 numbers to the file path (i.e. MainFolder\Parts\200\) then it will search in Assemblies folder, Parts folder, etc. until it find the keyword and everything that has those keyword (i.e. keyword=2009*, it will return everything that start with 2009 which mean both 2009001.extasm and 2009001.extprt).
-
Ok, I've search the forum but the ones I've found doesn't really answer my question so here goes. I'm trying to create a File/Folder Search alternative. Normally in WinXP, you simply right click on the folder then click Search... and a window will open where you can search for a file name. For some reason, due to security setup at work, this doesn't work 100% at a time. I've already create a simply file executor, but that requires that you know the whole name and extension. But what I'm trying to do is create a search box that will search for the first 3 number and return everything, from folder to files, with that starting 3 number into an array. Here's what I have but it doesn't work; Dim $sFileArray[1] $sPrefix = StringLeft(GUICtrlRead($sInput), 3) $sHandle = FileFindFirstFile("N:\Solidworks\MASTER\" & $sPrefix) Do $sFound = FileFindNextFile($sHandle) _ArrayAdd($sFileArray, $sFound) Until @error _ArrayDisplay($sFileArray) Any suggestions?
-
Mouse click center of screen problem
aslani replied to abb's topic in AutoIt General Help and Support
The G15 keyboard (I have the G11) sometimes executes the macros when running AutoIT. You may have a macro on your keyboard program that automates a mouse click and your Autoit script somehow calls that macro with a key press combination. Example: My F1 is a login macro to one of my online game. And if I have an AutoIt hotkey set as Ctrl+F1, AutoIt will press Ctrl then the F1, but the keyboard macro will execute my login macro rather than completing the hotkey set triggering my AutoIt function. Just something you might want to rule out. -
Just curious, what's your opinion?
aslani replied to netman74501's topic in AutoIt General Help and Support
I'd do it this way #include <GuiConstants.au3> $title = "PixiHex" GuiCreate($title, 200, 200) GuiSetIcon(@SystemDir & "\mspaint.exe", 0) $mPos = MouseGetPos() $mColor = PixelGetColor($mPos[0], $mPos[1]) $bkColor = "0x" & Hex($mColor, 6) HotKeySet("{ESC}", "_Exit") HotKeySet("^!p", "_Go") ; Ctrl + Alt + P HotKeySet("^!t", "_Exit") GUICtrlCreateLabel("The color of the pixel" & @CRLF & "beneath the cursor is" & @CRLF & "displayed on the right:", 13, 20) GUICtrlCreateLabel("The Hex value of this color is: ", 13, 65) $SC1 = GUICtrlCreateLabel (Hex($mColor, 6), 13, 80) GUICtrlCreateLabel("The Decimal value of this color is: " , 14, 105) $SC2 = GUICtrlCreateLabel($mColor, 13, 120) $SC3 = GuiCtrlCreateLabel("", 135, 15, 50, 50) GuiCtrlSetBkColor(-1, $bkColor) GUICtrlCreateCheckbox("Set as Always On Top", 13, 160) GUICtrlSetState(-1, $GUI_CHECKED) WinSetOnTop("PixiHex", "", 1) ; GUI MESSAGE LOOP GuiSetState(@SW_SHOW) While 1 $msg = GuiGetMsg() $checkbox=GUICtrlRead(7) Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func _Go() $mPos = MouseGetPos() $mColor = PixelGetColor($mPos[0], $mPos[1]) $bkColor = "0x" & Hex($mColor, 6) GuiCtrlSetBkColor($SC3, $bkColor) GUICtrlSetData($SC2,$mColor) GUICtrlSetData($SC1,Hex($mColor, 6)) EndFunc ;==>_Exit Func _Exit() Exit EndFunc ;==>_Exit