ioripalm Posted March 15, 2018 Share Posted March 15, 2018 (edited) Why is the result of this code not the same as expected? Dim $sArray[5] = ["PARENTEMAIL ", "OPTSTRAND ", "POSTCODE ", "STRAND ", "TECETHN "] $sum = "" For $i = 0 To UBound($sArray) - 1 $sum &= $sArray[$i] Next ConsoleWrite($sum & @CRLF) result: PARENTEMAIL OPTSTR POSTCODE STR TECETHN Editer is SciTE Ver 3.6.2 Feb 15 2016 18:42:26 Why its stripping "AND" from the string? Edited March 16, 2018 by ioripalm Link to comment Share on other sites More sharing options...
Subz Posted March 15, 2018 Share Posted March 15, 2018 What did you expect? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 15, 2018 Developers Share Posted March 15, 2018 I guess the question is why the "AND" portion is disappearing from the concatenated string while they are in the Array? 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. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 15, 2018 Moderators Share Posted March 15, 2018 ioripalm, When I run that code I get what you expect: PARENTEMAIL OPTSTRAND POSTCODE STRAND TECETHN M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Subz Posted March 15, 2018 Share Posted March 15, 2018 @Jos Didn't even notice that, till you pointed it out, really need to start wearing my reading glasses @Melba23 Get the same result as you, so not sure why its stripping "AND" from the string for the OP. Link to comment Share on other sites More sharing options...
ioripalm Posted March 16, 2018 Author Share Posted March 16, 2018 On 2018/3/15 at 1:36 PM, Subz said: What did you expect? Sorry,I edited this question and a pic of displayed my result. Link to comment Share on other sites More sharing options...
ioripalm Posted March 16, 2018 Author Share Posted March 16, 2018 On 2018/3/15 at 10:12 PM, Melba23 said: ioripalm, When I run that code I get what you expect: PARENTEMAIL OPTSTRAND POSTCODE STRAND TECETHN M23 Thank you,but in my Console I can't see "AND". Link to comment Share on other sites More sharing options...
Developers Jos Posted March 16, 2018 Developers Share Posted March 16, 2018 (edited) .. and you are running the exact same snippet? What is the file encoding you use? Jos Edited March 16, 2018 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. Link to comment Share on other sites More sharing options...
jchd Posted March 16, 2018 Share Posted March 16, 2018 I get the same result as Melba and al. here. Is it an old localized version of basic SciTE (w/o SciTE4AutoIt3)? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Bilgus Posted March 17, 2018 Share Posted March 17, 2018 What if you try other commands in the strings like or Not NULL Local $sArray[5] = ["PARENTENULL ", "OPTSTRAND ", "POSTCOOR ", "STRNOT ", "TECETIF "] $sum = "" For $i = 0 To UBound($sArray) - 1 $sum &= $sArray[$i] Next ConsoleWrite($sum & @CRLF) ;What About without spaces? Local $sArray[5] = ["PARENTENULL_", "OPTSTRAND_", "POSTCOOR_", "STRAND_", "TECETIF_"] $sum = "" For $i = 0 To UBound($sArray) - 1 $sum &= $sArray[$i] Next ConsoleWrite($sum & @CRLF) Link to comment Share on other sites More sharing options...
ioripalm Posted March 17, 2018 Author Share Posted March 17, 2018 (edited) 17 hours ago, Bilgus said: What if you try other commands in the strings like or Not NULL Local $sArray[5] = ["PARENTENULL ", "OPTSTRAND ", "POSTCOOR ", "STRNOT ", "TECETIF "] $sum = "" For $i = 0 To UBound($sArray) - 1 $sum &= $sArray[$i] Next ConsoleWrite($sum & @CRLF) ;What About without spaces? Local $sArray[5] = ["PARENTENULL_", "OPTSTRAND_", "POSTCOOR_", "STRAND_", "TECETIF_"] $sum = "" For $i = 0 To UBound($sArray) - 1 $sum &= $sArray[$i] Next ConsoleWrite($sum & @CRLF) return these: PARENTENULL OPTSTR POSTCOOR STRNOT TECETIF PARENTENULL_OPTSTRAND_POSTCOOR_STRAND_TECETIF_ Dim $sArray[5] = ["@PARENTEMAIL @", "@OPTSTRAND @", "@POSTCODE @", "@STRAND @", "@TECETHN @"] $sum = "" For $i = 0 To UBound($sArray) - 1 $sum &= $sArray[$i] Next ConsoleWrite($sum & @CRLF) I added "@" before and after the string return:@PARENTEMAIL @@OPTSTR @@POSTCODE @@STR @@TECETHN @ Edited March 17, 2018 by ioripalm Link to comment Share on other sites More sharing options...
Developers Jos Posted March 17, 2018 Developers Share Posted March 17, 2018 Can you please show the total output shown in the SciTE output pane when you run the script in codebox (<>)? 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. Link to comment Share on other sites More sharing options...
ioripalm Posted March 17, 2018 Author Share Posted March 17, 2018 22 hours ago, Jos said: .. and you are running the exact same snippet? What is the file encoding you use? Jos UTF8 none BOM Link to comment Share on other sites More sharing options...
Developers Jos Posted March 17, 2018 Developers Share Posted March 17, 2018 17 minutes ago, Jos said: Can you please show the total output shown in the SciTE output pane when you run the script in codebox (<>)? Jos ... and? 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. Link to comment Share on other sites More sharing options...
ioripalm Posted March 17, 2018 Author Share Posted March 17, 2018 (edited) 3 minutes ago, Jos said: ... and? >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Mason\Desktop\oop\OOP\testerror.au3" /UserParams +>11:10:41 启动 AutoIt3Wrapper v16.306.1237.0 SciTE v3.6.2.0 键盘:00000804 操作系统:WIN_10/ CPU:X64 系统架构:X64 语言环境:0804 代码页:936 > utf8 检查: 4 # 检测 ASCII 字符,如无默认设置,则编码为 UTF-8 无 BOM. > 脚本编码: 256 UTF8 无 BOM. +> SciTE 目录 => C:\Program Files (x86)\AutoIt3\SciTE AutoIt3Wrapper 用户目录 => C:\Users\Mason\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE 用户目录 => C:\Users\Mason\AppData\Local\AutoIt v3\SciTE >运行 AU3Check (3.3.14.2) 检查代码. 参数: C:\Program Files (x86)\AutoIt3 脚本路径: C:\Users\Mason\Desktop\oop\OOP\testerror.au3 +>11:10:41 AU3Check 语法检查结束.rc: 0 >运行:C:\Program Files (x86)\AutoIt3\autoit3_x64.exe(3.3.14.2), 脚本: C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\Mason\Desktop\oop\OOP\testerror.au3" --> 点击 Ctrl+Alt+Break 重新启动, 或 Ctrl+Break 停止脚本执行 PARENTEMAIL OPTSTR POSTCODE STR TECETHN +>11:10:42 AutoIt3.exe 结束.rc: 0 +>11:10:42 AutoIt3Wrapper 完成脚本处理. >Exit code: 0 Time: 0.8471 Sorry,I user Chinese version SciTE. Edited March 17, 2018 by ioripalm Link to comment Share on other sites More sharing options...
jchd Posted March 17, 2018 Share Posted March 17, 2018 That's why I asked which version and setup was used. If you're using a homebrew setup for linking (old) SciTE to (old) AutoIt tools, then isn't there something at this level that could interfere with SciTE console output? I don't believe that by itself codepage gb2312 (simplifies Chinese) would interpret the substring 'AND' by anything else, or remove it altogether. Can you install latest SciTE4AutoIt3 and AutoIt3 packages elsewhere and retry the same test? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now