horne Posted August 3, 2012 Share Posted August 3, 2012 How i can insert quotes in quotes, like here : #include <IE.au3> Local $vboxcode = InputBox("Vbox7 downloader", "Enter vbox7 code.", "", " ") Local $oIE = _IECreate ($vboxcode, 0, 0, 1, 0) Local $sHTML = _IEBodyReadHTML($oIE) Local $sExtract2 = StringRegExpReplace($sHTML, ".*<span class="title">.*</span>", "$1") MsgBox(4096, "Test", $sExtract2, 1) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 3, 2012 Moderators Share Posted August 3, 2012 (edited) horne,From the Help file:StringsStrings are enclosed in double-quotes like "this". If you want a string to actually contain a double-quote use it twice like: "here is a ""double-quote"" - ok?"You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them: 'This "sentence" contains "lots" of "double-quotes" does it not?'is much simpler than: "This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"All clear? M23Edit: 12k! Edited August 3, 2012 by Melba23 Tacomas 1 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...
SeanMaloney Posted September 25, 2012 Share Posted September 25, 2012 How should I write two sets of double quotes in a string? For example, I want to pass the following to the command line: "%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS="" With previous versions of AutoIt, I'm pretty sure the following would work: RunWait('"%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS=""""') But now, when adding the "Command Line" column to Task Manager, I can see all four double-quotes passed at the end of the line. Is a double-quote no longer the escape character for a double-quote? Link to comment Share on other sites More sharing options...
jdelaney Posted September 25, 2012 Share Posted September 25, 2012 the answer is in the post right above yours :/You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:'This "sentence" contains "lots" of "double-quotes" does it not?' IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
guinness Posted September 25, 2012 Share Posted September 25, 2012 I've adopted the standard practice of using single quotes as it makes life easier when using double quotes. Also it's best to start a new topic and not resurrect an old one. Well then again reading the help file would've have been a better option of the two. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
SeanMaloney Posted September 26, 2012 Share Posted September 26, 2012 Maybe I wasn't clear. I want to pass a *pair* of double quotes to the command line without the first double quote escaping the second. In my example code I used single quotes to enclose the entire string. Here is my desired string. See the pair of double quotes at the end? "%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS="" If I simply surround the string with single quotes, the last double quote is stripped off. This doesn't work: RunWait('"%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS=""') This used to work, but not with the latest version of AutoIt: RunWait('"%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS=""""') So I'd like to know what is the 'proper' method of passing consequtive double quotes? I can't find anything in the documentation about it. Link to comment Share on other sites More sharing options...
SeanMaloney Posted September 26, 2012 Share Posted September 26, 2012 Ugh. It looks like double quotes no longer escape double quotes when enclosed in single quotes. I should have tried that.It looks like this was a bug in SciTE (the obfuscator), not AutoIt, and I must have only read the changelog for AutoIt."Fixed bug with 2 double Quotes withing a doublequoted string"http://www.autoitscript.com/autoit3/scite/docs/history.htmThis also affects 2 double quotes withing a single quoted string, and it's definitely a code breaker. Link to comment Share on other sites More sharing options...
BrewManNH Posted September 27, 2012 Share Posted September 27, 2012 That bug fix was for Obfuscator, it has nothing to do with AutoIt's functionality. Here's the result of that string above when run through a consolewrite ConsoleWrite('"%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS=""' & @CRLF) ; This is the result of the above, copied directly from your script ; "%Temp%VirusScanSetupVSE.Exe" /qb PRESERVESETTINGS="" If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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