Sign in to follow this  
Followers 0
lee321987

Abbreviation that includes "\t" literally (not for a TAB char)

12 posts in this topic

I'm trying to create an abbreviation that includes a backslash followed by the letter "t", but when I try to utilize the abbreviation it's inserting a tab in place of these two chars. I guess I need to escape the backslash -- how? Double slashes does not work.

TIA

Share this post


Link to post
Share on other sites



Quite confused at your question, are you saying that in strings it replaces \t with a tab? Like \n does a carriage return?


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

@Minikori

Yes. This function is described at the top of the file abbrev.properties. No mention of a bypass is made.

Edited by lee321987

Share this post


Link to post
Share on other sites

I'm trying to create an abbreviation that includes a backslash followed by the letter "t", but when I try to utilize the abbreviation it's inserting a tab in place of these two chars. I guess I need to escape the backslash -- how? Double slashes does not work.

TIA

Note result of example.

\t produces a horizontal tab white space;

\\t produces \t

ConsoleWrite(StringFormat('"\n12\t3\\t4\t5%d\n\n"', 6))
#cs
Result is:-
"
12  3\t4    56

"
#ce

Share this post


Link to post
Share on other sites

It doesn't work in an abbreviation.

Thanks for the effort.

Share this post


Link to post
Share on other sites

It doesn't work in an abbreviation.

Thanks for the effort.

What do you mean by an abreviation?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

What do you mean by an abreviation?

Into this file:

"C:\Program Files\AutoIt3\SciTE\Properties\au3.keywords.abbreviations.properties"

I add this entry:

snd

Into this file:

C:\Documents and Settings\<user name>\abbrev.properties

I add this entry:

snd=SoundPlay("C:\Windows\Media\\tomtom_double.wav", 1)\n|

Then in SciTE I type this:

snd

Immediately upon typing the "d", the entire "snd" turns red in color (indicating it's an abbreviation), I then hit {SPACE] key to activate the abbreviation, but instead of this

SoundPlay("C:\Windows\Media\tomtom_double.wav", 1)

i get this:

SoundPlay("C:\Windows\Media\    omtom_double.wav", 1)

(sorry if this is over-explanatory -- I've had a lot of caffine)

Edited by lee321987

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Try using Ctrl+B in stead of space to expand.

Think you hit on a bug here in the LUA code.

Jos

Replace the current AutoItTools:Abbreviations Func in AutoItTools.lua with this "simple" func:

function AutoItTools:Abbreviations()
    editor:DeleteBack()
    scite.MenuCommand(IDM_ABBREV)
end

This should fix the issue.

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

@post # 8:

Try using Ctrl+B in stead of space to expand.

Think you hit on a bug here in the LUA code.

Jos

That worked.

I just had to rewrite it so all the backslashes are escaped (when using {SPACE} to expand it wasn't required).

"C:\\Windows\\Media\\tomtom_double.wav"

Edited by lee321987

Share this post


Link to post
Share on other sites

@post # 9:

OK, I replaced the AutoItTools:Abbreviations Func, and now it works like it should with space or CTRL+b.

Just two things left:

1) In case this helps -- I now have to escape all backslashes (even if I use space to expand).

2) Is it OK for me to leave this Func like this?

Thanks for the help.

Share this post


Link to post
Share on other sites

@post # 9:

OK, I replaced the AutoItTools:Abbreviations Func, and now it works like it should with space or CTRL+b.

Just two things left:

1) In case this helps -- I now have to escape all backslashes (even if I use space to expand).

2) Is it OK for me to leave this Func like this?

Thanks for the help.

Yea,this is really the way it should have been to begin with. I tried to rewrite the Ctrl+B function in LUA which was not needed at all as we know now.

I will update this for the next release of SciTE4AutoIt3.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0