www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD 0.114 release

reply "Walter" <newshound digitalmars.com> writes:
Lots of new string and regexp stuff:

http://www.digitalmars.com/d/changelog.html

A number of people have proposed having regular expression literals of the
form:

    /regexp/

The advantages are it is visually distinct and it can be overloaded
separately from strings. There are two problems with it:

The first is distinguishing a regexp literal from a divide / or /= token.
Languages that do support /regexp/ do it with a hack where the syntax parser
tells the lexer "I'm expecting an operator" or "I'm expecting a term". In
other words, the distinction between lexer and syntax analysis is lost.

The second is that D has 3 character types already. Adding in a /regexp/
literal implies adding in 3 more types. Then you're obliged to create more
overloads, more conversions, more rules. Not worth it.
Feb 28 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Walter wrote:

 What's New for D 0.114
 Feb 27, 2005

 New/Changed Features
 *  Added man pages to \dmd\man\man1 (thanks to Anders F Bjorklund) 

 Bugs Fixed
 #  Fixed std.format %A unittest failure under linux

Woohoo, less patches! :-) Updated RPMS at: http://www.algonet.se/~afb/d/dmd.spec http://www.algonet.se/~afb/d/dmd-0.114-8.nosrc.rpm Took out the man and conf sources, using the built-ins. (not hardcoding /usr/include/d anymore, see %{phobosdir}) Removed the Phobos format patch, as new unittest passes. (still think not using real is faster, but is for later) --anders
Feb 28 2005
prev sibling next sibling parent reply Vathix <vathix dprogramming.com> writes:
Doesn't look like the socket changes were compiled into phobos.lib. Here's  
my 3 attempts to compile, last one succeeded:

dmd htmlget ws2_32.lib
htmlget.obj(htmlget)
  Error 42: Symbol Undefined  
_D3std6socket9TcpSocket5_ctorFC3std6socket7AddressZC3std6socket9TcpSocket
--- errorlevel 1

dmd d:\dmd\src\phobos\std\socket.d htmlget ws2_32.lib
socket.obj(socket)
  Error 42: Symbol Undefined _FD_SET 8
socket.obj(socket)
  Error 42: Symbol Undefined _FD_CLR 8
socket.obj(socket)
  Error 42: Symbol Undefined _FD_ISSET 8
socket.obj(socket)
  Error 42: Symbol Undefined __init_3std1c7windows7winsock7WSADATA
--- errorlevel 4

dmd d:\dmd\src\phobos\std\socket.d  
d:\dmd\src\phobos\std\c\windows\winsock.d htmlget ws2_32.lib
d:\dmd\bin\..\..\dm\bin\link.exe  
socket+winsock+htmlget,,,ws2_32.lib+user32+kern
el32/noi;
Feb 28 2005
next sibling parent reply "Walter" <newshound digitalmars.com> writes:
"Vathix" <vathix dprogramming.com> wrote in message
news:opsmw2qwekkcck4r pm7-ppp033.dialup.wzrd.com...
 Doesn't look like the socket changes were compiled into phobos.lib.

You're right. I updated the zip file. Should be fixed now.
Feb 28 2005
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Walter wrote:

Doesn't look like the socket changes were compiled into phobos.lib.

You're right. I updated the zip file. Should be fixed now.

You did *what* ? :-O What if others are trying to use that release, and relying on that it won't be retro-fitted ?
 !!! Digest verification Failed:
 !!!    /usr/portage/distfiles/dmd.114.zip
 !!! Reason: Filesize does not match recorded size

--anders
Feb 28 2005
parent Florian <Florian_member pathlink.com> writes:
 You're right. I updated the zip file. Should be fixed now.

You did *what* ? :-O What if others are trying to use that release, and relying on that it won't be retro-fitted ?
 !!! Digest verification Failed:
 !!!    /usr/portage/distfiles/dmd.114.zip
 !!! Reason: Filesize does not match recorded size


Agreed. A realease should not be modified. better have a 0.114.5, or a 0.115 just after the 0.114, even if that means the 114 will forever be a broken release. If not, how to dealing with bug repports gets hard: - I got an error with dmd version 0.114 - which version 0.114? - ?! hmmm.... -- Florian
Feb 28 2005
prev sibling parent reply Vathix <vathix dprogramming.com> writes:
On Mon, 28 Feb 2005 09:56:11 -0800, Walter <newshound digitalmars.com>  
wrote:

 "Vathix" <vathix dprogramming.com> wrote in message
 news:opsmw2qwekkcck4r pm7-ppp033.dialup.wzrd.com...
 Doesn't look like the socket changes were compiled into phobos.lib.

