mbierly Posted April 7, 2019 Share Posted April 7, 2019 I used the forum topic as the start of what I'm doing : Here's my code in the UniFileUploadCompleted event: var DestFolder: string := UniServerModule.StartPath + 'UploadFolder\'; var DestName: string := DestFolder + ExtractFileName(UniFileUpload1.FileName); CopyFile(PChar(AStream.FileName), PChar(DestName), False); var AFile: TFile; var AHtml: string := AFile.ReadAllText(DestName); ACmd := '.execCmd(' + '''' + 'InsertHTML' + '''' + ' , ' + '''' + AHtml + '''' + ')'; UniSession.AddJS(UniDBHTMLMemo1.JSName + ACmd); I'm getting an Unterminated String Constant error that I haven't been able to figure out. Any ideas what I need to change? There is additional code I've got that makes changes to the AHtml variable. I don't believe that is the source of my problem because I have inspected the variable in debug, copied the contents and then switched the DBHTMLMemo into source edit mode on the toolbar, pasted in the modified HTML and toggled back to "regular" mode everything displays as expected. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 7, 2019 Share Posted April 7, 2019 23 minutes ago, mbierly said: I'm getting an Unterminated String Constant error that I haven't been able to figure out. Any ideas what I need to change? Hello, Can you make a simple testcase for this (maybe with UniHTMLMemo)?! Quote Link to comment Share on other sites More sharing options...
mbierly Posted April 7, 2019 Author Share Posted April 7, 2019 Sherzod, Here is the test case to get the Unterminated String Constant error. I've included the MS Word doc in HTML format that I've been trying to get to load. It's located in the project folder. Thanks! Test_Case.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 7, 2019 Share Posted April 7, 2019 OK, I will check Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 7, 2019 Share Posted April 7, 2019 55 minutes ago, mbierly said: Here is the test case to get the Unterminated String Constant error. I've included the MS Word doc in HTML format that I've been trying to get to load. It's located in the project folder. Try this 1. Uses list: uses uniGUIVars , MainModule , uniGUIApplication , System.IOUtils , System.StrUtils , ServerModule , ExtPascalUtils //<----------- ; 2. ... ACmd := '.execCmd(' + '''' + 'InsertHTML' + '''' + ' , ' + StrToJS(AHtml) + ')'; //<----------- UniSession.AddJS(UniHTMLMemo1.JSName + ACmd); end; 1 Quote Link to comment Share on other sites More sharing options...
mbierly Posted April 7, 2019 Author Share Posted April 7, 2019 That worked perfectly! Thank you! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.