Confuzzed Posted July 27, 2015 Share Posted July 27, 2015 Please forgive me. I'm sure I'm doing something stupid, but here is what I am seeing.This code snippet: ;$artist="Deee-Lite" ;$artisthold = "Deee-Lite" $temp = "$artist: " & $artist & " Type:" & VarGetType($artist) & " Length: " & stringlen($artist) & " " for $k = 1 to stringlen($artist) $temp = $temp & string(asc(stringmid($artist,$k,1))) & " " next logwriteline($temp) $temp2 = "$arthld: " & $ArtistHold & " Type:" & VarGetType($artisthold) & " Length: " & stringlen($artisthold) & " " for $k = 1 to stringlen($ArtistHold) $temp2 = $temp2 & string(asc(stringmid($ArtistHold,$k,1))) & " " next logwriteline($temp2) if $artist <> $ArtistHold then logwriteline(" not equal") endif ... Func LogWriteLine($value) FileWriteLine($logfile, $value ) EndFunc Produces this output:$artist: Deee-Lite Type:String Length: 9 68 101 101 101 45 76 105 116 101 $arthld: Deee-Lite Type:String Length: 9 68 101 101 101 45 76 105 116 101 not equal I've no idea why the two strings are not equal. Can someone help me? (Interestingly, if I un-remark the two assignment lines, it works....) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 27, 2015 Moderators Share Posted July 27, 2015 Confuzzed,Welcome to the AutoIt forums.From where do you get the $artist & $artisthold variables when you run the script without the direct assignment lines?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...
JohnOne Posted July 27, 2015 Share Posted July 27, 2015 Because "$arthld:" is not equal to "$artist:" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Confuzzed Posted July 27, 2015 Author Share Posted July 27, 2015 (edited) Confuzzed,Welcome to the AutoIt forums.From where do you get the $artist & $artisthold variables when you run the script without the direct assignment lines?M23 Artist is assigned: $artist:$Array3 = StringRegExp($line2, ' Artist +(.+)', 3) if @error <> 1 then $artist = $Array3[0] continueloop ;handle multiple tags endifArtisthold is returned from a function. $artisthold:$ArtistHold = ArtistFromRelease($releaseid) ... Func ArtistFromRelease($Release2) ... $ArtistRead = "" ... $Array6 = StringRegExp($line6, 'Release by(?:.+?)<bdi>(.+?)<\/bdi>', 3) if @error <> 1 then $ArtistRead = $array6[0] exitloop endif ... Return $ArtistRead EndFunc Thanks for your help. Edited July 27, 2015 by Confuzzed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 27, 2015 Moderators Share Posted July 27, 2015 Confuzzed,And from where do you get $line2 & $line6? Help us to help you - we do not have any idea of what your script does or how you get the values.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...
Confuzzed Posted July 27, 2015 Author Share Posted July 27, 2015 Because "$arthld:" is not equal to "$artist:"Thank you for your help. I'm sure you are right, but as far as I can tell, $artist and $artisthold are exactly the same. Below is the output where I display the variable contents, type and length. Then I walk both variables one character at a time and display the ascii codes.$artist: Deee-Lite Type:String Length: 9 68 101 101 101 45 76 105 116 101 $arthld: Deee-Lite Type:String Length: 9 68 101 101 101 45 76 105 116 101The problem does not seem to be fundamental. Most of the time the program works fine, except for this example. Link to comment Share on other sites More sharing options...
Confuzzed Posted July 27, 2015 Author Share Posted July 27, 2015 Confuzzed,And from where do you get $line2 & $line6? Help us to help you - we do not have any idea of what your script does or how you get the values.M23Sorry. I was hoping to find some way to see why the two variables are not equal... Here are the contents of those two variables:$Line2:Artist Deee-Lite $Line6: Release by <a href="https://url/artist/83d401e8-3322-4491-98d3-ec3a567c5047" title="Deee‐Lite"><bdi>Deee‐Lite</bdi></a> Link to comment Share on other sites More sharing options...
trancexx Posted July 27, 2015 Share Posted July 27, 2015 Use AscW() instead of Asc() to see the difference. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 27, 2015 Moderators Share Posted July 27, 2015 Confuzzed,This is like drawing teeth. One last try: what is the original source of these strings?As the code indicates that the strings are identical when you assign them directly, it follows that they are not when you derive them within your script. So from where do you get the basic data from which you extract the strings you compare? Is it from an mp3 tag? Some form of music database? Or somewhere else?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...
Confuzzed Posted July 27, 2015 Author Share Posted July 27, 2015 Use AscW() instead of Asc() to see the difference.Thank you! That did it. Here is the output now:$artist: Deee-Lite Type:String Length: 9 68 101 101 101 45 76 105 116 101 $arthld: Deee-Lite Type:String Length: 9 68 101 101 101 8208 76 105 116 101 not equal Link to comment Share on other sites More sharing options...
Confuzzed Posted July 27, 2015 Author Share Posted July 27, 2015 Confuzzed,This is like drawing teeth. One last try: what is the original source of these strings?As the code indicates that the strings are identical when you assign them directly, it follows that they are not when you derive them within your script. So from where do you get the basic data from which you extract the strings you compare? Is it from an mp3 tag? Some form of music database? Or somewhere else?M23Sorry. The program is long, and I was hoping to simply focus on the contents of the two variables, rather than from where their contents was assigned. fwiw, line2 came from m4a tags and line6 came from a downloaded web page... Link to comment Share on other sites More sharing options...
TheSaint Posted July 27, 2015 Share Posted July 27, 2015 I was gonna say that perhaps the dash is the culprit, as I've come across this before with music names. Obviously you can have ASC variants of a dash. 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) Link to comment Share on other sites More sharing options...
Confuzzed Posted July 28, 2015 Author Share Posted July 28, 2015 I was gonna say that perhaps the dash is the culprit, as I've come across this before with music names. Obviously you can have ASC variants of a dash.Yep I wondered about the dash also, and when I examined the file manually, my editor formatted the unicode. I just couldn't see what was happening with ASC, (and just imagine my frustration with the ASC output.) Link to comment Share on other sites More sharing options...
TheSaint Posted July 28, 2015 Share Posted July 28, 2015 (edited) That's why I have all non standard ASC 2 characters replaced with standard, by default in many of my programs, including foreign accents etc. In my world, there is only one lower case 'a' and 'e' etc.People have all sorts of things in ID3 Tags, so I just rewrite the lot. Edited July 28, 2015 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) 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