You're right. I updated the zip file. Should be fixed now.

Still doesn't look like std.c.windows.winsock or std.socketstream are compiled in.
Feb 28 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"Vathix" <vathix dprogramming.com> wrote in message
news:opsmw6jhttkcck4r pm7-ppp033.dialup.wzrd.com...
 On Mon, 28 Feb 2005 09:56:11 -0800, Walter <newshound digitalmars.com>
 wrote:

 "Vathix" <vathix dprogramming.com> wrote in message
 news:opsmw2qwekkcck4r pm7-ppp033.dialup.wzrd.com...
 Doesn't look like the socket changes were compiled into phobos.lib.

You're right. I updated the zip file. Should be fixed now.

Still doesn't look like std.c.windows.winsock or std.socketstream are compiled in.

You didn't send me an update to std.socketstream. Ack, I didn't realize there were functions in winsock.d. I thought it was just declarations.
Feb 28 2005
next sibling parent reply Vathix <vathix dprogramming.com> writes:
 You didn't send me an update to std.socketstream.

But it's still crashing unless recompiled. Maybe it has some old inlined code.. I have no idea.
 Ack, I didn't realize there were functions in winsock.d. I thought it was
 just declarations.

Some macros turned into functions; same with std.c.linux.linux.
Feb 28 2005
parent "Walter" <newshound digitalmars.com> writes:
Clearly, I've botched folding in your update. I'll try and get it all fixed
tonight.
Feb 28 2005
prev sibling parent reply Vathix <vathix dprogramming.com> writes:
Another thing, the socket documentation is still the old one; it doesn't  
include the new stuff.
Feb 28 2005
parent reply jicman <jicman_member pathlink.com> writes:
Vathix says...
Another thing, the socket documentation is still the old one; it doesn't  
include the new stuff.

ok, we definitely need a new version. ;-) So, question, does this mean that I don't have to, dmd source.d ws2_32.lib anymore?
Feb 28 2005
next sibling parent Dave <Dave_member pathlink.com> writes:
In article <cvvu8r$h9u$1 digitaldaemon.com>, jicman says...
Vathix says...
Another thing, the socket documentation is still the old one; it doesn't  
include the new stuff.

ok, we definitely need a new version. ;-)

I think your right. If I may make a suggestion to the powers controlling the 0.114 distros. of D (zip's, rpms, ebuilds, etc.).. Pull the 0.114 download links and just replace them with 0.115 once the content is available (take 0.114 out of circulation to avoid the inevitable bug feedback on this stuff). - Dave
So, question, does this mean that I don't have to,

dmd source.d ws2_32.lib

anymore?

Feb 28 2005
prev sibling parent Vathix <vathix dprogramming.com> writes:
On Mon, 28 Feb 2005 20:17:31 +0000 (UTC), jicman  
<jicman_member pathlink.com> wrote:

 Vathix says...
 Another thing, the socket documentation is still the old one; it doesn't
 include the new stuff.

ok, we definitely need a new version. ;-) So, question, does this mean that I don't have to, dmd source.d ws2_32.lib anymore?

You will still have to do that.
Feb 28 2005
prev sibling parent Vathix <vathix dprogramming.com> writes:
 Doesn't look like the socket changes were compiled into phobos.lib.  
 Here's my 3 attempts to compile, last one succeeded:

 dmd d:\dmd\src\phobos\std\socket.d  
 d:\dmd\src\phobos\std\c\windows\winsock.d htmlget ws2_32.lib
 d:\dmd\bin\..\..\dm\bin\link.exe  
 socket+winsock+htmlget,,,ws2_32.lib+user32+kern
 el32/noi;

