Sign in to follow this  
Followers 0
0_00_0

Unterminated string error confusion

5 posts in this topic

Hi all I'm sure this is a pretty easy solution but I can't seem to figure it out. I am trying to pass in a base64 code to the converter I have written in C#.

I am getting an Unterminated String error on the $b64code initialization line.

#RequireAdmin
$b64code = '/9j/4AAQSkZJRgABAQEASABIAAD/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/hAylodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQ0MTdDNDIxMTI5RTExRTI5NTQ2ODc5NEJGNzEwNkI5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQ0MTdDNDIyMTI5RTExRTI5NTQ2ODc5NEJGNzEwNkI5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmN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2bVcuqtQaDAQGYxALxbGEsRxyJAHIcvlHvqywWg/ELQ3+XMleYtiEeGVC/r0VeR2W4jDUeKhLcdpIQhAGAlIGAB9sacULWxN3EpHBsnimGqS3imqUWn8K5TT9OZnGXKaYbU/nDC8KIcGDnICSBz/Fz5cjEuEiMeHJFOxlV82Kgufu5Anv6KEolvSazJagU2K5LmPK2tsMIKlrPsBqrY52eQTovxV4ITJI4BoWuuB26bMolApcasuMllLvntIUAtpwqz5akkbilIOOYxnPtoaqV6d65O6xDk7Mcx8e5Q5WrMu7zoRmFr+F15quIu0+qw21VCGgPIeQ3htac4yUj5Uqz6AZ1TbRYfLTa0wyHhO+yTy+YUaxQ4TzmNUxn5XI89CbWLVka+9Ct+q3lLLFGiF5CThyWsEMNeuVdz+UZOiHC8Cs3nZMGQ8yod/F62HNzkdr5Ki7GsSFZFLEeOFPzZBC3pC04W4odDj8IHZPb65Omvh2HQUITFEfxHzS2xHEZMQnEkg0Wt1PVch1aoVNuOmLptWhtTYEoAOsPDKTyz9sEDB7awMEjMj0/8WMuTU7Bkgdk5vXqhNscPrYspLqaDRIcFWzCnG0ZcWPQrOVEffXMxMhAc0c1ZWMUu4kGutSk/9DsEqvERw2o90TbeqcpcpmX5ioalsLSNzfUZyk8wc4+p1ClDZNSMuyKdjsXsURLFHkQNdfX8wjVE8Otm0aElMFVTZLhHmrTJ+Z046qO39Bge2o9rAKdx+c4JybmNVV3trsRfLvOI1B6fz/K0VL4P2hCfSXaaucoK6zn1vJP9BO39Nbx7O4fVYZI4wT66qFZxy9KwZyZdv7mmBHjsxWUMsNIaZbThKGxtSB6ADpqyDA0iMcih8yGRvGdzC9rouy9rFi//2Q=='
Run('base64decode.exe ' & $b64code)

Share this post


Link to post
Share on other sites



Autoit3 limitations from the helpfile:

MAX_LINESIZE 4095 Maximum size for a line of script.

Ah Darn I was wondering why it was only showing up until a certain point in the error dialog. Is there any workaround? Thanks for the feedback!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I use this when I need to split a long string...

; AutoIt limit/default.
Local Const $MAX_LINESIZE =  4095
Local $vVar = ''
For $i = 1 To $MAX_LINESIZE
    $vVar &= '0'
Next

; Split the string into 160 characters.
Local $sResult = _SplitLongString($vVar, False, True)
MsgBox(4096, '', $sResult)
ClipPut($sResult)

Func _SplitLongString($sString, $fIsGlobal = Default, $fUseSingleQuotes = Default)
    Local Const $iLength = 160, $sVariable = '$vVar' ; With AutoIt V3.3.9.4+ the dollar sign is optional.
    Local $sQuote = '"', $sScope = 'Local '
    If $fIsGlobal Then
        $sScope = 'Global '
    EndIf
    If $fUseSingleQuotes Then
        $sQuote = ''''
    EndIf

    Local $sReturn = $sScope & $sVariable & ' = ' & $sQuote & StringLeft($sString, $iLength) & $sQuote & @CRLF
    $sString = StringTrimLeft($sString, $iLength)

    While StringLen($sString) > $iLength
        $sReturn &= $sVariable & ' &= ' & $sQuote & StringLeft($sString, $iLength) & $sQuote & @CRLF
        $sString = StringTrimLeft($sString, $iLength)
    WEnd

    If StringLen($sString) Then
        $sReturn &= $sVariable & ' &= ' & $sQuote & $sString & $sQuote
    EndIf
    Return $sReturn
EndFunc   ;==>_SplitLongString
Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0