Jump to content

"Type Ahead" of functions in editor


Recommended Posts

I discovered that my version of String.au3 does not include the function I found on line :

_StringTitleCase()

I went to GitHUB ,copied this function and added to my existing String.au3

However, when typing this command into the script editor, the type ahead does not include this command. Its as  if this function does not exist.

I believe that there is a file somewhere that I need to update to get this functionality ?

Thanks for your help

Link to comment
Share on other sites

1 hour ago, AutoitMike said:

However, when typing this command into the script editor, the type ahead does not include this command. Its as  if this function does not exist. I believe that there is a file somewhere that I need to update to get this functionality ?

Check : https://www.autoitscript.com/autoit3/docs/history.htm

There you will find :

3.3.10.0 (23rd December, 2013) (Release)

Added #2193: _StringTitleCase(), to create a title case string.

I guess, you are running an older Version of AutoIt.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

the relevant question is  :)
what version of the Autoit you have ?
why didn't you download the last one?

; #INDEX# =======================================================================================================================
; Title .........: String
; AutoIt Version : 3.3.16.1
; Description ...: Functions that assist with String management.
; Author(s) .....: Jarvis Stubblefield, SmOke_N, Valik, Wes Wolfe-Wolvereness, WeaponX, Louis Horvath, JdeB, Jeremy Landes, Jon, jchd, BrewManNH, guinness
; ===============================================================================================================================

; #CURRENT# =====================================================================================================================
; _HexToString
; _StringBetween
; _StringExplode
; _StringInsert
; _StringProper
; _StringRepeat
; _StringTitleCase
; _StringToHex
; ===============================================================================================================================

 

I know that I know nothing

Link to comment
Share on other sites

@AutoitMike :

If you don't want to update to a newer version of AutoIt (e.g. due to possible script-breaking-changes), you can add the function to your 'older' String.au3 or to your script.

Test

Local $sString = "this is a test for _StringTitleCase"

MsgBox(0, "_StringTitleCase", $sString & @CRLF & _StringTitleCase ($sString) & @CRLF)


; #FUNCTION# ====================================================================================================================
; Author ........: BrewManNH
; Modified ......:
; ===============================================================================================================================
Func _StringTitleCase($sString)
    Local $bCapNext = True, $sChr = "", $sReturn = ""
    For $i = 1 To StringLen($sString)
        $sChr = StringMid($sString, $i, 1)
        Select
            Case $bCapNext = True
                If StringRegExp($sChr, "[a-zA-Z\xC0-\xFF0-9]") Then
                    $sChr = StringUpper($sChr)
                    $bCapNext = False
                EndIf
            Case Not StringRegExp($sChr, "[a-zA-Z\xC0-\xFF'0-9]")
                $bCapNext = True
            Case Else
                $sChr = StringLower($sChr)
        EndSelect
        $sReturn &= $sChr
    Next
    Return $sReturn
EndFunc   ;==>_StringTitleCase

 

However, no help for this function will be displayed.

The better solution would be to update to a newer version of AutoIt, as already noted by @ioa747.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

  • 2 weeks later...

I am usually scared to death to update anything.

I know that the latest version of AutoIt is a code killer for previous versions.

My mantra is :

"If it aint broke, dont fix it"

However, it seems that there has to be someway to include this function's type ahead that I have added to the include file.

Its going to take some research.........

Link to comment
Share on other sites

@AutoitMike Well if you don't like updating, then you may not like this, but Jos is working on an update to SciTE to have a dynamic/on the fly intellisense/type ahead that you're looking for, I believe: 

Otherwise it involves, as I understand it, updating the SciTE lexar/api: https://www.autoitscript.com/site/autoit-script-editor/downloads/

Specifically probably the "au3.api" file, which when I open it up with a text editor, I see things like:

MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] ) Perform a mouse click operation.
MouseClickDrag ( "button", x1, y1, x2, y2 [, speed = 10] ) Perform a mouse click and drag operation.
MouseDown ( "button" ) Perform a mouse down event at the current mouse position.
MouseGetCursor (  ) Returns the cursor ID Number for the current Mouse Cursor.
MouseGetPos ( [dimension] ) Retrieves the current position of the mouse cursor.
MouseMove ( x, y [, speed = 10] ) Moves the mouse pointer.

Which seems to match up exactly with ScITEs intellisense/type ahead/function complete/whatever.

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...