It'll crash with just that due to phobos.lib having the old version of socketstream compiled in, so this makes it work correctly (files rearranged so that the correct exe name is output): dmd htmlget d:\dmd\src\phobos\std\socket.d d:\dmd\src\phobos\std\c\windows\winsock.d d:\dmd\src\phobos\std\c\windows\windows.d d:\dmd\src\phobos\std\socketstream.d ws2_32.lib d:\dmd\bin\..\..\dm\bin\link.exe htmlget+socket+winsock+windows+socketstream,,,ws2_32.lib+user32+kernel32/noi; There should be a way to avoid this from happening :|
Feb 28 2005
prev sibling next sibling parent reply Georg Wrede <georg.wrede nospam.org> writes:
Walter wrote:
 Lots of new string and regexp stuff:
 
 http://www.digitalmars.com/d/changelog.html
 
 A number of people have proposed having regular expression literals of the
 form:
 
     /regexp/
 
 The advantages are it is visually distinct and it can be overloaded
 separately from strings. There are two problems with it:

Thanks for trying!!!!!!!! A proposal below here.
 The first is distinguishing a regexp literal from a divide / or /= token.
 Languages that do support /regexp/ do it with a hack where the syntax parser
 tells the lexer "I'm expecting an operator" or "I'm expecting a term". In
 other words, the distinction between lexer and syntax analysis is lost.
 
 The second is that D has 3 character types already. Adding in a /regexp/
 literal implies adding in 3 more types. Then you're obliged to create more
 overloads, more conversions, more rules. Not worth it.

Suppose we want to get rid of these two problems. We'd have to conjure up a way to avoid having the lexer identify a regexp. Then we'd have to avoid needing 3 more types. While a nice concept, the Unquoted Regular Expression is undeniably hard on the lexer. Regexps like / 2*3 / /2 + 3 / etc. are admittedly labourious. (While I (currently) think they are not ambiguous, especially if we restrict regexps to be contained within a single line, I understand that this would be too much work for D 1.0.) As to the type thing, you're right, that would be way too much code writing and maintenance. So, I outlined a solution. (Mind you, I haven't investigated it thoroughly, so it's just a suggestion.) Instead of a special quoting mechanism ( /bla/ ) to differentiate between regexps and strings, we could use the context instead. In other words, whenever an anonymous function is expected, and a string is found, then the string would be considered a regular expression. Thus, if bar is a string type variable, then bar = "foo"; would be an assignment of string. And if bar is a type that "can contain a function", then bar = "foo"; would be an assignment of an anonymous function. If we do it like this, then there would be no syntactical difference between literals in source code and arbitrary regexps encountered at runtime. Any time you assign a string to a function variable, it would be considered a regexp -- and therefore compiled (if source then compiled into the binary, if runtime then jit-style compiled) before assignment. This would obviate the need for the 3 new types. And it would let us use the regexps as earlier proposed. Examples: found = "lskdjflskj" (theText); ok = "lkajsdlkjaksdf" (aDataLine, i, theDollars); ok = aStringVar (inputLine, pos, outArray); enum {entireMatch, firstNam, lastNam} if ( "lkjslkjlskjdlksjdf" (currentLine, where, S) ) { victim = S[lastNam] ~ " ," ~ S[firstNam]; } // (entireMatch was missing in earlier examples. // Sub expressions start from S[1], like $1, etc.) if( "^.*--" (inputline, i) && " *XXX" (inputline, i) && "[0-9]" (inputline, i) ) showMessage("Line conforms to spec."); if( findProlog (inFile, j) && findNugget (inFile, j) && findEpilog (inFile, j) ) showMessage ("File is Well Formed.");
Feb 28 2005
next sibling parent "Walter" <newshound digitalmars.com> writes:
"Georg Wrede" <georg.wrede nospam.org> wrote in message
news:4223AC98.5070507 nospam.org...
 So, I outlined a solution. (Mind you, I haven't investigated it
 thoroughly, so it's just a suggestion.)

Hmm. If I could generalize, then any string immediately followed by parentheses would be considered a regular expression, and then the special semantics? That might actually work, but such things often have unintended consequences. Have to think about it.
Feb 28 2005
prev sibling parent John Reimer <brk_6502 yahoo.com> writes:
Nifty idea there, Georg!

-JJR
Feb 28 2005
prev sibling next sibling parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Why not just prefix the regexp with a keyword?

char[][] matches = regexp/match/(<string>);

That seems quite readable, it has the regexp-as-anon-func syntax, and it 
is trivial to detect in the lexical phase.

Walter wrote:
 Lots of new string and regexp stuff:
 
 http://www.digitalmars.com/d/changelog.html
 
 A number of people have proposed having regular expression literals of the
 form:
 
     /regexp/
 
 The advantages are it is visually distinct and it can be overloaded
 separately from strings. There are two problems with it:
 
 The first is distinguishing a regexp literal from a divide / or /= token.
 Languages that do support /regexp/ do it with a hack where the syntax parser
 tells the lexer "I'm expecting an operator" or "I'm expecting a term". In
 other words, the distinction between lexer and syntax analysis is lost.
 
 The second is that D has 3 character types already. Adding in a /regexp/
 literal implies adding in 3 more types. Then you're obliged to create more
 overloads, more conversions, more rules. Not worth it.
 
 

Mar 01 2005
prev sibling parent reply "Carlos Santander B." <csantander619 gmail.com> writes:
DMDScript has been broken: "Error: circular initialization dependency 
with module value". I think it's caused between dmdscript.value 
(obviously) and dmdscript.protoerror (the only other static constructor 
is in dmdscript.lexer). The dependency seems to be: value -> dobject -> 
protoerror -> value. I only tested it on Windows.

OT: DMDScript source
Walter, don't you think the imports in DMDScript should all be private? 
Could you change that, please?

_______________________
Carlos Santander Bernal
Mar 01 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"Carlos Santander B." <csantander619 gmail.com> wrote in message
news:d02lek$qka$1 digitaldaemon.com...
 DMDScript has been broken: "Error: circular initialization dependency
 with module value". I think it's caused between dmdscript.value
 (obviously) and dmdscript.protoerror (the only other static constructor
 is in dmdscript.lexer). The dependency seems to be: value -> dobject ->
 protoerror -> value. I only tested it on Windows.

I know. The dependency stuff got tightened up in 0.114. I have DMDScript fixed, I just haven't uploaded it yet.
 OT: DMDScript source
 Walter, don't you think the imports in DMDScript should all be private?
 Could you change that, please?

Probably a good idea.
Mar 01 2005
parent reply "Carlos Santander B." <csantander619 gmail.com> writes:
Walter wrote:
 "Carlos Santander B." <csantander619 gmail.com> wrote in message
 news:d02lek$qka$1 digitaldaemon.com...
 
DMDScript has been broken: "Error: circular initialization dependency
with module value". I think it's caused between dmdscript.value
(obviously) and dmdscript.protoerror (the only other static constructor
is in dmdscript.lexer). The dependency seems to be: value -> dobject ->
protoerror -> value. I only tested it on Windows.

I know. The dependency stuff got tightened up in 0.114. I have DMDScript fixed, I just haven't uploaded it yet.

Thanks.
 
OT: DMDScript source
Walter, don't you think the imports in DMDScript should all be private?
Could you change that, please?

Probably a good idea.

I would remove the "probably" ;) _______________________ Carlos Santander Bernal
Mar 01 2005
parent reply jicman <jicman_member pathlink.com> writes:
Greetings!

