Jump to content


  • Content count

  • Joined

  • Last visited

About DavidRM

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Tulsa, OK

Recent Profile Visitors

106 profile views
  1. DavidRM

    Compilation Question: Format command

    That's what I was missing: resourcestring Now it compiles the way I expected: WriteLn(Format($R[37],[aUser$1.FHandle$6, aUser$1.FEmail, aPlayer$3.FSocket$1.RemoteAddress])); Thanks! -David
  2. Why is this: const RS_S_S_S_LOGGED_IN = '%s (%s, %s) logged in.'; ... Writeln(Format(RS_S_S_S_LOGGED_IN, [aUser.Handle, aUser.Email, aPlayer.Socket.RemoteAddress])); ... Compiling to this: WriteLn((aUser$1.FHandle$6.toString()+" ("+aUser$1.FEmail.toString()+", "+aPlayer$3.FSocket$1.RemoteAddress.toString()+") logged in.")); My thought was that by using Format() with constant strings, I would be reducing the string handling overhead. Was my thought incorrect? I also kinda wanted the possibility of (someday) localizing the text. This is not a bug. Just me trying to better understand what's happening in the conversion to Javascript. Thanks! -David
  3. ... if FSocketLUT.Contains(SocketID) then begin writeln("Found in name lookup!"); ... It's not major (at all). Just looks like some testing code that was left in. -David
  4. DavidRM

    TMemo-like Control with Colored Text?

    TW3ListBox looks like a good place to start. I'll be experimenting with that. -David
  5. I need something like a TMemo (or TW3Memo), but where each line can be assigned a different font color. That is, when you add a line of text, you also specify a color for the text. I don't need editing. Just a colorful scrolling display, with the ability to select and copy to the clipboard. Does something like this already exist in SMS? I'm not against rolling my own. If that's how it has to be, any hints or tips for how I might do that? Thanks! -David
  6. My attempt at a var didn't use the '=' character. I came up with a workaround that loads the table at runtime. I'll experiment with yours too. Thanks! -David
  7. Here's what I'm trying to do: procedure CommandChat(aCommand, aArgs: string); type TCommandProcedure = procedure (aCommand, aArgs: string); TCommandDispatch = record Command: string; CommandProc: TCommandProcedure; end; const CommandTable: array of TCommandDispatch = [ (Command: ';'; CommandProc: @CommandChat), (Command: 'chat'; CommandProc: @CommandChat) ]; Basically, declare a dispatch table. The compiler doesn't like it, gives me: Syntax Error: Constant expression expected [line: 32, column: 47, file: ...] It doesn't like the @CommandChat (with or without the @). Is there a way to declare a constant like this? Thanks! -David
  8. DavidRM

    Errors when working on my Node.JS server project

    Oddly enough, the problem has eased up, even without using the workaround. My speculation is that at least part of the problem has to do with a lot of open source file tabs and maybe some errors encountered in the background compilation. -David
  9. DavidRM

    Errors when working on my Node.JS server project

    Did none of the stacktraces sent as bug reports provide anything useful?
  10. DavidRM

    Errors when working on my Node.JS server project

    I found a workaround: I start SMS, load a different project, close it, then open the project I want to work on. Though I still get an error when closing SMS after that. -David
  11. At this point, I'm pretty much dead in the water. I cannot work on my Node.JS websocket server project without getting error after error. I've let the software email in a number of bug reports, but I figured I would post here too. Launch SMS, load my project, attempt a build (Ctrl+F9), I get this: EurekaLog 6.1.04 Exception: ------------------------------------------------------------------------------------------------------------- 2.1 Date : Wed, 1 Aug 2018 08:53:57 -0500 2.2 Address : 004088AA 2.3 Module Name : SmartMS.exe - (Smart Mobile Studio ID) 2.4 Module Version: 2.5 Type : EAccessViolation 2.6 Message : Access violation at address 004088AA in module 'SmartMS.exe'. Read of address 8B184795. 2.7 ID : 0894 2.8 Count : 1 2.9 Status : New 2.10 Note : I need a workaround so I can work around this. Thanks. -David
  12. DavidRM

    Post-Trial (and Post-Purchase) Feedback

    Thanks for the link. I'll check those out. -David
  13. DavidRM

    Post-Trial (and Post-Purchase) Feedback

    Oh. Thanks. =) That'll teach me to scour the UI for what I want and not just, you know, *KNOW*. ;-) Today I had what I've started calling a "Typical SMS Moment." I went looking for a TNotebook or TPageControl component. And found one in the RTL (SmartCL.PageControl). That's about "mostly" finished. <sigh> Still, it was there. And I didn't have to build it from the ground up. -David
  14. So my 35-day trial period ended today. A day early, for some reason. It's like SMS saw one last chance to annoy me. I bought it anyway. =) I bought the Professional edition for the same reason I used up all 35-but-1 days of my trial period: I see a lot of potential in Smart Mobile Studio. I needed a way to "go mobile" and SMS made that possible without the headache of learning/using 100% Javascript. I have nearly 30 years of Pascal programming experience, so being able to leverage that--while still having access to Javascript when I need it--has been incredibly helpful. That ability to easily (ish) intermingle Object Pascal and Javascript is a big part of what I like about SMS. I'm looking forward to the upcoming update. I hope it doesn't take too long to get here, and I hope it fulfills more of SMS's potential--and addresses some of the issues I've bumped into. The KEY #1 DEAR GOD REALLY? issue is the dearth of useful documentation. By way of the very-outdated "A Smart Book", the thin (but helpful) community of the forums, extensive review of the RTL (after I found it) and the accompanying demos ... it was still a lot of trial and error. The trial and error to get Cordova working was especially painful. I learned to program in the 80's without integrated debugging. So I can function without it, and make up the difference with Chrome Developer Tools when I have to. I would much rather have integrated debugging, though, than not have it. The form designer is better than nothing. I use it primarily to toss components onto a form or panel, then arrange them mostly by hand and layout manager. I have learned to hate the layout manager, but also to make it work. Mostly. I have been frustrated by the lack of depth in the RTL and by how many things required roll-your-own efforts. Of course, some of this is part of the documentation issue, because the RTL doesn't suck. I've learned to consider Javascript libraries as almost-available third-party components. I've learned a helluvalot about writing wrappers for Javascript libraries (cryptography, Sqlite, compression). I've even learned more about Javascript. I wouldn't have come as far as I have without warleyalex's wrapper for promises. I still don't know what's all that different from the ECMA.Promises unit in the RTL, but his version works great and I use it extensively. I think I even understand promises pretty well now. I've referred back to his tip-of-the-day post many times (including yesterday). Number n + 1 on my wish list (after better documentation, integrated debugging, a real form designer, ...) is a way to right-click and "Find Declaration". I really miss that now that my units are getting longer (as they do). Yes, the side-panel with the structure helps. Some. When I first started playing with SMS, I told a friend of mine about it. She's been making progress with her particular project, as well. Since I was a week ahead of her, I have been able to help (some) with the documentation issue. Her project is totally different from mine, though, so there hasn't been much overlap. She'll probably purchase the Professional edition soon too. So, yeah, I like Smart Mobile Studio for its flexibility and potential. I'm in for at least the next year. =) -David
  15. DavidRM

    Stanford Javascript Crypto Library Wrapper for SMS

    If you want to use AES-CTR, you will need to download the ctr.js file from the SJCL github page, then add this line to SJCL.pas: {$R "ctr.js"} (I minified my copy of ctr.js here.) And, should you then want to decrypt what's encoded with SJCL in Delphi using SynCrypto.pas (which might have been the reason you switched from GCM to CTR; that is, SynCrypto doesn't have an AES-GCM implementation), you will need to derive your own TAESCTR class to change how the counter is implemented. Like this: uses SynCommons, SynCrypto; type TSjclAESCTR = class(TAESAbstractEncryptOnly) public /// perform the AES cypher in the CTR mode procedure Encrypt(BufIn, BufOut: pointer; Count: cardinal); override; /// perform the AES un-cypher in the CTR mode procedure Decrypt(BufIn, BufOut: pointer; Count: cardinal); override; end; procedure TSjclAESCTR.Decrypt(BufIn, BufOut: pointer; Count: cardinal); begin Encrypt(BufIn, BufOut, Count); // by definition end; procedure TSjclAESCTR.Encrypt(BufIn, BufOut: pointer; Count: cardinal); var i,j: integer; tmp: TAESBlock; begin if fAESInit<>initEncrypt then EncryptInit; inherited; // CV := IV + set fIn,fOut,fCount for i := 1 to Count shr 4 do begin {$ifdef USEAESNI64} if TAESContext(AES.Context).AesNi then AesNiEncrypt(AES.Context,fCV,tmp) else {$endif USEAESNI64} AES.Encrypt(fCV,tmp); // SJCL uses the last 32-bit word of the CV as the counter inc(fCV[15]); if fCV[15]=0 then begin j := 14; repeat inc(fCV[j]); if (fCV[j]<>0) or (j=0) then break; dec(j); until false; end; XorBlock16(pointer(fIn),pointer(fOut),pointer(@tmp)); inc(fIn); inc(fOut); end; Count := Count and (AESBlockSize-1); if Count<>0 then begin {$ifdef USEAESNI64} if TAESContext(AES.Context).AesNi then AesNiEncrypt(AES.Context,fCV,tmp) else {$endif USEAESNI64} AES.Encrypt(fCV,tmp); XorBlockN(pointer(fIn),pointer(fOut),@tmp,Count); end; end; I now have a much deeper understanding of how AES is implemented. My thanks to both the SJCL team and Synopse. =) -David