H hamed javadi Member Mar 28, 2022 #1 hi I get this error when compiling, I have a lot of code and it is mostly in Webview. what should I do? Code: Copy
hi I get this error when compiling, I have a lot of code and it is mostly in Webview. what should I do? Code: Copy
MicroDrie Well-Known Member Licensed User Longtime User Mar 28, 2022 #2 code too large public static String _webview1_loadhtml() Click to expand... You can try to reduce the length of the static string by using a lateral string which combine several other strings like B4X: Copy Dim FirstPart as string = $"First part of your HTML code"$ Dim SecondPart as string = $"Second part of your HTMLcode"$ Dim YourHTL as string = $"${FirstPart}${SecondPart}"$ Upvote 0
code too large public static String _webview1_loadhtml() Click to expand... You can try to reduce the length of the static string by using a lateral string which combine several other strings like B4X: Copy Dim FirstPart as string = $"First part of your HTML code"$ Dim SecondPart as string = $"Second part of your HTMLcode"$ Dim YourHTL as string = $"${FirstPart}${SecondPart}"$
Jeffrey Cameron Well-Known Member Licensed User Longtime User Mar 28, 2022 #3 If your string literal is that large, I would suggest adding it as a text/html file to your files folder and then loading it into your string: Code: Copy psHtmlData = File.ReadString(File.DirAssets, "example.txt") Upvote 0
If your string literal is that large, I would suggest adding it as a text/html file to your files folder and then loading it into your string: Code: Copy psHtmlData = File.ReadString(File.DirAssets, "example.txt")
agraham Expert Licensed User Longtime User Mar 28, 2022 #4 hamed javadi said: public static String _webview1_loadhtml() throws Exception{ ^: Click to expand... That's not a string literal, it's a declaration of a public method returning a String and the error is a code error that seems to occur at End Sub so I suspect that the method is too large and needs refactoring into several Subs. Upvote 0
hamed javadi said: public static String _webview1_loadhtml() throws Exception{ ^: Click to expand... That's not a string literal, it's a declaration of a public method returning a String and the error is a code error that seems to occur at End Sub so I suspect that the method is too large and needs refactoring into several Subs.