PitBullBlonde Posted September 13, 2004 Share Posted September 13, 2004 I sure hope someone can help - I'm trying to append to a file, but the string I want to append has a semicolon in it - AutoIT help says that a semicolon within a string should be ok, but everything after the semicolon is still getting 'commented out'. I've been pulling my hair out trying different combinations of putting single and / or double quotes around it, without any luck. Here's what I want to append at the moment: _FileAppend($HMpath & $FieldDescHTML, "<tr><td><a href='#' onclick="window.open('test.htm';">") there may be other errors in this string now, with all the variations I've tried, using the quotes and double quotes, but the main thing is that I'm going to be using autoIT to create htm and hta files that have alot of semicolons as part of functions or script - How can I get autoIT to stop commenting out everything behind the semicolon? Any and all information most appreciated! Thanks! Corey J. HarperCorey_Harper@HotMail.com Link to comment Share on other sites More sharing options...
Developers Jos Posted September 13, 2004 Developers Share Posted September 13, 2004 (edited) I sure hope someone can help - I'm trying to append to a file, but the string I want to append has a semicolon in it - AutoIT help says that a semicolon within a string should be ok, but everything after the semicolon is still getting 'commented out'. I've been pulling my hair out trying different combinations of putting single and / or double quotes around it, without any luck. Here's what I want to append at the moment: _FileAppend($HMpath & $FieldDescHTML, "<tr><td><a href='#' onclick="window.open('test.htm';">") there may be other errors in this string now, with all the variations I've tried, using the quotes and double quotes, but the main thing is that I'm going to be using autoIT to create htm and hta files that have alot of semicolons as part of functions or script - How can I get autoIT to stop commenting out everything behind the semicolon? Any and all information most appreciated! Thanks! <{POST_SNAPBACK}>Not sure about your syntax here but try this version: _FileAppend($HMpath & $FieldDescHTML, '<tr><td><a href="#" onclick="window.open(test.htm)";>') If its not correct then post the result you would like to see so we can code it properly... Edited September 13, 2004 by JdeB 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...
emmanuel Posted September 13, 2004 Share Posted September 13, 2004 _FileAppend($HMpath & $FieldDescHTML, "<tr><td><a href='#' onclick="window.open('test.htm';">")gray = quoted, green equals commented... If you look at this in something like sciTE you'll see that the quotes are opening and closing as it goes... replacing the double quotes on the outside was my first step to fixing this, second step is to double up the single quotes on the inside: _FileAppend($HMpath & $FieldDescHTML, '<tr><td><a href=''#'' onclick="window.open(''test.htm'';">') I believe that should do it. You might want to give SciTE a shot as an editor, it makes such things stick out very clearly... "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
CyberSlug Posted September 13, 2004 Share Posted September 13, 2004 Have you tried running the code? I'm pretty sure AutoIt will parse the code correctly. SciTe, on the other hand, has a problem with nested quotes, and SciTe might color the code wrong.... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Developers Jos Posted September 14, 2004 Developers Share Posted September 14, 2004 (edited) Have you tried running the code? I'm pretty sure AutoIt will parse the code correctly. SciTe, on the other hand, has a problem with nested quotes, and SciTe might color the code wrong.... <{POST_SNAPBACK}>Cyberslug, are you sure that Scite doesn't correctly do syntax highlighting of nested quotes ? can you give an example of that ? Edited September 14, 2004 by JdeB 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...
tylo Posted September 14, 2004 Share Posted September 14, 2004 (edited) Have you tried running the code? I'm pretty sure AutoIt will parse the code correctly. SciTe, on the other hand, has a problem with nested quotes, and SciTe might color the code wrong.... <{POST_SNAPBACK}>It seems to me that SciTe highlights correctly. The code is not correct. Try au3check on it Correct code is:_FileAppend($HMpath & $FieldDescHTML, "<tr><td><a href='#' onclick=""window.open('test.htm';"">")or_FileAppend($HMpath & $FieldDescHTML, '<tr><td><a href=''#'' onclick="window.open(''test.htm'';">') BTW: is the generated HTML code correct? I think the "window.open(.." will be missing a closing brace Edited September 14, 2004 by tylo blub Link to comment Share on other sites More sharing options...
CyberSlug Posted September 14, 2004 Share Posted September 14, 2004 Cyberslug, are you sure that Scite doesn't correctly do syntax highlighting of nested quotes ? can you give an example of that ? <{POST_SNAPBACK}>Well, I didn't try running any test code I thought there had been a problem at one point, but everything looks okay now. :"> Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
emmanuel Posted September 14, 2004 Share Posted September 14, 2004 Well, I didn't try running any test code I thought there had been a problem at one point, but everything looks okay now. :"> <{POST_SNAPBACK}>heh. neither did I... just call me lazy I guess... "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Developers Jos Posted September 14, 2004 Developers Share Posted September 14, 2004 Well, I didn't try running any test code I thought there had been a problem at one point, but everything looks okay now. :"> <{POST_SNAPBACK}> Ok... i was getting worried here ..... 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...
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