3

I am having trouble installing DWSScript component. I am using Delphi XE2 and when I try to compile the dwsLibRuntime.dpk I get an error ( Array type required ). I am using the latest DWScript source pulled from the project's svn repo.

What am I doing wrong?

 toStr:=TStringListCracker(sl).FList[i].FString; //produces error
 System.MonitorExit(sl);
9
  • @DavidHeffernan i mentioned that i am using delphi xe 2 ;) what can i do in this case ?
    – opc0de
    Mar 27, 2012 at 8:06
  • yep i have the last version ...
    – opc0de
    Mar 27, 2012 at 8:08
  • 1
    Are you sure you are compiling with XE2? I can see that the implementation of TStringList has changed (certainly between 2010 and XE2) in a way that would explain that error. Mar 27, 2012 at 8:21
  • 1
    As a complete aside, does anyone know why this code feels the need to poke around with the private implementation details of TStringList? Mar 27, 2012 at 8:26
  • 1
    @David: it's a speed optimization, it removes a complex call, a range check, an UStrAsg and accompanying bus lock from a critical section, along with an implicit exception frame in UnifyAssignString (used to guard the return value of the Get) and reduce register pressure in UnifyAssignString. Speedup is a few percent points in single-threaded situations up to 20-30% in some heavily multi-threaded scenarios. Just look at the code in the CPU view between the cracker-hack and the "toStr:=sl[i]" variant. Mar 27, 2012 at 9:11

2 Answers 2

10

You're not using the latest version, the monitor isn't used anymore (due to contention bugs in the RTL implementation), the second line should read as "sl.FLock.Leave;". You're likely on a pre-Delphi XE2 version, as the Monitor was dropped in february 2011.

http://code.google.com/p/dwscript/source/browse/trunk/Source/dwsUtils.pas#475

Make sure you're on the head/trunk, or Delphi isn't pointed to a different directory than the one updated by your SVN client.

1
  • is there any link to an Installation guide for DWS? I have no idea how to compile lets say the HTTP.sys Server. How do I have to configure the IDE to compile DWS Projects?
    – Sebastian
    Jan 9, 2014 at 20:11
1

First of all make sure you downloaded the newest version from the main source, because DWScript 2.3 preview 1 is now available.

Then you must notice on this page that everyday you have changes on DWScript, so check where is the error (in which unit), then go to the source code page to take the most recent units.

Personally, it happened to me, and after I fixed some changes, it worked fine.

1
  • 2
    You can also use an SVN client (the one built in Delphi, or Tortoise SVN) to keep your files up to date. Mar 27, 2012 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.