I have a bunch of JScript programs that I want to move to ds, but I need to know
if ds works well with COM objects as Word, Excel, IExplorer, etc.  For example,
I have this JScript program that opens a web browser with this function:

function GetIEWindow()
{
var Title = "DAE Log Report Creator - Get Values";  // Title of IE window
var intCount = 0;                      // Counter used during AppActivate
//Create reference to objIE.  This will be used for
//the user messages. Also set IE display attributes
//var objIE = new ActiveXObject("InternetExplorer.Application");
var objIE = WScript.CreateObject("InternetExplorer.Application");
objIE.Navigate("about:blank");
objIE.ToolBar   = 0;
objIE.Menubar   = 0;
objIE.StatusBar = 0;
objIE.Width     = 850;
objIE.Height    = 710;
objIE.Left      = 10;
objIE.Top       = 10;
//Set some formating
objIE.document.writeln ("<!doctype html public>");
objIE.document.writeln ("<head>");
objIE.document.writeln ("<title>" + Title + "</title>");
objIE.document.writeln ("<style type=\"text/css\">");
objIE.document.writeln
("body {text-align: left; font-family: courier; font-size: 9pt}");
objIE.document.writeln ("</style>");
objIE.document.writeln ("</head>");
objIE.document.bgColor = "ddffdd";
objIE.document.writeln (
"<script type=\"text/javascript\">" +
"function submitform() " +
"{ " +
"  document.title = \"DAE Log Report Creator - Process Values\";"  +
"  alert(\"Values Accepted.\"); " +
"} " +
"</script>" );
objIE.document.writeln ('<form name="GetVals" method="post">');
//Wait for IE to finish
while (objIE.busy) { w.Sleep( 200); }
//Show IE
objIE.Visible = 1;
return(objIE);
}

