Jump to content

JohnLM

Members
  • Content Count

    288
  • Joined

  • Last visited

Everything posted by JohnLM

  1. JohnLM

    Delphi 11.3 : FORSAKEN

    @ jonnyg - you are correct. I got side-tracked. The days of doing a fresh install on that win7 laptop are long gone now. I have too many large apps installed and other complicated issues that prevent me from doing that and is also the reason I have another laptop or two. They are all win10. I will eventually replace this laptop with one of those. I'm just not ready nor in any rush to make that happen as yet.
  2. JohnLM

    Delphi 11.3 : FORSAKEN

    @ jonnyg - I have a Windows 10 laptop 64GB (eMMC) and 4GB of ram, and with Delphi 11.2 installed and running fine. I had stopped using it because it ran down my remaining hdd (eMMC) space down to about 400mb, but recently I learned that I regained some of it back and now have 2.5GB space left, more than enough to continue my small casual Delphi hobbies. I use my win7 laptop as my main workstation. It has XE7 and D11.2 on it. I sometimes run both side-by-side when necessary. I have no problems with D11.2, except for that recent rare occasion I just mentioned in my previous post.
  3. JohnLM

    Delphi 11.3 : FORSAKEN

    Specs: Delphi 11.2, Win7 My experience thus far with D11.2 under Win7. . . I have worked in Delphi for many years. I can't remember ever having the IDE crash (or freeze) on me, ever until I started working with Classes and Generics. Granted, I am new to that area. But we all have to start somewhere, and crashes/freezes will happen when using advanced areas of coding. Now that I am in the classes and generics area of programming I am finding that the IDE will crash or freeze often, though mostly in access violation territory while closing the app as I learn, etc. For example, yesterday while testing some code, the IDE froze and was unresponsive. And I could not close down the faulty app in Task Manager. After 10 minutes of frustration, I learned that the DSP had crashed (it was showing 25% usage on my win7 laptop in Task Manager--the 25% CPU value is the default value for when an app or something for that matter has crashed or become unresponsive) I could not do anything in Delphi and/or the App in question until I killed the process for the DSP. Then, I had to shut down Delphi and reload that project. in my unique case, I discovered that Delphi 11.2 no longer works properly with the Class/Generic app I was working with. It constantly crashes with access violations. In order to resolve this, I have to shut down my laptop completely. It would not be such a problem if my laptop did not take 40 minutes to boot up--a situation that I have not been able to figure out how to resolve.--it used to boot up in under a minute when brand new. I don't know where nor when exactly this long boot-up started. Anyway. So crashes like this I can't afford to have with a 40-minute bootup every time I encounter this sort of major Delphi crash. But this type of crash is difficult to document exactly how it happens in Delphi.
  4. Yes, this is for process and learning. I am learning about how to build Classes and Generics, and this idea came to me and I went with it to see how far I would get.
  5. Ah, I knew about the 'not' and used it in similar situations but not used often enough to remember exactly in this case.
  6. I learned something new. This works as described..,, minimal code and easy to follow. I added an addition in case I were to want a toggle type set of on/off controls for certain situations, but slightly more code: for var btn in [Button1, Button2, Button3, Button4, button5] do if btn.Enabled = true then btn.Enabled:=false else btn.Enabled:=true;
  7. I don't know if the OP (or anyone else) are aware of this website for checking files/URL's for nasties, but I use it a lot. It uses many vendors. It might be useful for others here. http://www.virustotal.com/ So, I just uploaded a test file I compiled in Delphi 11.2 to this site to see the results I would get. It reported 2/62 or 2 out of 62 scans and reported the results, below.
  8. In Delphi 11.2, you can change the ComboBox dropdown width using: .DropDownWidth := width, but it is also in the Object Inspector window. And, .AutoDropDownWidth is a boolean, and also in the Object Inspector window. If true, then the width of the cbx will be whatever is the largest text inside the dropdown. When set to false (which is its default), the standard default width is used.
  9. JohnLM

    How can I get this code formatting ?

    I prefer my nested if/then/else code in this block format as this gives me the least ripples=visual noise, and I have done the same with for/loops, since the days of old (Delphi 6 and earlier). procedure begin if condition then begin ... ... end else begin ... ... end; end; procedure begin if condition then begin ... ... end else if condition then begin ... ... end; end; procedure var r,c: integer; begin for r:=1 to 10 do begin ... ... for c:=1 to 100 do begin ... ... end; ... ... end; end;
  10. I have been searching via google but not turned up any answer to this. 1. Say I have multiple files of similar text and I save them. 2. Then, when I load (or open) any of those text files in TMemo, I want to maintain the last screen layout (line) within the dimensions. I am comparing structures of column (hex/ascii) data in these text files and if I am in the middle of the file in the tmemo and I decide to load another file to quickly compare back/forth with, I want the layout the remain the same but not start from the top of the text file. I know I have to save the last topmost line in a variable but I don't know how to go further in this. TIA. Fig A - this is the layout that opens by default for every load. But I want Fib B if I am scrolling down and stop and decide to load another file. Fig B - if I open at the last layout position this is what I want to see.., not Fig A.
  11. Hi. I had found something that works (but does not account for the cursor at this time) but had not the time to post back how I did it. But I will read/consider your method as a possible option, thank you. The method that I have been testing is below. I have a [Load] button that loads streams that I save using the sfBinary format of TStream/TMemoryStream. var form1: TForm1; topline: integer=0; ... procedure TForm1.btnLoadClick(Sender: TObject); begin if mem1.Active then begin mem1.LoadFromFile(txtFilename.text,sfjson); // store the top line of memo into global var on load TopLine := memo1.Perform(EM_GETFIRSTVISIBLELINE, 0, 0); end; btnbufArray.Click; // process array into hex and ascii code and show in memo1 // now, if at any time I was in the memo and scrolling up/down and TopLine > 0 then I update the memo's viewing position. if TopLine > 0 then begin SendMessage(memo1.Handle, EM_LINESCROLL, 0, TopLine); end;
  12. I am a beginner just learning a few things about Stream, how to Write and Read from it. For instance, given the code snippet below, I can write and read a text string into a TEdit. This is bare basic without Try/Finally. * code snippet extracted from one of my projects. var s: string; procedure TForm1.btnStrToStreamClick(Sender: TObject); // save/write to a stream begin s := 'this is a test.'; strmSize := length(s); // 15 chars strm.Write(s, strmSize); end; procedure TForm1.btnStrmToStringClick(Sender: TObject); // load/read into a tedit control begin strm.Read(s, strmSize); // read back the 15 chars eb2.Text := s; // show in tedit control end; I was wondering how FireDAC's tmemtable stores the data when the user uses the memtable.SaveToStream method. I am asking because I would like to Paste some data into a dbgrid. I don't mean to past it directly into the dbgrid. I mean to pass the data in the clipboard into a stream that a TMemTable can deal with via Streams. A lot of times when I have various sources that I copy/select from (web page selections, notepad, excel, ms access, etc.) and I would like to just Paste it into a dbgrid via the database memtable The process flow would go something like this: (selected data -> clipboard -> [custom format/structure for dest] -> a stream -> database -> viewing control ie dbgrid) So, I would like to know if anyone knows what the structure used in the .SaveToStream is, so that I can build the same and send the clipboard contents over to it.
  13. A few minutes after my post above, I made the discovery of the cause of slowness. Next, I will look into figuring out how to time the output speed in seconds or ms when I figure that out. I want to show that as part of a process time somewhere in the output window. Then, I can test the efficiency of various ideas. Anyway, to explain the slowness.. In this line below, in the inner for/loop, I was testing some values and forgot to remove those part(s) of code after inc(index); I REM them out as seen below, and the output is now instant. Those code fragments were two TStaticText controls that I was using to debug the index counts I was having trouble with. TStaticText displays values without interruption while TMemo updates in real-time during for/loops. If I use plain TEdit controls, then the updates display at the end of the TMemo updates. So, I don't use tedit's for this purpose during debugging real-time outputs. for row do. . for col do. . inc(index); //st1.Caption := inttostr(index); st2.Caption := inttostr(x); // col // row (I am going to branch this hex dump feature into another separate project--will call it HexdumpViewer or something--and will add some other interesting ideas to it. I have a few already and want to try them out soon.) I will look at your other ideas/suggestions, thanks.
  14. Thank you for your positive feedback. I failed to mention and add another bullet, to describe the field values showing in the above-posted hex dump output, the values (AAAAA, BBBBB, CCCCC), this was the data I stored inside the dbgrid that I .SaveToStream and then copied all its content into the bufArray variable for processing. The one CON I see in this hex dump feature is that it is slow. The method I used to process and then update the memo control is quite slow, about 1.25 secs to go through a 1.3k to 1.5k byte array to show the hex dump data. This includes using the .beginupdate and .endupdate settings. In order to show a clean output, I am using several functions: PadZero(N: longint; Len: integer): string; -- show 0000, 0001, 0999, ... etc ByteToIntChar(b: byte): char; -- shows ascii 32..126 chars PadSpaceRt(s: string; Len: integer): string; -- aligns the ascii char pain The above gets processed in the inner for-loop: (for row do.., for col do..) But at least it works, and that is what matters.
  15. Update on this project endeavor. . . RE: creating a Hex Dump feature - Reading stream data and converting to a hex-dump output. I finally managed to get this bare-bones of a hex-dump feature added to this test app as part of this project, where I am trying to figure out if it's possible to obtain the data behind or inside the memtable's stream and then be able to read/write back and forth data to the stream. I struggled with this output shown below. I had trouble understanding ASCII and printable chars based on raw data as seen below. I searched for several days on the ASCII code and Code Page and Unicode, and so on. To be honest, I still do not fully understand it all but I only wanted to get a display like the one shown below. 1 - 0015 through 1217 is the Byte position in row number format, in steps of 16 bytes into the stream and is representative of the size of the stream (from TMemTable), or strm.size; 2 - first line, and so on down the list, -- 41..00 is the conversion from Byte to Hex 3 - first line, and so on down the list, -- "ADBS...." is the char representation. 4 - the dots "." that you see are supposedly non-printable chars 5 - the TMemTable's is connected to a dbgrid. The grid has 4 fields: (IMS, ItemNo, Category, Vendor) - those fieldnames are showing in the hex dump below. This data is pulled from the memtabl's stream and processed. note: I did the best I could in the time frame I have currently in creating this feature. And, please don't expect it to follow any standard hex dump editor perfectly. I have not compared it to any of those as yet. But for something like this, its a first-time for me without blueprints or someone else's code. 0015: 41 44 42 53 10 00 00 00 06 02 00 00 FF 00 01 00 - ADBS............ 0031: 01 FF 02 FF 03 04 00 08 00 00 00 6D 00 65 00 6D - ...........m.e.m 0047: 00 31 00 05 00 08 00 00 00 6D 00 65 00 6D 00 31 - .1.......m.e.m.1 0063: 00 06 00 00 00 00 00 07 00 00 08 00 32 00 00 00 - ............2... 0079: 09 00 00 FF 0A FF 0B 04 00 06 00 00 00 49 00 4D - .............I.M 0095: 00 53 00 05 00 06 00 00 00 49 00 4D 00 53 00 0C - .S.......I.M.S.. 0111: 00 01 00 00 00 0E 00 0D 00 0F 00 01 10 00 01 11 - ................ 0127: 00 01 12 00 01 13 00 01 14 00 01 15 00 06 00 00 - ................ 0143: 00 49 00 4D 00 53 00 FE FF 0B 04 00 0C 00 00 00 - .I.M.S.......... 0159: 49 00 74 00 65 00 6D 00 4E 00 6F 00 05 00 0C 00 - I.t.e.m.N.o..... 0175: 00 00 49 00 74 00 65 00 6D 00 4E 00 6F 00 0C 00 - ..I.t.e.m.N.o... 0191: 02 00 00 00 0E 00 16 00 17 00 14 00 00 00 0F 00 - ................ 0207: 01 10 00 01 11 00 01 12 00 01 13 00 01 14 00 01 - ................ 0223: 15 00 0C 00 00 00 49 00 74 00 65 00 6D 00 4E 00 - ......I.t.e.m.N. 0239: 6F 00 18 00 14 00 00 00 FE FF 0B 04 00 10 00 00 - o............... 0255: 00 43 00 61 00 74 00 65 00 67 00 6F 00 72 00 79 - .C.a.t.e.g.o.r.y 0271: 00 05 00 10 00 00 00 43 00 61 00 74 00 65 00 67 - .......C.a.t.e.g 0287: 00 6F 00 72 00 79 00 0C 00 03 00 00 00 0E 00 16 - .o.r.y.......... 0303: 00 17 00 14 00 00 00 0F 00 01 10 00 01 11 00 01 - ................ 0319: 12 00 01 13 00 01 14 00 01 15 00 10 00 00 00 43 - ...............C 0335: 00 61 00 74 00 65 00 67 00 6F 00 72 00 79 00 18 - .a.t.e.g.o.r.y.. 0351: 00 14 00 00 00 FE FF 0B 04 00 0C 00 00 00 56 00 - ..............V. 0367: 65 00 6E 00 64 00 6F 00 72 00 05 00 0C 00 00 00 - e.n.d.o.r....... 0383: 56 00 65 00 6E 00 64 00 6F 00 72 00 0C 00 04 00 - V.e.n.d.o.r..... 0399: 00 00 0E 00 16 00 17 00 14 00 00 00 0F 00 01 10 - ................ 0415: 00 01 11 00 01 12 00 01 13 00 01 14 00 01 15 00 - ................ 0431: 0C 00 00 00 56 00 65 00 6E 00 64 00 6F 00 72 00 - ....V.e.n.d.o.r. 0447: 18 00 14 00 00 00 FE FE FF 19 FE FF 1A FE FF 1B - ................ 0463: FF 1C 1D 00 00 00 00 00 FF 1E 00 00 01 00 00 00 - ................ 0479: 01 00 05 00 00 00 41 41 41 41 41 02 00 05 00 00 - ......AAAAA..... 0495: 00 42 42 42 42 42 03 00 05 00 00 00 43 43 43 43 - .BBBBB......CCCC 0511: 43 FE FE FE FE FE FF 1F FE FF 20 21 00 02 00 00 - C........ !.... 0527: 00 FF 22 FE FE FE 0E 00 4D 00 61 00 6E 00 61 00 - ..".....M.a.n.a. 0543: 67 00 65 00 72 00 1E 00 55 00 70 00 64 00 61 00 - g.e.r...U.p.d.a. 0559: 74 00 65 00 73 00 52 00 65 00 67 00 69 00 73 00 - t.e.s.R.e.g.i.s. 0575: 74 00 72 00 79 00 12 00 54 00 61 00 62 00 6C 00 - t.r.y...T.a.b.l. 0591: 65 00 4C 00 69 00 73 00 74 00 0A 00 54 00 61 00 - e.L.i.s.t...T.a. 0607: 62 00 6C 00 65 00 08 00 4E 00 61 00 6D 00 65 00 - b.l.e...N.a.m.e. 0623: 14 00 53 00 6F 00 75 00 72 00 63 00 65 00 4E 00 - ..S.o.u.r.c.e.N. 0639: 61 00 6D 00 65 00 0A 00 54 00 61 00 62 00 49 00 - a.m.e...T.a.b.I. 0655: 44 00 24 00 45 00 6E 00 66 00 6F 00 72 00 63 00 - D.$.E.n.f.o.r.c. 0671: 65 00 43 00 6F 00 6E 00 73 00 74 00 72 00 61 00 - e.C.o.n.s.t.r.a. 0687: 69 00 6E 00 74 00 73 00 1E 00 4D 00 69 00 6E 00 - i.n.t.s...M.i.n. 0703: 69 00 6D 00 75 00 6D 00 43 00 61 00 70 00 61 00 - i.m.u.m.C.a.p.a. 0719: 63 00 69 00 74 00 79 00 18 00 43 00 68 00 65 00 - c.i.t.y...C.h.e. 0735: 63 00 6B 00 4E 00 6F 00 74 00 4E 00 75 00 6C 00 - c.k.N.o.t.N.u.l. 0751: 6C 00 14 00 43 00 6F 00 6C 00 75 00 6D 00 6E 00 - l...C.o.l.u.m.n. 0767: 4C 00 69 00 73 00 74 00 0C 00 43 00 6F 00 6C 00 - L.i.s.t...C.o.l. 0783: 75 00 6D 00 6E 00 10 00 53 00 6F 00 75 00 72 00 - u.m.n...S.o.u.r. 0799: 63 00 65 00 49 00 44 00 0E 00 64 00 74 00 49 00 - c.e.I.D...d.t.I. 0815: 6E 00 74 00 33 00 32 00 10 00 44 00 61 00 74 00 - n.t.3.2...D.a.t. 0831: 61 00 54 00 79 00 70 00 65 00 14 00 53 00 65 00 - a.T.y.p.e...S.e. 0847: 61 00 72 00 63 00 68 00 61 00 62 00 6C 00 65 00 - a.r.c.h.a.b.l.e. 0863: 12 00 41 00 6C 00 6C 00 6F 00 77 00 4E 00 75 00 - ..A.l.l.o.w.N.u. 0879: 6C 00 6C 00 08 00 42 00 61 00 73 00 65 00 14 00 - l.l...B.a.s.e... 0895: 4F 00 41 00 6C 00 6C 00 6F 00 77 00 4E 00 75 00 - O.A.l.l.o.w.N.u. 0911: 6C 00 6C 00 12 00 4F 00 49 00 6E 00 55 00 70 00 - l.l...O.I.n.U.p. 0927: 64 00 61 00 74 00 65 00 10 00 4F 00 49 00 6E 00 - d.a.t.e...O.I.n. 0943: 57 00 68 00 65 00 72 00 65 00 1A 00 4F 00 72 00 - W.h.e.r.e...O.r. 0959: 69 00 67 00 69 00 6E 00 43 00 6F 00 6C 00 4E 00 - i.g.i.n.C.o.l.N. 0975: 61 00 6D 00 65 00 18 00 64 00 74 00 41 00 6E 00 - a.m.e...d.t.A.n. 0991: 73 00 69 00 53 00 74 00 72 00 69 00 6E 00 67 00 - s.i.S.t.r.i.n.g. 1007: 08 00 53 00 69 00 7A 00 65 00 14 00 53 00 6F 00 - ..S.i.z.e...S.o. 1023: 75 00 72 00 63 00 65 00 53 00 69 00 7A 00 65 00 - u.r.c.e.S.i.z.e. 1039: 1C 00 43 00 6F 00 6E 00 73 00 74 00 72 00 61 00 - ..C.o.n.s.t.r.a. 1055: 69 00 6E 00 74 00 4C 00 69 00 73 00 74 00 10 00 - i.n.t.L.i.s.t... 1071: 56 00 69 00 65 00 77 00 4C 00 69 00 73 00 74 00 - V.i.e.w.L.i.s.t. 1087: 0E 00 52 00 6F 00 77 00 4C 00 69 00 73 00 74 00 - ..R.o.w.L.i.s.t. 1103: 06 00 52 00 6F 00 77 00 0A 00 52 00 6F 00 77 00 - ..R.o.w...R.o.w. 1119: 49 00 44 00 10 00 4F 00 72 00 69 00 67 00 69 00 - I.D...O.r.i.g.i. 1135: 6E 00 61 00 6C 00 18 00 52 00 65 00 6C 00 61 00 - n.a.l...R.e.l.a. 1151: 74 00 69 00 6F 00 6E 00 4C 00 69 00 73 00 74 00 - t.i.o.n.L.i.s.t. 1167: 1C 00 55 00 70 00 64 00 61 00 74 00 65 00 73 00 - ..U.p.d.a.t.e.s. 1183: 4A 00 6F 00 75 00 72 00 6E 00 61 00 6C 00 12 00 - J.o.u.r.n.a.l... 1199: 53 00 61 00 76 00 65 00 50 00 6F 00 69 00 6E 00 - S.a.v.e.P.o.i.n. 1215: 74 00 0E 00 43 00 68 00 61 00 6E 00 67 00 65 00 - t...C.h.a.n.g.e. 1217: 73 00 - s.
  16. I had other questions but am pressed for time for work. But real quick. I see TMemoryStream has .Clear and TStream do not. Is there a similar way to clear streams when using TStream ? In this learning portion of streams and in the test app I am using in this topic, I have been using the following setup: var strm: TStream; // <-- memstrm: TMemoryStream; ... ... procedure tform1.FormCreate... begin strm: TMemoryStream.Create; // <-- memstrm: TMemoryStream.Create; end; ... procedure clearmem; begin MemStrm.clear; // reset to nothing and start over strm. ? // end; ... procedure TForm1.FormDestroy(Sender: TObject); begin strm.Free; memstrm.Free; end; TIA
  17. Thanks Peter. You helped to clear up a few things. I remember you and a few others from TeamB from the days of old, back in the 90's/2000's, seeing your many replies. I always wondered about the origin of TeamB, you know, how it came to be and all. You guys were everywhere, at least in my Yahoo and Google searches in those days. I learned a lot and also forgot a lot, LOL. I had many personal life matters that took over my Turbo Pascal and Delphi hobbies and left me on many programming hiatuss over the years.
  18. I was wondering if anyone knows how to completely turn off auto updates in windows 10. I have the HP Stream 14" 64bit, 4GB Ram, Intel Celeron N4020 laptop from Oct/2021. (Hint: I have removed the "S" part from Windows 10) (link https://www.walmart.com/ip/HP-14-PC-Laptop-Intel-Celeron-N4000-4GB-RAM-64GB-HD-Windows-10S-with-1-year-Office-365-Blue-14-cb171wm/803600781?from=/search) Currently, there is an update(s) in cache waiting for me to update-and-shut down, but I keep refusing it and choose sleep. Eventually, I will have to shut down for other reasons but I would like to turn off updates if possible, including the update in cache. I would like to use this for part-time coding in Delphi 11.2 since I have that already installed since 11/2023. TIA.
  19. I usually work in low light and it gets a little difficult sometimes to see certain characters when using the dark theme for the IDE. (Some of the colored fonts like blue/red/green get fuzzy looking under my laptop's 1366x768 screesize) I thought it would be a quick and simple method of Ctrl+Wheel-up/down, but that did not work. Is there a quick shortcut to enlarge/decrease the font at will? TIA.
  20. I want to delete many of my Messages on my Android phone, but I'd like to save the text someplace before I do that. Is there a way that I can save them? How would I do that? TIA
  21. Sorry, I lost this topic and just found it. I meant, for Android, when you click on the Message [...] icon at the bottom, to type a text message to someone who's phone number you have. You enter their phone number to create a new contact if not already there, and you begin texting back and forth to that person in Messages. I want to copy all the messages in each contact that I have had text conversations with, but there is no Select-All, just Copy Text, where you have to long-press on a single message and a pop-up menu shows 'copy text' or 'copy to SIM card'. but it only copies that one text message, not all the messages. If I could select-all the text and copy it to the clipboard and then send that to my laptop via app-tethering, now that I have that working.
  22. @stano - this works-thanks, if I shrink the left side pane area for the Object Inspector using the mouse, but I do have to play a bit with it every time I adjust it in order to see the - and + slider. I am still looking for a keyboard shortcut.
  23. No overlay. I have the Dell Inspiron 5520 15R laptop. It is the one with the (home/pgup/pgdn/end) keys on the right side.
  24. SPECS: Delphi 11.2, Galaxy S10+ phone (Android 12) (screen size is 6.4 inches) Issue: I want to change the view in the IDE to match my phone but the closest one is the 'Android 5" phone', and when I add componets on the form in that view, after compiling, the controls don't fit the screen and/or are sometimes off the view of the screen. In Delphi XE7, in the View's drop-down list, there is a custom setting option. I think I only used it once for a tablet years ago, but could not figure it all out and gave up. However, in 11.2, there is no listing for custom. So, I was wondering if there are downloadable views, or does the developer has to figure it out manually by eye/try. I've been searching around but cannot find any answers. TIA.
  25. update. . . regarding the pixel dimensions for the screen size. It appears that the 567x1008 pixels is correct for that Galaxy S10+ Android phone. And, it is 390x520 on the Galaxy A10 Android phone. Now I can move forward in this project. Thanks for all the help/tips/etc., thus far.
×