Forum > General

[Solved] Illegal expression for plus sign

(1/1)

nikel:
Hello, I'm trying to set and get some variables in my project. When I run the code below, I'm getting Illegal expression error.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---...var  Application: TMain; {$R *.res} begin  Application:=TMain.Create (nil);   Application.SetConfigFile(ParamStr(0)) + C_DELIMITER + 'config.txt');   Application.Title:='Playlist Program';  Application.Run;  Application.Free;end.
How can I fix this error?

Modify:
I'm using TCustomApplication in my class.

cdbc:
Hi
ParamStr(0) returns the whole program-name as called from the OS, on winders, that includes '.exe' extension, on unices it doesn't have to have an extension.
Which brings us to "C_DELIMITER", what the h*ll is that?!? Is it a hyphen '-' or what?!?
Third point:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Application.SetConfigFile(ParamStr(0)) + C_DELIMITER + 'config.txt');There's 1 too many ')' in this "ParamStr(0))", remove the last one, so that the entire becomes:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Application.SetConfigFile(ParamStr(0) + C_DELIMITER + 'config.txt');...Then your config-file may be named '/home/you/myapp-config.txt' at least on a *nix-box...
I'm grasping here, due to the lack of info...
Regards Benny

nikel:
Thank you sir. I deleted one of the double brackets and it's working fine.

Navigation

[0] Message Index

Go to full version