How well does DMDScript plays with Windows COM objects?

thanks,

jic
Mar 01 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"jicman" <jicman_member pathlink.com> wrote in message
news:d03kek$1tra$1 digitaldaemon.com...
 How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.
Mar 02 2005
next sibling parent reply jicman <jicman_member pathlink.com> writes:
Walter says...
"jicman" <jicman_member pathlink.com> wrote in message
news:d03kek$1tra$1 digitaldaemon.com...
 How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

Is it ever going to provide it?
Mar 02 2005
parent "Walter" <newshound digitalmars.com> writes:
"jicman" <jicman_member pathlink.com> wrote in message
news:d052ih$h4o$1 digitaldaemon.com...
 Walter says...
"jicman" <jicman_member pathlink.com> wrote in message
news:d03kek$1tra$1 digitaldaemon.com...
 How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

Is it ever going to provide it?

Unlikely, given the lack of interest in the C++ version that does it.
Mar 02 2005
prev sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Walter wrote:
 "jicman" <jicman_member pathlink.com> wrote in message
 news:d03kek$1tra$1 digitaldaemon.com...
 
How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

The C++ might play, but I wouldn't say that it plays well. For example, this code (similar to what jicman suggested), var objIE = new ActiveXObject("InternetExplorer.Application"); objIE.Navigate("about:blank"); objIE.ToolBar = 0; objIE.Menubar = 0; objIE.StatusBar = 0; objIE.Width = 850; objIE.Height = 710; objIE.Left = 10; objIE.Top = 10; objIE.Visible = 1; works fine as JScript (save it as a .js file and see for yourself). A blank Internet Explorer window is opened. That was the expected result. On the other hand, DMDScript 1.02 (the last C++ version) won't touch this code: Digital Mars DMDScript 1.02 www.digitalmars.com Compiled by Digital Mars C/C++ 8.32.3 written by Walter Bright 1 source files Exception: primitive Undefined has no Construct method And no IE window is opened. (Too bad there isn't a line number on the error message, but that's another issue and it might be better in the latest version.) I'd be able to use DMDScript for many things if it allows us to create ActiveX/COM objects. Without ActiveX, it's not very useful to me. Am I just using the wrong syntax? (Sorry for cross-posting, but the rest of this thread is cross-posted and who am I to break with precedent.) -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Mar 08 2005
next sibling parent reply "Carlos Santander B." <csantander619 gmail.com> writes:
J C Calvarese wrote:
 
 The C++ might play, but I wouldn't say that it plays well.
 
 For example, this code (similar to what jicman suggested),
 
     var objIE = new ActiveXObject("InternetExplorer.Application");
     objIE.Navigate("about:blank");
     objIE.ToolBar   = 0;
     objIE.Menubar   = 0;
     objIE.StatusBar = 0;
     objIE.Width     = 850;
     objIE.Height    = 710;
     objIE.Left      = 10;
     objIE.Top       = 10;
     objIE.Visible = 1;
 
 works fine as JScript (save it as a .js file and see for yourself). A 
 blank Internet Explorer window is opened. That was the expected result.
 
 On the other hand, DMDScript 1.02 (the last C++ version) won't touch 
 this code:
 
     Digital Mars DMDScript 1.02
     www.digitalmars.com
     Compiled by Digital Mars C/C++ 8.32.3
     written by Walter Bright
     1 source files
     Exception: primitive Undefined has no Construct method
 
 And no IE window is opened. (Too bad there isn't a line number on the 
 error message, but that's another issue and it might be better in the 
 latest version.)
 
 I'd be able to use DMDScript for many things if it allows us to create 
 ActiveX/COM objects. Without ActiveX, it's not very useful to me. Am I 
 just using the wrong syntax?
 

