#1 2008-12-18 09:11

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

PascalScript - ExecuteProgram() and WideShowMessage()

1) Something like
ExecuteProgram('http://www.den4b.com', false); or even
ExecuteProgram('iexplore http://www.den4b.com', false);
doesn't seem to work (though the latter command works under Windows). So is there any way to directly launch a URL in the default system browser using PascalScript?

2) Is there any way to display multiple lines separated by newlines with the interactive dialog functions, such as ShowMessage(), WideShowMessage(), DialogYesNo(), WideDialogYesNo(), InputBox(), InputQuery(), WideInputBox() or WideInputQuery()?

For example, none of the following seem to work:
WideShowMessage('Line 1\rLine 2');
WideShowMessage('Line 1\nLine 2');
WideShowMessage('Line 1\r\nLine 2');

Last edited by Andrew (2008-12-18 09:12)

Offline

#2 2009-01-13 17:39

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: PascalScript - ExecuteProgram() and WideShowMessage()

1) At the moment, the only way to open URL is to use this command:
ExecuteProgram('"C:\Program Files\Internet Explorer\iexplore.exe" "http://www.den4b.com"', false);

I will add OpenFile() function which will open any file with an associated program, and it will also open URL addresses with default browser.

2) Yes, you can insert new lines, here is how:
WideShowMessage('Line'#13#10'Line 2');
WideShowMessage('Line'#13'Line 2');

Offline

#3 2009-01-13 18:24

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: PascalScript - ExecuteProgram() and WideShowMessage()

den4b wrote:

I will add OpenFile() function which will open any file with an associated program, and it will also open URL addresses with default browser.

An OpenFile() function will be simply fantastic, Denis! smile As you can well imagine, the current solution is extremely limited...

den4b wrote:

Yes, you can insert new lines, here is how:
WideShowMessage('Line'#13#10'Line 2');
WideShowMessage('Line'#13'Line 2');

Cool. cool I guess #13 = \r = CR, and #10 = \n = LF? But are both required? Just #13 seems to do the same job as #13#10 combined?

Also, even though the above works, shouldn't the correct syntax be:
WideShowMessage('Line' + #13 + 'Line 2');?

Offline

#4 2009-01-20 19:10

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: PascalScript - ExecuteProgram() and WideShowMessage()

I've added ShellOpenFile function, try it out. You can do these:
ShellOpenFile('http://www.den4b.com/');
ShellOpenFile('www.den4b.com');
ShellOpenFile('C:\Document.doc');

You guessed right about meaning of #13 and #10. In the dialogs, you can use just #13, without #10.

Also, you don't have to put "+" sign between string and the #XX character code, it is a little Delphi trick.

Offline

#5 2009-01-24 13:56

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: PascalScript - ExecuteProgram() and WideShowMessage()

Well, the ShellOpenFile() function seems to work quite well as far as I have tested it. No problems so far...

This is a great function, Denis. Thanks! big_smile

Offline

Board footer

Powered by FluxBB