Jump to content

Search the Community

Showing results for tags 'prefix'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. I haven't posted anything in the examples section for about 6-7 weeks, so felt it was that time again. This shows how to use the string functions of AutoIt and regular exp<b></b>ressi&#111;ns. The header pretty much explains what the function(s) do. #include <MsgBoxConstants.au3> #include <StringConstants.au3> MsgBox($MB_SYSTEMMODAL, '', _FilePrefix(@ScriptFullPath)) ; Append _ thus creating C:\Example\Test_.exe MsgBox($MB_SYSTEMMODAL, '', _FilePrefixSRE(@ScriptFullPath & '.text')) ; Append _ thus creating C:\Example\Test_.exe ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FilePrefixSRE ; Description ...: Append a prefix before the file extension. ; Syntax ........: _FilePrefixSRE($sFilePath[, $sPrefix = Default]) ; Parameters ....: $sFilePath - Filepath or name to append a prefix before the file extension. ; $sPrefix - [optional] A string value. Default is '_'. ; Return values .: Success - Filepath with the intended prefix. ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _FilePrefixSRE($sFilePath, $sPrefix = Default) If $sPrefix = Default Or StringStripWS($sPrefix, $STR_STRIPALL) == '' Then $sPrefix = '_' Return StringRegExpReplace($sFilePath, '^(.+?)(\.\w+)?$', '${1}' & $sPrefix & '${2}') EndFunc ;==>_FilePrefixSRE ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FilePrefix ; Description ...: Append a prefix before the file extension. ; Syntax ........: _FilePrefix($sFilePath[, $sPrefix = Default]) ; Parameters ....: $sFilePath - Filepath or name to append a prefix before the file extension. ; $sPrefix - [optional] A string value. Default is '_'. ; Return values .: Success - Filepath with the intended prefix. ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _FilePrefix($sFilePath, $sPrefix = Default) If $sPrefix = Default Or StringStripWS($sPrefix, $STR_STRIPALL) == '' Then $sPrefix = '_' Local $iDot = StringInStr($sFilePath, '.', Default, -1) - 1 If $iDot <= 0 Then $iDot = StringLen($sFilePath) Return StringLeft($sFilePath, $iDot) & $sPrefix & StringTrimLeft($sFilePath, $iDot) EndFunc ;==>_FilePrefix
  2. Hello, I've noticed that all the included examples uses a variable practice like so: $sWow64 (string) $hImage (handle) For $iY = 0 To $iH - 1 (integers) and so on... Which seems to be a nice practice in general. I'm wondering if there's any list of all the data types, and how they are/can/should be used when it comes to naming variables? Or quality discussions on this specific area regarding coding standards. For example, I'm not yet sure what data type $tSomething means (an example from the help file states: "a variable for use with DllStruct calls" which isn't that clear to me)
×
×
  • Create New...