How is that JS code that you posted written in D? I could try to implement it in Walnut, but I have no experience with ActiveX besides what Visual Basic does for you, so I could use a lot of help. The samples I've seen so far load COM objects using a GUID (is it the same with ActiveX?) but I see you load by name. Also, there's always an interface declared, but I think properties and methods are called dynamically, so another option is needed. I was thinking about doing this before, but there's a doubt I have: I've tried to keep Walnut as platform independent as possible (that's why I've used MinWin), but ActiveX is clearly a Windows-only feature. Does it make sense to add ActiveX support?
 (Sorry for cross-posting, but the rest of this thread is cross-posted 
 and who am I to break with precedent.)
 

I think any of us can break with precedent, as you put it. _______________________ Carlos Santander Bernal
Mar 08 2005
next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Carlos Santander B. wrote:
 J C Calvarese wrote:

 
 How is that JS code that you posted written in D? I could try to 

Actually, I wish I knew. My point was that JScript can do it. DMDScript can't (apparently). I'm pretty sure that D can do stuff like this if the programmer knows what he's doing, but that's not me (yet). But I don't see any reason to use DMDScript if can't do ActiveX. (The only thing I ever use JScript/VBScript for is ADO.)
 implement it in Walnut, but I have no experience with ActiveX besides 

Oh, yeah. I forgot about Walnut. Yay for open source!
 what Visual Basic does for you, so I could use a lot of help. The 
 samples I've seen so far load COM objects using a GUID (is it the same 
 with ActiveX?) but I see you load by name. Also, there's always an 
 interface declared, but I think properties and methods are called 
 dynamically, so another option is needed.

Somebody must know how to do this! A while back, I found some C code (written by someone else) that uses IScriptControl to accomplish to start Microsoft's VBScript engine, but I couldn't get it converted into D. When I finally got something to compile it gives me an "Access Violation". Even if it had worked, it would've been a little messy, but I coudln't even get it to work! I think the C method was based on one of these pages: http://www.aleax.it/TutWin32/s39.htm http://www.aleax.it/TutWin32/r35.htm
 I was thinking about doing this before, but there's a doubt I have: I've 
 tried to keep Walnut as platform independent as possible (that's why 
 I've used MinWin), but ActiveX is clearly a Windows-only feature. Does 
 it make sense to add ActiveX support?

I think it makes a lot of sense to add ActiveX support. Some Linux diehards might snicker, but I'd think most Windows programmers would applaud.
 
 (Sorry for cross-posting, but the rest of this thread is cross-posted 
 and who am I to break with precedent.)

I think any of us can break with precedent, as you put it.

Yeah, I guess I should have used an emoticon of some sort to indicate humor. ;)
 _______________________
 Carlos Santander Bernal

-- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Mar 08 2005
parent jicman <jicman_member pathlink.com> writes:
J C Calvarese says...
I think it makes a lot of sense to add ActiveX support. Some Linux 
diehards might snicker, but I'd think most Windows programmers would 
applaud.

I agree. I am also a Unix/Linux lover, but let's face it, we all work in a Windows environment nowadays, so this has got to be thought of. Most big companies are moving into .HECK, errr...I mean, .NET and we are faced, daily, with task that are Windows based. Adding ActiveX support to both D and DMDScript (d based also) will make serious programmers think seriously (sorry, couldn't think of another word) about d/DMDScript. Just a thought, as always... josť
Mar 09 2005
prev sibling parent reply jicman <jicman_member pathlink.com> writes:
Carlos Santander B. says...
How is that JS code that you posted written in D? I could try to 
implement it in Walnut, but I have no experience with ActiveX besides 

What is walnut? Is that only linux based?
Mar 09 2005
parent J C Calvarese <jcc7 cox.net> writes:
In article <d0mg67$1qmu$1 digitaldaemon.com>, jicman says...
Carlos Santander B. says...
How is that JS code that you posted written in D? I could try to 
implement it in Walnut, but I have no experience with ActiveX besides 

What is walnut? Is that only linux based?

http://www.dsource.org/projects/walnut/ It's Carlos Santander's fork of Walter's DMDScript code. He's trying to add all of the goodies that Walter is too busy to add. I think it's cross-platform (so everyone can be happy). There's an .exe listed under the downloads, so Windows users should be covered. jcc7
Mar 09 2005
prev sibling next sibling parent jicman <jicman_member pathlink.com> writes:
Justin,

