It has been bugging me for a while now.
Can you view the AutoIt code from within a compiled exe. Like how you can with most .Net exe's by using a certain program.
If this is possible, how then can I secure my program (if this method exists).
Yesterday I had to make some little changes to an old Autoit program we use at my work.
The program reads some data and convert it to Excel.
Before writing the cell, it is changed to text and later on I slap the column with an autofitwidth.
Furthermore weI execute a conditional format on the sheet, to make the data more readable.
I quickly found out that because of the breaking changes Excel.udf had starting from AutoIt 184.108.40.206,
a lot of things had to been changed.
The changes I had to do, only took 10 minutes.
After trying to adjust the script for over 5 hours, to get it working with the new Excel.udf, I gave up.
I stopped changing the script, uninstalled the my Autoit and went looking for an older version.
Luckilly I was able to find Autoit v220.127.116.11 (with corresponding Scite) in my software repository.
Installing Autoit V18.104.22.168 and compiling the file, now took me 10 minutes .
So why did I not get the old script working with the new Excel.udf?
There are several reasons I failed getting the old script working with the new Excel UDF.
I had some pressure from management to fix it ASAP (and got a little anxious) Most all resources on the internet point to the working of the old EXcel.UDF And offcourse there were thosing "breaking changes",
with new functions using diffrent parameters or using parameters in different order. One of the column's on the sheet is used to store EAN13 (barcode) and was formatted like 1,23E12.
I couldn't change the cell to text, also autofitwidt was not working and using conditional formatting was also a no-no.
So in the end I could use the new Excel UDF, but not desapointed management.
What would I like to ask?
I understand that sometimes you want to rewrite a program to make it better. I even understand that one has to make breaking changes sometimes.
But in this case because of lacking examples/resources my day went completely down the drain.
I would like to ask the Excel.udf developpers to:
Make more functions available to do things like changing cell properties easily, changing cell color, do an autofit columnwidth, format data conditionally.
Or write an Example using the (new) Excel UDF, making examples how to format a cell, do conditional format, changing cell colors etc.
I probably am more of an example guy.
Having a good Excel.UDF Example showing a lot of common things normally makes, programming things easy for me.
Because I can keep tweaking snippets until I get it working the way I want it.
So dear developpers, could you help me and other future user out?
I've failed to find an example of _Word_DocFindReplace which searches for formatted text (I'm looking for stand alone paragraph marks that are formatted other than normal i.e. Bold Italic, Underlined).
The reason being that when converting a Word document to html one of the main problems in the results is that a stand alone paragraph mark is converted to an html space that retains the formatting ...> <... thus showing up as a underline _ in a browser when it should be blank. I've played around with the script and got it to at least un-bold the first paragraph mark regardless if it was bold or not but I'd like to clear all formatting from any stand alone paragraph marks in the whole document. Below is what I've done so far (not much more than in the help file I'm afraid) . Way down at the bottom of the _Word_DocFindReplace help text is this parameter but without any examples to be found :
$bFormat [optional] True to have the find operation locate formatting in addition to or instead of the find text (default = False) #include <MsgBoxConstants.au3> #include <Word.au3> $processing = @MyDocumentsDir & '\AutoIt_code\getter\processing\' Global $oWord = _Word_Create() Global $sTestfile = $processing & "Testing.docx" ConsoleWrite($sTestfile & @CRLF) Global $oDoc = _Word_DocOpen($oWord, $sTestfile) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "ERROR", "Error opening file = '" & $sTestfile & "'" & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oRangeFound = _Word_DocFind($oDoc, "^p", Default, Default) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error locating paragraph control character in the document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oRangeFound.Bold = False If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error inserting text after the paragraph control character in the document." & @CRLF & "@error = " & @error & _ ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", "Paragraph control character successfully replaced." & @CRLF & _ "Text inserted in paragraph 2.")
i want to optimize my search code, because i don't think that my solution is "acceptable" from development perspective, it might be optimized.
I have a text file, i read it and i copy all the entries to an Array, then i have to start a search to see if a specific entry is present. I have about ten different strings to search.
Func FileSearch($file_content_array, $search) $j=0 For $i = 0 To UBound($file_content_array) - 1 $search_result=StringInStr($file_content_array[$i],$search) If $search_result<>0 Then ReDim $searchResultArray[UBound($searchResultArray) + 1] $searchResultArray [$j] = $file_content_array[$i] $j+=1 EndIf Next Return $searchResultArray EndFunc My solution would be ok for a single search, but in case of multiple searches? would it be still good?
I have thought to use a 2D Array, where the first column is the array-item and the second column is "yes" or "no". But what about the searches? Do i have to use 10 times the function?
In case of questions: I have to scan a directory and check whether some files are present or not and then write into another file:"yes, it is present", "no, it is not present".
Thanks in advance
I'm not too code savvy but I know this is a simple one! Here's my problem, I have a folder with text files containing gcode. they are appended .nc, .ngc, and .gcode randomly. I can rename them all .ngc which is my preferred file type. In these files there's lines of gcode, carrying commands for a CNC. What I need to do is remove some comments from the beginning and format the text a certain way. I'll show an example of the original file and what I need it to look like. The files can be 20 lines or 10,000 long depending on the part.
( Header 1 text )
( Header 2 text )
G90 (set absolute distance mode)
G90.1 (set absolute distance mode for arc centers)
G17 (set active plane to XY)
G21 (set units to mm)
#<z_safe> = 0.250
#<plunge_feed> = 5
G0 X 17.2644 Y 1.6127
G1 X 2.2842 Y 8.0674 F 0.01
G1 X 15.3642 Y 17.8133
G1 X 17.2644 Y 1.6127
G0 X 0.0000 Y 0.0000
What it needs to look like:
G0 X17.2644 Y1.6127
G1 X2.2842 Y8.0674 <--- copy and paste above the next m05
G1 X15.3642 Y17.8133
G1 X17.2644 Y1.6127
G1 X2.2842 Y8.0674 <--- pasted here
G0 X0.000 Y0.000
Some things to note: g90 sets absolute coordinate mode, g21 tets units to mm, g0 is first coordinate to move the tool to.
This is an important step: m03 is what turns on a laser. I need the first coordinate after every m03 to be copied to the line above m05 for each chunk of gcode. the very last m05 before the m02 needs to be ignored. There are multiple chunks with m03 x,ys then m05. each chunk is going to have different coordinates after the m03.
I have no idea where to start other than find the line with the wanted string, m03. dont know how to handle m05 though... any help is very much appreciated!