AutoHotkey Community

It is currently May 27th, 2012, 10:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: October 15th, 2008, 3:50 pm 
Offline

Joined: October 5th, 2004, 5:03 pm
Posts: 121
Location: Brasília, Brazil
I've given up... No scripts of mine work properly anymore when compiled... I've made a function in order to replace all "StringSplit" with "Loop parse" automatically.

YOU WILL HAVE TO SELECT THE ENTIRE LINE WITH StringSplit (INCLUDING LINE CARRIAGE) AND PRESS "F5".

Code:
   #SingleInstance force
   
   #Delimiter Ø
   #EscapeChar £
   #CommentFlag €
   Return

f5::
   ReplaceStringSplit()
   Return

ReplaceStringSplit(old_line="") {
   { € ;OLD LINE AS PARAMETER OR SEND CONTROL C
      If old_line =
      {
         Loop
         {
            If A_TimeIdlePhysical > 1000
               Break
            Else
               Sleep 444
         }
         AutoTrim Ø Off
         Clipboard =
         Send ^c
         ClipWait
         copied=%Clipboard%
      }
      Else
         copied=%old_line%
      StringReplace Ø copied Ø copied Ø `r Ø  All
      StringReplace Ø copied Ø copied Ø `l Ø  All
   }   
   { € ;NUMBER OF 'TABS' BEFORE SENTENCE
      StringGetPos Ø tab_number Ø copied Ø StringSplit
      Loop Ø parse Ø copied Ø ,
      {
         copied%A_Index%=%A_LoopField%
         copied0=%A_Index%
      }
   }
   { € ;DECLARE VARIABLES
      AutoTrim Ø On
      var_out = %copied2%
      var_in = %copied3%
      AutoTrim Ø Off
      delimiter =%copied4%
      StringGetPos Ø delimiter_break_line Ø delimiter Ø £n
      StringTrimRight Ø delimiter Ø delimiter Ø 1
   }
   { € ;NEWS 'TABS' BEFORE SENTENCE
      Loop %tab_number%
         tabs_string=%tabs_string%%A_Tab%
   }
   { € ;INPUT VAR WITH '%'
      If var_in contains £%
      {
         additional_script_in=%tabs_string%var_input:=%var_in%£n
         € ;MsgBox Ø 0 Ø Alert 59 - IN Ø %var_in% Ø 5
         var_in=var_input
      }
      If var_out contains £%
      {
         additional_script_out=%tabs_string%var_output:=%var_out%£n
         € ;MsgBox Ø 0 Ø Alert 63 - OUT Ø %var_out% Ø 5
         var_out=£%var_output£%
      }
   }
   { € ;NEW STRING
      final_string=;%copied%%additional_script_in%%additional_script_out%%tabs_string%Loop, parse, %var_in%,%delimiter%£n%tabs_string%{£n%tabs_string%   %var_out%£%A_Index£%=£%A_LoopField£% £n%tabs_string%   %var_out%0=£%A_Index£% £n%tabs_string%}£n
   }
   { € ;RETURN
      If old_line =
      {
         € ;Send ^d
         clipboard = %final_string%
         AutoTrim Ø On
         € ;sleep 25
         Send ^v
         Return
      }
      Else
      {
         AutoTrim Ø On
         Return final_string
      }
   }
}



Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group