I also tried it after that reply from Walter, but it didn't work, and having no
documentation about COM anywhere, I gave up.  I would use DMDScript instead of
JScript, but it needs to have the COM communication capabilities that JScript
has.  Otherwise, it's just another basic language, except that it's faster.
Scripting usage, for most folks, is based in being be able to connect to a drive
or a server or a printer; sometimes basic server login features and grouping
features; emailing after a task is done or when an error is encountered, etc.
All of these need Windows COM communications.

Walter, if you know of a way of doing it, please post it here and I'll give it a
try.

Anyway, I feel your pain, Justin. :-)

josť

J C Calvarese says...
Walter wrote:
 "jicman" <jicman_member pathlink.com> wrote in message
 news:d03kek$1tra$1 digitaldaemon.com...
 
How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

The C++ might play, but I wouldn't say that it plays well. For example, this code (similar to what jicman suggested), var objIE = new ActiveXObject("InternetExplorer.Application"); objIE.Navigate("about:blank"); objIE.ToolBar = 0; objIE.Menubar = 0; objIE.StatusBar = 0; objIE.Width = 850; objIE.Height = 710; objIE.Left = 10; objIE.Top = 10; objIE.Visible = 1; works fine as JScript (save it as a .js file and see for yourself). A blank Internet Explorer window is opened. That was the expected result. On the other hand, DMDScript 1.02 (the last C++ version) won't touch this code: Digital Mars DMDScript 1.02 www.digitalmars.com Compiled by Digital Mars C/C++ 8.32.3 written by Walter Bright 1 source files Exception: primitive Undefined has no Construct method And no IE window is opened. (Too bad there isn't a line number on the error message, but that's another issue and it might be better in the latest version.) I'd be able to use DMDScript for many things if it allows us to create ActiveX/COM objects. Without ActiveX, it's not very useful to me. Am I just using the wrong syntax? (Sorry for cross-posting, but the rest of this thread is cross-posted and who am I to break with precedent.) -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/

Mar 08 2005
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"J C Calvarese" <jcc7 cox.net> wrote in message
news:d0lm0k$tit$1 digitaldaemon.com...
 Walter wrote:
 "jicman" <jicman_member pathlink.com> wrote in message
 news:d03kek$1tra$1 digitaldaemon.com...

How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

The C++ might play, but I wouldn't say that it plays well.

The problem is you're using the command line DMDScript interpreter, which doesn't support COM. You need to use the COM scripting one, which has to be installed and registered per the instructions.
Mar 08 2005
next sibling parent reply jicman <jicman_member pathlink.com> writes:
Walter says...
"J C Calvarese" <jcc7 cox.net> wrote in message
news:d0lm0k$tit$1 digitaldaemon.com...
 Walter wrote:
 "jicman" <jicman_member pathlink.com> wrote in message
 news:d03kek$1tra$1 digitaldaemon.com...

How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

The C++ might play, but I wouldn't say that it plays well.

The problem is you're using the command line DMDScript interpreter, which doesn't support COM. You need to use the COM scripting one, which has to be installed and registered per the instructions.

Ok, I see. Is this going to cost me? :-) josť
Mar 09 2005
parent "Walter" <newshound digitalmars.com> writes:
"jicman" <jicman_member pathlink.com> wrote in message
news:d0menf$1p8a$1 digitaldaemon.com...
The problem is you're using the command line DMDScript interpreter, which
doesn't support COM. You need to use the COM scripting one, which has to


installed and registered per the instructions.

Ok, I see. Is this going to cost me? :-)

No, I mean it has to be registered with the Windows system registry!
Mar 09 2005
prev sibling parent reply Kramer <Kramer_member pathlink.com> writes:
Walter, it seems like people are starting to ask for it; or at least notice that
it's not supported.

DMDScript/86
DMDScript/94

Is there any way we could get it?  Or at least make it a future direction for
DMDScript to be implemented in said future?

-Kramer

In article <d0m3f5$1cbj$1 digitaldaemon.com>, Walter says...
"J C Calvarese" <jcc7 cox.net> wrote in message
news:d0lm0k$tit$1 digitaldaemon.com...
 Walter wrote:
 "jicman" <jicman_member pathlink.com> wrote in message
 news:d03kek$1tra$1 digitaldaemon.com...

How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.

The C++ might play, but I wouldn't say that it plays well.

