bluebearr Posted October 7, 2005 Share Posted October 7, 2005 Some time back I think I saw an AutoIt sample script that assigned a long, multiline string to a variable using syntax like this:$strLongString = "<HTML><HEAD></HEAD><BODY>This is the body.</BODY><HTML>"At the time I thought "Dang, that's clever" - but I have since forgotten how it was done. I recently wrote a Perl script that used q to feed a lot of raw HTML into a variable and thought about this again.Can anyone think of how to do this - feed raw text into a variable without using quotes and continuation characters?Thanks bunches.Bluebearr BlueBearrOddly enough, this is what I do for fun. Link to comment Share on other sites More sharing options...
w0uter Posted October 7, 2005 Share Posted October 7, 2005 i think it was a suggestion of how it could be. AFAIK this is not yet (ever) possible. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
AutoChris Posted October 7, 2005 Share Posted October 7, 2005 Some time back I think I saw an AutoIt sample script that assigned a long, multiline string to a variable using syntax like this:$strLongString = "<HTML><HEAD></HEAD><BODY>This is the body.</BODY><HTML>"At the time I thought "Dang, that's clever" - but I have since forgotten how it was done. I recently wrote a Perl script that used q to feed a lot of raw HTML into a variable and thought about this again.Can anyone think of how to do this - feed raw text into a variable without using quotes and continuation characters?Thanks bunches.BluebearrDo you mean something like...?$strLongString = "<HTML>" & @CRLF & "<HEAD>" & @CRLF & "<BODY>" & @CRLF & _ "This is the body." & @CRLF & "</BODY>" & @CRLF & "<HTML>"Or $strLongString = "<HTML>" & @CRLF & _ "<HEAD>" & @CRLF & _ "<BODY>" & @CRLF & _ "This is the body." & @CRLF & _ "</BODY>" & @CRLF & _ "<HTML>"Or am I completely missing the point? Link to comment Share on other sites More sharing options...
w0uter Posted October 7, 2005 Share Posted October 7, 2005 Or am I completely missing the point?yes. Is it possible without quotes and _? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
/dev/null Posted October 7, 2005 Share Posted October 7, 2005 (edited) Some time back I think I saw an AutoIt sample script that assigned a long, multiline string to a variable using syntax like this:you probably remember my post some time back: http://www.autoitscript.com/forum/index.ph...topic=12378&hl=I suggested to implement perl "here documents" in AutoIT because I was missing that feature.CheersKurt Edited October 7, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
seandisanti Posted October 7, 2005 Share Posted October 7, 2005 Some time back I think I saw an AutoIt sample script that assigned a long, multiline string to a variable using syntax like this:$strLongString = "<HTML><HEAD></HEAD><BODY>This is the body.</BODY><HTML>"At the time I thought "Dang, that's clever" - but I have since forgotten how it was done. I recently wrote a Perl script that used q to feed a lot of raw HTML into a variable and thought about this again.Can anyone think of how to do this - feed raw text into a variable without using quotes and continuation characters?Thanks bunches.Bluebearryou could use an external file to hold the html then use:$HtmlCode = FileRead("C:\htmlfile.html",FileGetSize("C:\htmlfile.html")) Link to comment Share on other sites More sharing options...
bluebearr Posted October 8, 2005 Author Share Posted October 8, 2005 you could use an external file to hold the html then use:Yeah, I dislike using an external file because inevitably you lose it, and then you have to test for it and/or store the contents in the script so you have a ready backup blah blah...Thanks anyway. I ended up including it in the script, because I had to stick some text in the middle anyway & it was easier to just start with it in pieces than to break it up. I know I've written spreadsheets to add the "_ @CRLF & " stuff but I couldn't place it (lazy Friday).It's a cool script - it monitors an IP address to see if it's pingable. If it isn't, it sets a flag, and then waits for it to be pingable again. When it's pingable again it loads a web page that sends me a text page. This is so I can know that my VPN connection got broken and and that I need to reauthenticate so my huge download can continue...Peace,BlueBearr BlueBearrOddly enough, this is what I do for fun. Link to comment Share on other sites More sharing options...
seandisanti Posted October 10, 2005 Share Posted October 10, 2005 Yeah, I dislike using an external file because inevitably you lose it, and then you have to test for it and/or store the contents in the script so you have a ready backup blah blah...Thanks anyway. I ended up including it in the script, because I had to stick some text in the middle anyway & it was easier to just start with it in pieces than to break it up. I know I've written spreadsheets to add the "_ @CRLF & " stuff but I couldn't place it (lazy Friday).It's a cool script - it monitors an IP address to see if it's pingable. If it isn't, it sets a flag, and then waits for it to be pingable again. When it's pingable again it loads a web page that sends me a text page. This is so I can know that my VPN connection got broken and and that I need to reauthenticate so my huge download can continue...Peace,BlueBearryou could fileinstall() the external file into your script, then you don't lose it... Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted October 10, 2005 Share Posted October 10, 2005 I would just use the external file, and encase a copy of the file between #cs and #ce tags, that way you can copy&paste back to the file if you lose the html file... Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) 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