Blank line

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
koolkid
Posts: 14
Joined: Sun Feb 15, 2004 2:25 pm

Blank line

Post by koolkid »

hi
i'd like to know if there is any tool or macro that lets me write my java code with one blank line between every code line
f.i.:
class A {

int i = 1;

String st = "";

}
thanks
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Take a look at TP's help file under "How to Double Space Lines".
If you do decide to record the steps there into a macro you can then assign it a
keyboard shortcut under Configure->Preferences->Keyboard, Categories(Macros).
HTH
Then I open up and see
the person fumbling here is me
a different way to be
koolkid
Posts: 14
Joined: Sun Feb 15, 2004 2:25 pm

Post by koolkid »

thanks for answering; but if i understood you correctly, i've to do it every time i'm writing a file; isnt there a way to have it all the time?
thanks again

EDIT
the ideal would be: when i click enter, then 2 lines are added!
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Just created a macro with Enter-Enter in it, but TP does not allow me to assign
the keyboard shortcut Enter to it, Ctrl-Enter is ok but I guess you might just
as well press enter-enter manually instead :lol:
Perhaps this is an IDE or a word processing feature?
Anyone else care to take a stab a this?
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

The scripting language AutoIt can let you simulate two Enter keypresses. AutoIt's Support Forum link

Code: Select all

; AutoIt 3.0.100 Script
; When run, the Enter key in TextPad inserts two lines.
; Script automatically terminates when TextPad is closed.
;
Opt("TrayIconHide", 0)  ;0=show, 1=hide
HotKeySet("{Enter}", "DoubleSpace")
While WinExists("TextPad")
   sleep(100)
WEnd
Exit

Func DoubleSpace()
   HotKeySet("{Enter}")  ;unregister hotkey to avoid infinite loop!
   Send("{Enter}")
   If WinActive("TextPad") Then  ;then send Enter again
      Send("{Enter}")
   EndIf
   HotKeySet("{Enter}", "DoubleSpace")  ;re-register hotkey
EndFunc
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Do you really need the blank lines within the file?

Or do you need them "only" when you print the file?
If so, go to Configure - Preferences - Document Classes - <your document class> - Printing.
Check "Double Space".
koolkid
Posts: 14
Joined: Sun Feb 15, 2004 2:25 pm

Post by koolkid »

yes: to write i'd like 2 lines
koolkid
Posts: 14
Joined: Sun Feb 15, 2004 2:25 pm

Post by koolkid »

CyberSlug:
tx for the code.
i downloaded the autoit, read the help but i'm still stuck with it.
some Qs:
what's the extention of your script?
how do i run it?
how do i add it to textpad?
thanks a lot
koolkid
Posts: 14
Joined: Sun Feb 15, 2004 2:25 pm

Post by koolkid »

i guess i got it running, but when autoit sees a "()" gives an error, saying cant parse the file!
can you hlp pls?
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

koolkid wrote:i guess i got it running, but when autoit sees a "()" gives an error, saying cant parse the file!
can you hlp pls?
1) Make sure you have the lastest AutoIt version
2) Copy the code exactly and save it with the file extension .au3
3) Make sure TextPad is running
4) Double click the .au3 file, and it should run without errors.
5) To end the script, either close TextPad; or right click the tray icon that looks like the letter A.

Email me if you need more help: philipgump AT yahoo DOT com
koolkid
Posts: 14
Joined: Sun Feb 15, 2004 2:25 pm

Post by koolkid »

hi
just to say congrats to whom made all this possible
Great!
thanks
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Okay CyberSlug....you've finally done it. 8)

:idea: After seeing all of your AutoIt solutions, I finally bit the bullet, downloaded latest version, and registered with forum.

Now I only have to force myself to make some time to learn this. :roll:

Thanks for the incentive. See you at hiddensoft. :arrow:
Hope this was helpful.............good luck,
Bob
Post Reply