Jump to content

Dany

Members
  • Content Count

    128
  • Joined

  • Last visited

Everything posted by Dany

  1. Shane, in the top post the loop goes from LOW to HIGH. In the last (Delphi) post the loop goes from HIGH to LOW. I.e downto or to. dunno how to delete this. Saw the other threads... Ignore.
  2. Dany

    W3AutoRefresh.

    +1 on the "Debug/Release" option sets. Needed!
  3. Yes this is truly annoying and a bit scary too.
  4. I I'm interested too. Both in the importer and regarding yur findings on using sms with DevExpress. I for one would appreciate if you kept us updated. Regards, /Dany
  5. Dany

    Suggestion for Assigned

    This is odd... The TBufferHandler is declared in the SmartCL namespace in System. Anyway - if i do not include that (or any other) any unit with a TVariant helper class providing a function named valid then the output will be: if (LAnyVariant.valid) { ... And that might or might not work. A Variant is something unknown to the compiler, thus i do not think your recommendation is sound at all, sorry. The TBufferHandlerHelper class IMHO is a dangerous beast if it tries to replace calls on variants. Suddenly the recommended way (Chapter 4.13.2 in the Smart Book) of avoiding asm-blocks
  6. Dany

    for LRec in FRecArray

    I see i forgot to paste the record definitions - sorry, but you figured it out anyway!
  7. Would it not be convenient if Assigned() could also work with Variants? Now i have to use VarIsValidRef from System.Types. It can perhaps be confusing that if (lVariantVariable) then and if VarIsValidRef(lVariantVariable) then does not yield the same result (if the variant is 0 or false). In this case if Assigned(lVariantVariable) then will not compile. Personally i understand this, but perhaps it would be good for the product to make Assigned() work here too? If possible, that is. The gist is that the compiler could keep track of the difference between
  8. Dany

    for LRec in FRecArray

    There's even more inconsistencies than i realized from start, check this out: procedure TApplication.PopulateConsole; var LVarArray: array of Variant = (1, 2, 3); LRecArray: array of TRec = ((num: 1), (num: 2), (num: 3)); LRecArray2: array of TRec2 = ((num: 1), (num: 2), (num: 3)); begin Console.WriteLn('Hello world'); Console.WriteLn(IntToStr(LRecArray[0].num + LRecArray[1].num + LRecArray[2].num)); for var rec in LRecArray do rec.num := rec.num + 1; Console.WriteLn(IntToStr(LRecArray[0].num + LRecArray[1].num + LRecArray[2].num)); Console.WriteLn(IntToStr(LRecArray2[0]
  9. Hi! When i do a for .. in using an array of records, the compile creates a COPY of the array element. But i do not get any warning when assigning values to the local record copy. The values are of course "lost" after the loop. When i do a for .. in using an array of variants, i can assign value(s) to the local variant variable and it works because no copy is created. I feel this is a bit inconsistent. Alas in the first scenario either the copy should be written back to the array after the last loop statement or the local copy of the record should be forced to be read-only / const.
  10. Dany

    Why "CL" namespace?

    I look at all the goodies. As per an older post i'm writing my own RTL. Thus, as an example, the unit SystemCL.Dictionaries, why is it under the SmartCL and not System? It's just two exceptions that uses SmartCL and that could be changed to a more generic exception class. Also - OT and just as a reminder (posted before) - the array Map compiler native function is great! Once again, please implement a similar Filter function. It's a pain to make it work using asm sections. Regards, /D
  11. It seems i can not declare overloaded methods in an interface. I get "Syntax Error: END expected" at the keyword. Is this intentional?
  12. I run it in a VM. It's just minutes before i have to restart in order to get code insight(*) to work. * I.e. Pressing Ctrl+Space after a dot. Utterly annoying, had this worked it had been wonderful!
  13. Very very briefly... cloned my SMS VM. Upgraded. Compiled everything. Did some cursory tests. Seems to work!
  14. Using inline if with string results can be very dangerous and annoying. The codegen often assures a string result by prepending the argument with ""+ and it seems that JS operator precedence puts + before ? or some such. I evaluate the following in the Chrome console when Self.FMode has the value of 2: ""+(Self.FMode==1)?dsPhrases.templateFileLabel[TMultiFile.a$53(Self)]:dsPhrases.fileUploadLabel[TMultiFile.a$53(Self)] and i get the value in dsPhrases.templateFileLabel, apparently not the expected result. When i evaluate the following expression at the same breakpoint (FMode is still 2)
  15. type RValue = record id: integer; name: string; other: Variant; end; function MkVal(const aId: integer; const aName: string; const aOther: Variant): RValue; begin Result.id := aId; Result.name := aName; Result.other := aOther; end; procedure TApplication.PopulateConsole; var lValue: RValue; lArray: array of RValue; begin lArray.Add(MkVal(1, 'test', '88')); lArray.Add(MkVal(3, 'something', null)); lArray.Add(MkVal(3, 'something', undefined)); for lValue in lArray do Console.WriteLn(Format('Id: %s Name: %s Other: %s', [lValue.id, lValue.name,
  16. Dany

    Annoying markings

    In the Beta, when i search and hit, the consecutive hits are marked with a background color. These marks are painted with the same CASE (upper/lower) that i typed into the searchbox. This is confusing as i see what i assume is typos in the code. Pascal is non-case sensitive, but javascript is so everything after a variants dot is very confusing. Secondly, the markings i have (i have not changed anything) for compile errors zapps the syntax color coding of the whole row and that makes it very difficult to see what to do. I think its the same for warnings too. Regards, /Dany
  17. Nope, at least not for W3Button2Click. From 0 you need to stop on count or length - 1. You can use Low() to High() since High for an empty array returns -1.
  18. Dany

    SmartCL.System

    SmartCL.System.pas @974: @result = mData; should read @result = @mData; I think i reported this already (?) Regards, /D
  19. Who removed my post? I did comment on this. REALLY sad if i have to take a sceencopy every time i post here. I have also sent both e-mail and inboxes to Jörn about an entire post that disappeared.
  20. Dany

    JObject and events

    I'm doing this with 2.2.0.3999.
  21. Dany

    JObject and events

    OK, then. More specifically. This does not work: unit JTestUnit; interface uses System.Types, W3C.DOM, W3C.HTML5; type JTest = class(JObject) public procedure Setup; procedure HandleDragOver(evt: JEvent); procedure HandleDrop(evt: JEvent); end; implementation { JTest } procedure JTest.Setup; begin var dropZone := Document.getElementById('dropzone'); if Assigned(dropZone) then begin dropZone.addEventListener('dragover', @HandleDragOver, false); dropZone.addEventListener('drop', @HandleDrop, false); end; end; procedure JTest.HandleDragOver(evt: JEvent)
  22. Dany

    JObject and events

    Im having some problems adding events in a JObject decendant. It seems the code generation here differ between 2.1 and 2.2. Question: Specifically if i have a JObject decendant class and in one procedure i want to use the addEventListener member of an instance of JEventTarget or a decendant and add an event calling another procedure or function of the same class. How do i do that? TIA
  23. Dany

    A humble request <rant>

    Chiper! I agree the RTL should be lean. Thanks for your anser. Reagrds, /Dany
  24. Hello! When you do a change like from this (2.1): function w3_getPropertyAsBool(tagRef: THandle; aPropName: String): Boolean; begin if tagRef then Result := tagRef[aPropName]; end; to this (2.2): function w3_getPropertyAsBool(const tagRef:THandle;const aPropName:String):Boolean; begin Result := tagRef[aPropName]; end; Please write about it IN BIG LETTERS. You are delivering Library code. You can not know how people are going to use it. This kind of change could create absolute havoc, especially if the functions affected are sparsely used. Thank you, /Dany
×
×
  • Create New...