Jump to content

Search the Community

Showing results for tags 'guid isguid create'.

  • 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

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

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 1 result

  1. Check whether a GUID is valid. You may only need to copy one function only. Source: https://en.wikipedia.org/wiki/Guid Function: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _IsGUID ; Description ...: Check whether a GUID string is valid. ; Syntax ........: _IsGUID($sString) ; Parameters ....: $sString - Check a GUID string with or without brackets is valid. ; Return values .: Success: True ; Failure: False ; Author ........: guinness ; Remarks .......: SRE: http://mitchelsellers.com/blogs/2007/04/22/validating-a-guid-value-with-regular-expressions.aspx ; Example .......: Yes ; =============================================================================================================================== Func _IsGUID($sString) Return StringRegExp($sString, '^(?:(?<curly>\{)?[0-9A-Fa-f]{8}-(?:[0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}(?(curly)\}))$') > 0 EndFunc ;==>_IsGUIDFunction: (Different approach) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _IsGUID ; Description ...: Check whether a GUID string is valid. ; Syntax ........: _IsGUID($sString) ; Parameters ....: $sString - Check a GUID string with or without brackets is valid. ; Return values .: Success: True ; Failure: False ; Author ........: guinness ; Remarks .......: SRE: http://mitchelsellers.com/blogs/2007/04/22/validating-a-guid-value-with-regular-expressions.aspx ; Example .......: Yes ; =============================================================================================================================== Func _IsGUID($sString) Return StringRegExp($sString, '^(?:(?<curly>\{)?[[:xdigit:]]{8}-(?:[[:xdigit:]]{4}-){3}[[:xdigit:]]{12}(?(curly)\}))$') > 0 EndFunc ;==>_IsGUIDExample use of Function: Example() Func Example() Local $sGUID = CreateGUID() ; Or _WinAPI_CreateGUID() from WinAPIEx.au3. ConsoleWrite($sGUID & ': ' & _IsGUID($sGUID) & @CRLF) $sGUID = '{EBEB-642D-11E2-B009-B121}' ConsoleWrite($sGUID & ': ' & _IsGUID($sGUID) & @CRLF) $sGUID = '{E25F2E50-6497-11E2-BE9E-182679957A39}' ConsoleWrite($sGUID & ': ' & _IsGUID($sGUID) & @CRLF) $sGUID = 'EF3391DE-6497-11E2-B99A-182679957A39' ConsoleWrite($sGUID & ': ' & _IsGUID($sGUID) & @CRLF) EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: CreateGUID ; Description ...: Create a valid GUID. ; Syntax ........: CreateGUID() ; Parameters ....: None ; Return values .: Success: GUID string ; Failure: Empty string and sets @error to non-zero ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func CreateGUID() ; Converted from a VBScript I had. Local $oTypeLib = ObjCreate('Scriptlet.TypeLib') If IsObj($oTypeLib) = 0 Then Return SetError(1, 0, '') EndIf Return StringLeft($oTypeLib.Guid, 38) EndFunc ;==>CreateGUID
×
×
  • Create New...