Jump to content

Dany

Members
  • Content Count

    128
  • Joined

  • Last visited

Everything posted by Dany

  1. In W3c.HTML5 there's this definition: JHTMLOptionElement = class external 'HTMLOptionElement' (JHTMLElement) public disabled: Boolean; form: JHTMLFormElement; label: String; defaultSelected: Boolean; selected: Boolean; value: String; text: String; index: Integer; constructor Option(text: String); overload; external 'Option'; constructor Option(text, value: String; defaultSelected: boolean = false; selected: boolean = false); overload; external 'Option'; end; I try to construct an object, this is what i can get through the compiler: lSelectBox.add(JHTMLOptio
  2. Wow, warleyalex. That's scary. There's something really important that i've missed with ECMA. The only difference is that code in my OP translates to: lInfo.Other.length=0; and with your change it translates to lInfo.Other = []; which changes the behaviour!! In the start of the function the lInfo is initialized to a JS object using [] for the empty dynamic array. var lInfo = {Name$7:"",Other:[],Another:["","",""]}; Something for the compiler wizards to bite into? Regards, /D
  3. Warlayalex, IMHO that is a workaround, not a fix. Regards, /Dany
  4. I tried to copy the console output... makes it kind of self-explanatory. Let's try again: Info: Nice Record Other: Alien 1; Alien 2 Another: Static Buddy 1 Info: Evil Record Other: Alien 1; Alien 2 Another: Static Alien 2 I expected "Buddy 1" and "Buddy 2" on the first line. So when i do lInfos.Add(lInfo); the dynamic array is added by reference and the static is cloned/copied "properly". From the generated JS: /// RInfo = record /// [line: 31, column: 3, file: Unit1] function Copy$RInfo(s,d) { d.Name$7=s.Name$7; d.Other=s.Other; d.Another=s.Another.slice(0); retu
  5. I don't know if you caught this already. The DWScript repo is no use since i do not know what version whent into SMS Beta 5. type RInfo = record Name: string; Other: array of string; Another: array [0..2] of string; end; RInfos = array of RInfo; procedure TApplication.PopulateConsole; var lInfo: RInfo; lInfos: RInfos; begin lInfo.Name := 'Nice Record'; lInfo.Other.Clear; lInfo.Other.Add('Buddy 1'); lInfo.Other.Add('Buddy 2'); lInfo.Another[0] := 'Static Buddy 1'; lInfo.Another[1] := 'Static Buddy 2'; lInfo.Another[2] := 'Static Buddy 3'; lInfos.Add(lIn
  6. Norway is not an EU member. But that is usually not a problem as companies can sign for the EU VAT scheme anyway. However, the Gum-service fails to create invoices for me too. I've asked OS explicitly for invoice in the past to no avail. I'm simply hoping my local IRS doesn't want a full revision /D
  7. Even if things are fixed in days in DWScript we'd had to wait for the next beta of SMS, of course?
  8. Because otherwise (if not available) this post (http://smartmobilestudio.com/2014/06/04/giving-back-community/) would become a joke. Oh, and it (the post) does not mention that the JS codegen of DWScript was OpenSource when i first moved my technical debt to Optimale Systemer's IDE.
  9. Yes, i have seen the same thing. I posted an extensive report here back when but it might be one of those that disappeared. It's a bit confusing to se how the headers overload for a JObject and a TObject based solution. None of them works 100%. Anyway; on the creative side: If you need to add and remove handlers, with the current codegen, the best alternative (IMHO) is t use delegates. In your "constructor" or "initialize" assign a variable the procedure and use the variable to add and remove event handlers. It works, but as CW say, not beautiful. /D
  10. I have been thinking of trying to make a point of this for a very very long time. It's true for me too, it stops working completely after a while. Often you realize a typo "above" is the culprit, but i have to restart in order for these things to work too. This is my way of saying; the OP writeup is true and important. Reargards, /Dany
  11. @335: if assigned(FDefaultEventHandler) then Result.OnEvent(FDefaultEventHandler); if assigned(FDefaultPrepareHandler) then Result.OnEvent(FDefaultPrepareHandler); The second line should end with a call to OnPrepare, methinks. Regards, /Dany
  12. What about the case? When highlight are done (i like them) they convert the case of the marked text to that of the search. This is confusing, especially when searching among Variants.
  13. I have this new problem since beta 4 (i think). /Almost/ every other time i press Ctrl+F to search i get "Not Found". Next time the search works. And if i try to use the MRU list of the editbox (i.e. type only 3 letter) it never works. This is so annoying and it forces me to work max 2 hours with SMS because of "mouse arm shoulder". Now, if insight (Ctrl+click) would have worked i would not need to search so much. Anyone else suffering? Also, there's an abundance of "beeps" when using the search dialog - when you code fast that's confusing and kind of dangerous.
  14. I have had such a bad experience of the IDE that i wanted to install SMS on the "host" (i run all development in VMs) to see if some of the troubles stem from running it in a VM. So i downloaded "Professional" from the site. Installed and registered. Now; there's no "Check for Updates", there's no SmartUpdate.exe. And this is not 2.2 Beta 5. So i ran SmartUpdate in the program folder and that did not work at all because the places for binaries and RTL+ stuff. One is in Program Files (x86) and the other in Program Data (user/AppData) and that does not match with what i have in the VM and wh
  15. I'll keep that in mind from now on! I think i got rid of that stuff by fiddling with the Desktop settings. I guess i got hit badly because i had hidden all but the project explorer before the update.
  16. I could not keep the code changes, but i have revisited this issue (in a fuzzy way) and beta 5 seems to handle stuff!
  17. I asked for external records at version 1
  18. I have the same problems. The IDE AVs for me in a multitude of situations. I'm working in a VM and thus can not (will not) sent the Eureka reports since the policy of that machin is "no email". I guess the peak in AVs after the update might have to do with me hiding windows in the docking system.
  19. Sorry, but i have failed. I realized i get the error more often if i turn off smart linking. Then the problem started to give AVs in the linking phase. Tried the command line compile - same thing. It might have something to do with how the usits are set up here. I'll have to change the design to use TObject, ClassName and casts If i stumble upon more info, i'll post it here. /D
  20. Working with interfaces, i get Compilation failed [Failed to build project: Internal error. Code-generator threw exception EVariantTypeCastError with message Could not convert variant of type (Int64) into type (Unknown)] error And since it's late in the process i di not have much to go on. It went away in two cases; when i removed the interface name from the class declaration of a derived class. It also went away when i commented out a cast of Self as ISomeInterface. Any ideas? TIA, /Dany
  21. I so so agree! Chrstians writeup above is the first on constructing JS objects i've seen hithereto and i've asked too. Best Regards, /Dany
  22. The post made me write a (subjective) wish-list for 2016: Much, much better documentation of the compiler, the JS godegen and updates of the same Extensive tutorial(s) for creating headers and pascal wrappers - ultimately a tool too Better support for "tricking" code obfuscation, i.e writing JS libraries. Integration into Visual Studio Code (or Brackets) with project management, smsc build and a plugin for codeinsight, errorinsight and all that. A read-only support forum for non-registered users that registered users can use read-write. Moderated and watched by SMS-folks. This is important
×
×
  • Create New...