The problem is you're using the command line DMDScript interpreter, which doesn't support COM. You need to use the COM scripting one, which has to be installed and registered per the instructions.

Mar 09 2005
parent reply J C Calvarese <jcc7 cox.net> writes:
In article <d0n7kp$2ka2$1 digitaldaemon.com>, Kramer says...
Walter, it seems like people are starting to ask for it; or at least notice that
it's not supported.

DMDScript/86
DMDScript/94

Is there any way we could get it?  Or at least make it a future direction for
DMDScript to be implemented in said future?

Since Walter has released the source for the D version, we have more options than we used to. If someone can figure out how to implement a function in D, then Carlos Santander can add it to Walnut (and Walter may even decide to add it to his source). But now that I've seen how the C++ version of DMDScript can actually do some COM, I'm not sure how feasible it's going to be. Also, was I the only one bothered by this (http://www.digitalmars.com/dscript/index.html): "Note: Much of the Windows user interface outside of the browser depends on Microsoft's JScript engine, and it depends on many undocumented features of JScript. These undocumented behaviors may not work with DMDScript; DMDScript is designed to handle script embedded in web pages accessed through the browser.". Sounds like the most prudent way to run the DMDScript .dll is to do this: regsvr32 dscript.dll treatas jscript dmdscript wscript.exe myscript.js regsvr32 /u dscript.dll treatas jscript (Note that wscript.exe won't run a DMDScript file unless it's renamed to .js.) Recipe for disaster? I'm hoping there's a better avenue available that the one traveled by the C++ edition of DMDScript.
-Kramer

In article <d0m3f5$1cbj$1 digitaldaemon.com>, Walter says...
The problem is you're using the command line DMDScript interpreter, which
doesn't support COM. You need to use the COM scripting one, which has to be
installed and registered per the instructions.


jcc7
Mar 09 2005
parent reply jicman <jicman_member pathlink.com> writes:
J C Calvarese says...
In article <d0n7kp$2ka2$1 digitaldaemon.com>, Kramer says...
Walter, it seems like people are starting to ask for it; or at least notice that
it's not supported.

DMDScript/86
DMDScript/94

Is there any way we could get it?  Or at least make it a future direction for
DMDScript to be implemented in said future?

Since Walter has released the source for the D version, we have more options than we used to. If someone can figure out how to implement a function in D, then Carlos Santander can add it to Walnut (and Walter may even decide to add it to his source). But now that I've seen how the C++ version of DMDScript can actually do some COM, I'm not sure how feasible it's going to be. Also, was I the only one bothered by this (http://www.digitalmars.com/dscript/index.html): "Note: Much of the Windows user interface outside of the browser depends on Microsoft's JScript engine, and it depends on many undocumented features of JScript. These undocumented behaviors may not work with DMDScript; DMDScript is designed to handle script embedded in web pages accessed through the browser.".

But Python and Perl can open a browser and a Word Document and an Excel spreadsheet and... So, if they did it, why can we? The other nice thing would be to have d also have this functionalities! Man, I would be in love again... jic
Mar 10 2005
parent J C Calvarese <jcc7 cox.net> writes:
jicman wrote:
 J C Calvarese says...

Is there any way we could get it?  Or at least make it a future direction for
DMDScript to be implemented in said future?

Since Walter has released the source for the D version, we have more options than we used to. If someone can figure out how to implement a function in D, then Carlos Santander can add it to Walnut (and Walter may even decide to add it to his source). But now that I've seen how the C++ version of DMDScript can actually do some COM, I'm not sure how feasible it's going to be.


 
 But Python and Perl can open a browser and a Word Document and an Excel
 spreadsheet and...  So, if they did it, why can we?  The other nice thing would
 be to have d also have this functionalities!  Man, I would be in love again...

Yeah, it should be easier. In a perfect world. Python's handling of COM (with the proper extras installs) works fine. I think Walter is more concerned about getting the bugs out of the D compiler than polishing off DMDScript. And that's how I'd prefer him to devote his time, too. ;) Good news in another thread: Carlos Santander seems to be making good progress at figuring out late binding (digitalmars.D/19110). Also (since you mentioned Python), I think Python is written in C (might be C++). In either case, Python is open source so viewing their tricks at implementing COM might be useful. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Mar 10 2005