Developers Jos Posted February 10, 2009 Author Developers Posted February 10, 2009 Which past are you talking about because the major changes in the LUA stuff were done quite some time ago?01/26/2008*** Updated SciTE v 1.75 (Neil Hodgson)*** Updated LUA Functions: - Added directory LUA with several files containing the set of new LUA scripts written by Valik and modified by me to be backwards compatible and included the missing functions. - Added color which identifies word type to the AutoComplete ToolBox. (Valik) - Automatic adjusting horizontal scrollbar. (Valik) - The GotoFunc will not search in Commented lines. (Valik) - Many internal improvements. (Valik) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
TheSaint Posted February 10, 2009 Posted February 10, 2009 (edited) Which past are you talking about because the major changes in the LUA stuff were done quite some time ago?Up until just recently, I've still been using AutoIt v3.2.4.9 (way behind I know ... I like to take my time ... plus have a reason to update usually ... unless it's a no boner ... lot's of major changes since v3.2.6.0, mean I've taken a lot longer than usual to update ... free time related). I did make an attempt to update on a couple of occasions, but because I discovered issues, didn't have much time, didn't need to update, and most importantly, was developing some big programs and didn't want to get involved with compatibility issues, I decided to put it off till another more appropriate time.So can you tell me whether this issue is just a path or variable one only ... and maybe point that out to me ... please? Edited February 10, 2009 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)
trancexx Posted April 7, 2009 Posted April 7, 2009 Jos, would I bother you too much If I would ask you to move the line further more for Tidy.exeI have this function as part of script and I can't tidy it properly (need to cut it every time). It's a function with some big array, nothing illegal:expandcollapse popupFunc _VirtualKey($iValue, $iMode) If $iMode Then Return SetError(0, 0, '"^' & Chr($iValue + 64) & '"') EndIf If $iValue < 1 Or $iValue > 254 Then Return SetError(0, 1, "") EndIf Local $aArrayVirtualKey[254][2] = [[1, "Left mouse"], _ [2, "Right mouse"], _ [3, "CTRL + BREAK"], _ [4, "Middle mouse"], _ [5, "X1 mouse"], _ [6, "X2 mouse"], _ [7, ""], _ [8, "BACKSPACE"], _ [9, "TAB"], _ [10, ""], [11, ""], _ [12, "CLEAR"], _ [13, "ENTER"], _ [14, ""], [15, ""], _ [16, "SHIFT"], _ [17, "CTRL"], _ [18, "ALT"], _ [19, "PAUSE"], _ [20, "CAPS LOCK"], _ [21, "IME Hangul mode"], _ [22, "IME Junja mode"], _ [23, "IME final mode"], _ [24, "IME Hanja mode"], _ [25, "IME Kanji mode"], _ [26, ""], _ [27, "ESC"], _ [28, "IME convert"], _ [29, "IME nonconvert"], _ [30, "IME accept"], _ [31, "IME mode change request"], _ [32, "SPACEBAR"], _ [33, "PAGE UP"], _ [34, "PAGE DOWN"], _ [35, "END"], _ [36, "HOME"], _ [37, "LEFT ARROW"], _ [38, "UP ARROW"], _ [39, "RIGHT ARROW"], _ [40, "DOWN ARROW"], _ [41, "SELECT"], _ [42, "PRINT"], _ [43, "EXECUTE"], _ [44, "PRINT SCREEN"], _ [45, "INS"], _ [46, "DEL"], _ [47, "HELP"], _ [48, "0"], _ [49, "1"], _ [50, "2"], _ [51, "3"], _ [52, "4"], _ [53, "5"], _ [54, "6"], _ [55, "7"], _ [56, "8"], _ [57, "9"], _ [58, ""], [59, ""], [60, ""], [61, ""], [62, ""], [63, ""], [64, ""], _ [65, "A"], _ [66, "B"], _ [67, "C"], _ [68, "D"], _ [69, "E"], _ [70, "F"], _ [71, "G"], _ [72, "H"], _ [73, "I"], _ [74, "J"], _ [75, "K"], _ [76, "L"], _ [77, "M"], _ [78, "N"], _ [79, "O"], _ [80, "P"], _ [81, "Q"], _ [82, "R"], _ [83, "S"], _ [84, "T"], _ [85, "U"], _ [86, "V"], _ [87, "W"], _ [88, "X"], _ [89, "Y"], _ [90, "Z"], _ [91, "Left Windows key"], _ [92, "Right Windows key"], _ [93, "Applications key"], _ [94, ""], _ [95, "Computer Sleep key"], _ [96, "Numpad 0"], _ [97, "Numpad 1"], _ [98, "Numpad 2"], _ [99, "Numpad 3"], _ [100, "Numpad 4"], _ [101, "Numpad 5"], _ [102, "Numpad 6"], _ [103, "Numpad 7"], _ [104, "Numpad 8"], _ [105, "Numpad 9"], _ [106, "Multiply"], _ [107, "Add"], _ [108, "Separator"], _ [109, "Subtract"], _ [110, "Decimal Point"], _ [111, "Divide"], _ [112, "F1"], _ [113, "F2"], _ [114, "F3"], _ [115, "F4"], _ [116, "F5"], _ [117, "F6"], _ [118, "F7"], _ [119, "F8"], _ [120, "F9"], _ [121, "F10"], _ [122, "F11"], _ [123, "F12"], _ [124, "F13"], _ [125, "F14"], _ [126, "F15"], _ [127, "F16"], _ [128, "F17"], _ [129, "F18"], _ [130, "F19"], _ [131, "F20"], _ [132, "F21"], _ [133, "F22"], _ [134, "F23"], _ [135, "F24"], _ [136, ""], [137, ""], [138, ""], [139, ""], [140, ""], [141, ""], [142, ""], [143, ""], _ [144, "NUM LOCK"], _ [145, "SCROLL LOCK"], _ [146, ""], [147, ""], [148, ""], [149, ""], [150, ""], [151, ""], [152, ""], [153, ""], [154, ""], [155, ""], [156, ""], [157, ""], [158, ""], [159, ""], _ [160, "Left SHIFT"], _ [161, "Right SHIFT"], _ [162, "Left CONTROL"], _ [163, "Right CONTROL"], _ [164, "Left MENU"], _ [165, "Right MENU"], _ [166, "Browser Back key"], _ [167, "Browser Forward key"], _ [168, "Browser Refresh key"], _ [169, "Browser Stop key"], _ [170, "Browser Search key"], _ [171, "Browser Favorites key"], _ [172, "Browser Start and Home key"], _ [173, "Volume Mute key"], _ [174, "Volume Down key"], _ [175, "Volume Up key"], _ [176, "Next Track key"], _ [177, "Previous Track key"], _ [178, "Stop Media key"], _ [179, "Play/Pause Media key"], _ [180, "Start Mail key"], _ [181, "Select Media key"], _ [182, "Start Application 1 key"], _ [183, "Start Application 2 key"], _ [184, ""], [185, ""], _ [186, ";:(US standard keyboard)"], _ [187, "="], _ [188, ","], _ [189, "-"], _ [190, "."], _ [191, "/?(US standard keyboard)"], _ [192, "`~(US standard keyboard)"], _ [193, ""], [194, ""], [195, ""], [196, ""], [197, ""],[198, ""], [199, ""], [200, ""], [201, ""], [202, ""], [203, ""], [204, ""], _ [205, ""], [206, ""], [207, ""], [208, ""], [209, ""], [210, ""], [211, ""], [212, ""], [213, ""], [214, ""], [215, ""], _ [216, ""], [217, ""], [218, ""], _ [219, "[{(US standard keyboard)"], _ [220, "\|(US standard keyboard)"], _ [221, "]}(US standard keyboard)"], _ [222, "'single-quote/double-quote' key(US standard keyboard)"], _ [223, ""], [224, ""], [225, ""], _ [226, "backslash(RT 102-key keyboard)"], _ [227, ""], [228, ""], _ [229, "IME PROCESS key"], _ [230, ""], _ [231, "VK_PACKET"], _ [232, ""], _ [233, ""], [234, ""], [235, ""], [236, ""], [237, ""], [238, ""], [239, ""], [240, ""], [241, ""], [242, ""], [243, ""], [244, ""], [245, ""], _ [246, "Attn key"], _ [247, "CrSel key"], _ [248, "ExSel key"], _ [249, "Erase EOF key"], _ [250, "Play"], _ [251, "Zoom"], _ [252, ""], _ [253, "PA1 key"], _ [254, "Clear key"]] Return SetError(0, 0, $aArrayVirtualKey[$iValue - 1][1]) EndFuncAnd why it crashes? I took liberty - for learning purposes only - to locate the part that handles this. It looks like this (with my comments)::00401C75 40 inc eax <--- incrementing :00401C76 803C0200 cmp byte[edx+eax], 00 | null terminator :00401C7A 75F9 jne 00401C75 ---> go back :00401C7C 3DFE0F0000 cmp eax, 00000FFE ---> see if it's bigger than 4094 :00401C81 7625 jbe 00401CA8 ---> go on if it's notWhy would that crash??? ♡♡♡ . eMyvnE
Valik Posted April 7, 2009 Posted April 7, 2009 That line of code is well beyond the AutoIt limit of 4095 characters per line. So yes, that actually is illegal code.
Richard Robertson Posted April 7, 2009 Posted April 7, 2009 It still probably shouldn't crash though.
Valik Posted April 7, 2009 Posted April 7, 2009 It still probably shouldn't crash though.This is true, but the poster didn't ask for it not to crash, the poster asked for the supported line length to be increased in Tidy even though Tidy is only (attempting) to enforce an AutoIt-imposed limit on line length.
trancexx Posted April 7, 2009 Posted April 7, 2009 Your logic is undisputable. Will split that array in two. Btw, it crashes before that code. If that code is before it would just exit without crash. Actually function from ntdll.dll is crashing (because of wrong parameters). Since Jos is not directly calling any of the functions from that dll it appears that some function he's using from some other dll is not passing right parameters to the crashing function. Why is that I guess only Jos could answer. Take last three sentences conditionally. ♡♡♡ . eMyvnE
Developers Jos Posted April 7, 2009 Author Developers Posted April 7, 2009 (edited) Uploaded a new Tidy beta (v 2.0.28.0) to the SciTE4AutoIt3 Beta directory which will properly test for the line length during the initialization process were it filters all Global/local/dim variables. It will now show an error and stop processing: C:\OpenInScite44.au3(155) : ### Tidy Error: Script line longer than 4095. C:\OpenInScite44.au3(155) : ### Tidy Error: Tidy run abandoned! Internal process explanation: I am declaring internal temp variable as CHAR[4096] to build the total actual record and in this case the string length got longer due to concatenation of all continuation lines, which made tidy hard crash. Jos Edited April 7, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
trancexx Posted April 7, 2009 Posted April 7, 2009 That's great.I'm gonna go back and touch Valik's saying about illegal code. I did some reading (help file, word by word... and again) and after some thinking (yeah right) and testing it turned that the line of code that I posted was not exceeding 4095 characters limit. It was couple of characters below.Two functions to test with. The only difference is one function have element of an array "Left mouse 1234567890" (this one would be illegal) and the other one "Left mouse". The difference is 11 characters " 1234567890"expandcollapse popupConsoleWrite("Testing first function: ") ConsoleWrite(_VirtualKey(35) & @CRLF) ConsoleWrite("Testing second function: ") ConsoleWrite(_VirtualKey_NotAllowed(35) & @CRLF) Func _VirtualKey_NotAllowed($iValue) If $iValue < 1 Or $iValue > 254 Then Return SetError(0, 1, "") EndIf Local $aArrayVirtualKey[254][2] = [[1, "Left mouse 1234567890"], _ ; <- loose one character for it to work [2, "Right mouse"], _ [3, "CTRL + BREAK"], _ [4, "Middle mouse"], _ [5, "X1 mouse"], _ [6, "X2 mouse"], _ [7, ""], _ [8, "BACKSPACE"], _ [9, "TAB"], _ [10, ""], [11, ""], _ [12, "CLEAR"], _ [13, "ENTER"], _ [14, ""], [15, ""], _ [16, "SHIFT"], _ [17, "CTRL"], _ [18, "ALT"], _ [19, "PAUSE"], _ [20, "CAPS LOCK"], _ [21, "IME Hangul mode"], _ [22, "IME Junja mode"], _ [23, "IME final mode"], _ [24, "IME Hanja mode"], _ [25, "IME Kanji mode"], _ [26, ""], _ [27, "ESC"], _ [28, "IME convert"], _ [29, "IME nonconvert"], _ [30, "IME accept"], _ [31, "IME mode change request"], _ [32, "SPACEBAR"], _ [33, "PAGE UP"], _ [34, "PAGE DOWN"], _ [35, "END"], _ [36, "HOME"], _ [37, "LEFT ARROW"], _ [38, "UP ARROW"], _ [39, "RIGHT ARROW"], _ [40, "DOWN ARROW"], _ [41, "SELECT"], _ [42, "PRINT"], _ [43, "EXECUTE"], _ [44, "PRINT SCREEN"], _ [45, "INS"], _ [46, "DEL"], _ [47, "HELP"], _ [48, "0"], _ [49, "1"], _ [50, "2"], _ [51, "3"], _ [52, "4"], _ [53, "5"], _ [54, "6"], _ [55, "7"], _ [56, "8"], _ [57, "9"], _ [58, ""], [59, ""], [60, ""], [61, ""], [62, ""], [63, ""], [64, ""], _ [65, "A"], _ [66, "B"], _ [67, "C"], _ [68, "D"], _ [69, "E"], _ [70, "F"], _ [71, "G"], _ [72, "H"], _ [73, "I"], _ [74, "J"], _ [75, "K"], _ [76, "L"], _ [77, "M"], _ [78, "N"], _ [79, "O"], _ [80, "P"], _ [81, "Q"], _ [82, "R"], _ [83, "S"], _ [84, "T"], _ [85, "U"], _ [86, "V"], _ [87, "W"], _ [88, "X"], _ [89, "Y"], _ [90, "Z"], _ [91, "Left Windows key"], _ [92, "Right Windows key"], _ [93, "Applications key"], _ [94, ""], _ [95, "Computer Sleep key"], _ [96, "Numpad 0"], _ [97, "Numpad 1"], _ [98, "Numpad 2"], _ [99, "Numpad 3"], _ [100, "Numpad 4"], _ [101, "Numpad 5"], _ [102, "Numpad 6"], _ [103, "Numpad 7"], _ [104, "Numpad 8"], _ [105, "Numpad 9"], _ [106, "Multiply"], _ [107, "Add"], _ [108, "Separator"], _ [109, "Subtract"], _ [110, "Decimal Point"], _ [111, "Divide"], _ [112, "F1"], _ [113, "F2"], _ [114, "F3"], _ [115, "F4"], _ [116, "F5"], _ [117, "F6"], _ [118, "F7"], _ [119, "F8"], _ [120, "F9"], _ [121, "F10"], _ [122, "F11"], _ [123, "F12"], _ [124, "F13"], _ [125, "F14"], _ [126, "F15"], _ [127, "F16"], _ [128, "F17"], _ [129, "F18"], _ [130, "F19"], _ [131, "F20"], _ [132, "F21"], _ [133, "F22"], _ [134, "F23"], _ [135, "F24"], _ [136, ""], [137, ""], [138, ""], [139, ""], [140, ""], [141, ""], [142, ""], [143, ""], _ [144, "NUM LOCK"], _ [145, "SCROLL LOCK"], _ [146, ""], [147, ""], [148, ""], [149, ""], [150, ""], [151, ""], [152, ""], [153, ""], [154, ""], [155, ""], [156, ""], [157, ""], [158, ""], [159, ""], _ [160, "Left SHIFT"], _ [161, "Right SHIFT"], _ [162, "Left CONTROL"], _ [163, "Right CONTROL"], _ [164, "Left MENU"], _ [165, "Right MENU"], _ [166, "Browser Back key"], _ [167, "Browser Forward key"], _ [168, "Browser Refresh key"], _ [169, "Browser Stop key"], _ [170, "Browser Search key"], _ [171, "Browser Favorites key"], _ [172, "Browser Start and Home key"], _ [173, "Volume Mute key"], _ [174, "Volume Down key"], _ [175, "Volume Up key"], _ [176, "Next Track key"], _ [177, "Previous Track key"], _ [178, "Stop Media key"], _ [179, "Play/Pause Media key"], _ [180, "Start Mail key"], _ [181, "Select Media key"], _ [182, "Start Application 1 key"], _ [183, "Start Application 2 key"], _ [184, ""], [185, ""], _ [186, ";:(US standard keyboard)"], _ [187, "="], _ [188, ","], _ [189, "-"], _ [190, "."], _ [191, "/?(US standard keyboard)"], _ [192, "`~(US standard keyboard)"], _ [193, ""], [194, ""], [195, ""], [196, ""], [197, ""],[198, ""], [199, ""], [200, ""], [201, ""], [202, ""], [203, ""], [204, ""], _ [205, ""], [206, ""], [207, ""], [208, ""], [209, ""], [210, ""], [211, ""], [212, ""], [213, ""], [214, ""], [215, ""], _ [216, ""], [217, ""], [218, ""], _ [219, "[{(US standard keyboard)"], _ [220, "\|(US standard keyboard)"], _ [221, "]}(US standard keyboard)"], _ [222, "'single-quote/double-quote' key(US standard keyboard)"], _ [223, ""], [224, ""], [225, ""], _ [226, "backslash(RT 102-key keyboard)"], _ [227, ""], [228, ""], _ [229, "IME PROCESS key"], _ [230, ""], _ [231, "VK_PACKET"], _ [232, ""], _ [233, ""], [234, ""], [235, ""], [236, ""], [237, ""], [238, ""], [239, ""], [240, ""], [241, ""], [242, ""], [243, ""], [244, ""], [245, ""], _ [246, "Attn key"], _ [247, "CrSel key"], _ [248, "ExSel key"], _ [249, "Erase EOF key"], _ [250, "Play"], _ [251, "Zoom"], _ [252, ""], _ [253, "PA1 key"], _ [254, "Clear key"]] Return SetError(0, 0, $aArrayVirtualKey[$iValue - 1][1]) EndFunc Func _VirtualKey($iValue) If $iValue < 1 Or $iValue > 254 Then Return SetError(0, 1, "") EndIf Local $aArrayVirtualKey[254][2] = [[1, "Left mouse"], _ [2, "Right mouse"], _ [3, "CTRL + BREAK"], _ [4, "Middle mouse"], _ [5, "X1 mouse"], _ [6, "X2 mouse"], _ [7, ""], _ [8, "BACKSPACE"], _ [9, "TAB"], _ [10, ""], [11, ""], _ [12, "CLEAR"], _ [13, "ENTER"], _ [14, ""], [15, ""], _ [16, "SHIFT"], _ [17, "CTRL"], _ [18, "ALT"], _ [19, "PAUSE"], _ [20, "CAPS LOCK"], _ [21, "IME Hangul mode"], _ [22, "IME Junja mode"], _ [23, "IME final mode"], _ [24, "IME Hanja mode"], _ [25, "IME Kanji mode"], _ [26, ""], _ [27, "ESC"], _ [28, "IME convert"], _ [29, "IME nonconvert"], _ [30, "IME accept"], _ [31, "IME mode change request"], _ [32, "SPACEBAR"], _ [33, "PAGE UP"], _ [34, "PAGE DOWN"], _ [35, "END"], _ [36, "HOME"], _ [37, "LEFT ARROW"], _ [38, "UP ARROW"], _ [39, "RIGHT ARROW"], _ [40, "DOWN ARROW"], _ [41, "SELECT"], _ [42, "PRINT"], _ [43, "EXECUTE"], _ [44, "PRINT SCREEN"], _ [45, "INS"], _ [46, "DEL"], _ [47, "HELP"], _ [48, "0"], _ [49, "1"], _ [50, "2"], _ [51, "3"], _ [52, "4"], _ [53, "5"], _ [54, "6"], _ [55, "7"], _ [56, "8"], _ [57, "9"], _ [58, ""], [59, ""], [60, ""], [61, ""], [62, ""], [63, ""], [64, ""], _ [65, "A"], _ [66, "B"], _ [67, "C"], _ [68, "D"], _ [69, "E"], _ [70, "F"], _ [71, "G"], _ [72, "H"], _ [73, "I"], _ [74, "J"], _ [75, "K"], _ [76, "L"], _ [77, "M"], _ [78, "N"], _ [79, "O"], _ [80, "P"], _ [81, "Q"], _ [82, "R"], _ [83, "S"], _ [84, "T"], _ [85, "U"], _ [86, "V"], _ [87, "W"], _ [88, "X"], _ [89, "Y"], _ [90, "Z"], _ [91, "Left Windows key"], _ [92, "Right Windows key"], _ [93, "Applications key"], _ [94, ""], _ [95, "Computer Sleep key"], _ [96, "Numpad 0"], _ [97, "Numpad 1"], _ [98, "Numpad 2"], _ [99, "Numpad 3"], _ [100, "Numpad 4"], _ [101, "Numpad 5"], _ [102, "Numpad 6"], _ [103, "Numpad 7"], _ [104, "Numpad 8"], _ [105, "Numpad 9"], _ [106, "Multiply"], _ [107, "Add"], _ [108, "Separator"], _ [109, "Subtract"], _ [110, "Decimal Point"], _ [111, "Divide"], _ [112, "F1"], _ [113, "F2"], _ [114, "F3"], _ [115, "F4"], _ [116, "F5"], _ [117, "F6"], _ [118, "F7"], _ [119, "F8"], _ [120, "F9"], _ [121, "F10"], _ [122, "F11"], _ [123, "F12"], _ [124, "F13"], _ [125, "F14"], _ [126, "F15"], _ [127, "F16"], _ [128, "F17"], _ [129, "F18"], _ [130, "F19"], _ [131, "F20"], _ [132, "F21"], _ [133, "F22"], _ [134, "F23"], _ [135, "F24"], _ [136, ""], [137, ""], [138, ""], [139, ""], [140, ""], [141, ""], [142, ""], [143, ""], _ [144, "NUM LOCK"], _ [145, "SCROLL LOCK"], _ [146, ""], [147, ""], [148, ""], [149, ""], [150, ""], [151, ""], [152, ""], [153, ""], [154, ""], [155, ""], [156, ""], [157, ""], [158, ""], [159, ""], _ [160, "Left SHIFT"], _ [161, "Right SHIFT"], _ [162, "Left CONTROL"], _ [163, "Right CONTROL"], _ [164, "Left MENU"], _ [165, "Right MENU"], _ [166, "Browser Back key"], _ [167, "Browser Forward key"], _ [168, "Browser Refresh key"], _ [169, "Browser Stop key"], _ [170, "Browser Search key"], _ [171, "Browser Favorites key"], _ [172, "Browser Start and Home key"], _ [173, "Volume Mute key"], _ [174, "Volume Down key"], _ [175, "Volume Up key"], _ [176, "Next Track key"], _ [177, "Previous Track key"], _ [178, "Stop Media key"], _ [179, "Play/Pause Media key"], _ [180, "Start Mail key"], _ [181, "Select Media key"], _ [182, "Start Application 1 key"], _ [183, "Start Application 2 key"], _ [184, ""], [185, ""], _ [186, ";:(US standard keyboard)"], _ [187, "="], _ [188, ","], _ [189, "-"], _ [190, "."], _ [191, "/?(US standard keyboard)"], _ [192, "`~(US standard keyboard)"], _ [193, ""], [194, ""], [195, ""], [196, ""], [197, ""],[198, ""], [199, ""], [200, ""], [201, ""], [202, ""], [203, ""], [204, ""], _ [205, ""], [206, ""], [207, ""], [208, ""], [209, ""], [210, ""], [211, ""], [212, ""], [213, ""], [214, ""], [215, ""], _ [216, ""], [217, ""], [218, ""], _ [219, "[{(US standard keyboard)"], _ [220, "\|(US standard keyboard)"], _ [221, "]}(US standard keyboard)"], _ [222, "'single-quote/double-quote' key(US standard keyboard)"], _ [223, ""], [224, ""], [225, ""], _ [226, "backslash(RT 102-key keyboard)"], _ [227, ""], [228, ""], _ [229, "IME PROCESS key"], _ [230, ""], _ [231, "VK_PACKET"], _ [232, ""], _ [233, ""], [234, ""], [235, ""], [236, ""], [237, ""], [238, ""], [239, ""], [240, ""], [241, ""], [242, ""], [243, ""], [244, ""], [245, ""], _ [246, "Attn key"], _ [247, "CrSel key"], _ [248, "ExSel key"], _ [249, "Erase EOF key"], _ [250, "Play"], _ [251, "Zoom"], _ [252, ""], _ [253, "PA1 key"], _ [254, "Clear key"]] Return SetError(0, 0, $aArrayVirtualKey[$iValue - 1][1]) EndFuncI tested lenght by copying part of the code starting with Local and ending with [254, "Clear key"]]ConsoleWrite("Raw lenght: " & StringLen(ClipGet()) & @CRLF) $sLineCode = StringReplace(StringReplace(StringReplace(ClipGet(), @CRLF, ""), " ", ""), " _", " ") ConsoleWrite("Lenght after removing formatting: " & StringLen($sLineCode) & @CRLF) ConsoleWrite($sLineCode & @CRLF)Results are:- illegal code Raw lenght: 5212Lenght after removing formatting: 4096- working codeRaw lenght: 5201Lenght after removing formatting: 4085So, it's not working if it's >4095 as expected and my code wasn't illegal.If what I wrote here stands then new Tidy.exe beta is not calculating line lenght of a code properly because there shouldn't be any warning about code few posts up. ♡♡♡ . eMyvnE
Developers Jos Posted April 7, 2009 Author Developers Posted April 7, 2009 (edited) You are right that the initial posted code snippet should work and is 4021 long when stripped of the extra whitespace. Uploaded a updated version to strip that properly so the whitespace is taken into account. Jos Edited April 7, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Valik Posted April 7, 2009 Posted April 7, 2009 (edited) Since you wish to press the issue. You are relying on an implementation detail. Your code works more by chance than be design on your part or on ours. The fact that the code works doesn't change the fact that it is stupid code. There is no reason to push the length limit to within 10 characters. It's good that Tidy warns you in advance. You are right that the initial posted code snippet should work and is 4021 long when stripped of the extra whitespace. Uploaded a updated version to strip that properly so the whitespace is taken into account.Jos, you shouldn't change Tidy and your post proves why. It's longer than 4021. It's 4085 characters long. trancexx added 11 characters to the failing example. The addition of " 1234567890" is 11 characters. That brings the total up to > 4095. Take one away and you have 4095 exactly and AutoIt runs. So the original string is 4085 characters. Note that I also manually concatenated the line and came up with 4085 characters. See the 3rd paragraph for why I don't think you should change things. Edit: Oh, the reason you shouldn't change Tidy is because the way the string is built is an implementation detail. We've never stated how the line continuation character works so it's not documented. Currently line continuation turns this: Local $v = _ "foo" Into: Local $v = "foo" But it could just as easily do: Local $v = "foo" Edited April 7, 2009 by Valik
Valik Posted April 7, 2009 Posted April 7, 2009 I wonder how much trouble it would be (and what performance impact it would have) to remove the fixed-length line size.
Developers Jos Posted April 7, 2009 Author Developers Posted April 7, 2009 (edited) My way of looking at it is from a Tidy logic point of view: I am not really worried about line lengths other than from an internal support point of view.What I do now is strip the code from:- The ending " _"- The leading and trailing WhiteSpace- Add a space between the concatenated strings for each continuation line. (not needed)- and concatenate that in a temp variable. Whenever this temp variale goes over the 4095 character length it will show a Error in the Console window and stop the tidy process to avoid aan crash.Jos Edited April 7, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted April 7, 2009 Author Developers Posted April 7, 2009 I wonder how much trouble it would be (and what performance impact it would have) to remove the fixed-length line size.Can I just offer you a beer to shut you up? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Richard Robertson Posted April 7, 2009 Posted April 7, 2009 I think a line length cap is a good thing. Long lines will only promote stupid looking code.
Valik Posted April 7, 2009 Posted April 7, 2009 I think a line length cap is a good thing. Long lines will only promote stupid looking code.Maybe. But at least the stupid code will work and they won't be pestering us with it not working.
trancexx Posted April 8, 2009 Posted April 8, 2009 Stupidness is, if anything, very much relative.Thanks Jos for the new Tidy. Love that tool.Btw, same I get the same thing with obfuscator (/striponly used). And after I cut that array off (actually two) one function gets stripped away wrongly (link to that script if you want to see it). ♡♡♡ . eMyvnE
Developers Jos Posted April 8, 2009 Author Developers Posted April 8, 2009 Stupidness is, if anything, very much relative.Thanks Jos for the new Tidy. Love that tool.Btw, same I get the same thing with obfuscator (/striponly used). And after I cut that array off (actually two) one function gets stripped away wrongly (link to that script if you want to see it).Will check that one too. Should be easy to find because I started with the tidy source when building Obfuscator.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted April 8, 2009 Author Developers Posted April 8, 2009 Uploaded a new Beta Obfuscator version which solves the missing function and also better calculate the line length. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
trancexx Posted April 8, 2009 Posted April 8, 2009 Ok, that works ideally now. Callback functions are stripped. I's not related to that script directly, it's the same for any script with callback function - e.g. help file example. ♡♡♡ . eMyvnE
Recommended Posts