This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' The main difference between functions and subs is that | |
| ' functions RETURN a value | |
| ' subs do not return a value. | |
| ' Functions are declared with: | |
| ' The return value is handled with assignment on the function name | |
| Public Function FunctionName(ByVar var1 As String) As <ReturnType> | |
| FunctionName = true | |
| End Function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' Using FileLen("path") function | |
| If (FileLen(TempDir) = 0) Then | |
| MsgBox ("COULD NOT FIND LINE IN FILE") | |
| Find_Line_nocmd = "No Line Found" | |
| Else | |
| 'MsgBox ("Found Line") | |
| With CreateObject("Scripting.FileSystemObject") | |
| strOutput = .OpenTextFile(TempDir).ReadAll() | |
| .DeleteFile TempDir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | |
| ' First method reads STDOUT directly | |
| ' Uses exec, unavoidable cmd blip | |
| Set WSH = New WshShell | |
| Set oExec = WSH.Exec("cmd /C findstr " & spattern & Space(1) & File_in) | |
| Set oOutput = oExec.StdOut | |
| Dim s As String | |
| Dim sLine As String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function NotNullOrEmpty(strTextToTest As Variant) As Boolean | |
| ' Function : NotNullorEmpty | |
| ' Work : Check if specific string is null or empty | |
| ' Called as: NotNullorEmpty(string) | |
| ' Called at: Main Form Checks | |
| ' Input : string to be checked | |
| If IsNull(strTextToTest) Then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' Change color of textbox based on conditional (Frequest Use) | |
| If DirExists(WorkDirectory) Then | |
| MsgBox ("Work directory located.") | |
| Me.LabelStatus.Value = "Initial Checks Successful." | |
| Me.LabelStatus.BackColor = lngGreen | |
| Else | |
| MsgBox ("Work directory: " & WorkDirectory & " was not located. Please restart application.") | |
| Me.LabelStatus.Value = "Initial Checks Unsuccesful. Work Directory not located" | |
| Me.LabelStatus.BackColor = lngRed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '' This will save record and move the counter to the next record. | |
| DoCmd.RunCommand acCmdSaveRecord | |
| 'DoCmd.RunCommand acCmdSaveRecord | |
| DoCmd.GoToRecord acDataForm, "FProcessedForm", acNext, 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' This will create a clock that refreshes normally on the form | |
| ' For static time instead use "=Time()" with no refresh | |
| ' 1. Insert new unbound textbox | |
| ' 2. In Format/Format set "Long Time" | |
| ' 3. In Data/Control source set "=Time()" | |
| ' 4. In Form_Load event set "Me.TimerInterval = 1000" to set it to 1 second | |
| ' 5. In Other/Name name it txtClock (Optional) | |
| ' 6. In vba: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' Using DateValue | |
| Dim exampleDate As Date | |
| exampleDate = DateValue("Jun 19, 2010") | |
| MsgBox Year(exampleDate) | |
| 'Note: Use Month and Day to get the month and day of a date. | |
| ' Using DateAdd | |
| 'To add a number of days to a date, use the DateAdd function. | |
| 'The DateAdd function has three arguments. Fill in "d" for the first argument to add days. | |
| ' Fill in 3 for the second argument to add 3 days. The third argument represents the date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Extract PDF based on Content */ | |
| // Initialize an array that will hold all the page values | |
| var pageArray = []; | |
| // Initialize the search string ΜΑΛΑΘΥΡΟΥ "ΜΑΛΑΘΥΡΟΥ"; ÊÉÓÓÁÌÏÕ | |
| var stringToSearchFor = "ΜΑΛΑΘΥΡΟΥ"; | |
| //stringToSearchFor = app.response("Enter search word"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Fri Mar 31 09:49:49 2017 | |
| @author: P.Doulgeridis | |
| """ | |
| import itertools | |
| def permutations(iterable, r=None): |