Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

15 Good

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mark-

    Prevent from closing when....

    Thanks for the response "Rollo62", interesting. "Uwe Raabe" thank you. I will check it out.
  2. Mark-

    Prevent from closing when....

    Thanks for the response "Kas Ob.". This issue is not about the application closing. These form A come and go in a 24/7 program. The possible changes are limited to the areas I mentioned, in form A. The user designs/creates/codes/uses/etc. these form A. We provide the IDE and execution of the user created form A inside the main program, like an add on, along with other user configurable features. Large changes to a huge program for one issue with the form A, that was actually found by destructive testing, a user in 14 years has never created the issue, is not prudent/practical/etc. Again, thanks for the reply.
  3. Mark-

    Prevent from closing when....

    Perhaps I can get the foreground window, check it for modal and if so prevent form A from closing in FormCloseQuery. Tomorrow.
  4. Mark-

    Prevent from closing when....

    Hello, Delphi 10.2.3, VCL Might seem simple but I have not run into this issue and have limits on what changes I can make. Form A is opened containing one button. The button opens a modal dialog, form B, displaying a message. Before the user can close form B, another part of the program posts a close message to form A and it closes. The user closes form B, leading to a crash. Setting a flag to indicate a modal dialog has been opened to prevent form A from closing is not possible. That would be a big change. Users design the screens and run script, etc. I can change the FormCloseQuery, FormClose and FormDestroy of form A. Finding what to check in the form properties/methods has produced no joy. Forest for the trees might be present. Any ideas? Thanks, Mark
  5. Mark-

    Return an array from a function??

    Couple of ways to accomplish it, One simple method. type TVariantArray = array of variant; function Foo(data:byte):TVariantArray; begin SetLength(result,2); result[0]:=data + 123; result[1]:='ABCD'; end; procedure FooTest; var res:TVariantArray; begin res:=Foo(1); ShowMessage(IntToStr(res[0]) + ' ' + res[1]); end;
  6. Mark-

    Enbedded editor, debugging, etc...

    We are looking to add Python, not replace TMS scripter. Thanks for your opinion.
  7. Mark-

    Enbedded editor, debugging, etc...

    Thanks for the response. >Do you really need the IDE embedded in your application or could you treat it as a remote execution / debug scenario? Embedded. >Which code, Delphi or the Python script, do you need the user to be able to watch / step into? Python. Just like we do with TMS Scripter. >Could you use PY4D to host the interpreter and then remote attach to it with the IDE? I have not used PY4D. Is this different from the first question?
  8. Mark-

    Enbedded editor, debugging, etc...

    Thanks for the response. Are you saying the examples demonstrate an IDE, with debugging, breakpoints, stepping through Python code, variable examination, etc.?
  9. Hello, We use TMS Scripter (Pascal) to allow our customers to execute custom logic on data. Embedded editor, breakpoints, stepping, variable watches, etc. are included. Looking at providing Python and how to provide the same features. PyScripter seems to provide all or part but, I do not see any path to embed PyScripter in our application. How do you guys, using Python4Delphi, provide an IDE? Thanks, Mark
  10. Negative numbers are not passed to the function. The example is perfectly legit. Exceptions do occur.
  11. I guess I am missing something. Perhaps I need more sleep. if IsInRangeEx(5,10,20) then beep;
  12. Mark-


    Never mind. I found the issue. A missing @buffer[0] in some packet generation code.
  13. Hello, Perhaps it is late and I am not seeing the forest for all the trees. Is there a way to use TWSocket.SendTo with a dynamic array? Thanks, Mark
  14. type TMyFunkyRecord = record b:boolean; end; function Something(inB:pointer):pointer; var bRec:TMyFunkyRecord; begin bRec:=TMyFunkyRecord(inB^); if bRec.b then beep; bRec.b:=false; result:=@bRec; end; var bRec,aRec:TMyFunkyRecord; begin bRec.b:=true; aRec:=TMyFunkyRecord(Something(@bRec)^); if not aRec.b then beep; end; You can make it work with "naked" pointers. More trouble than worth to avoid declaring the pointer type. My2c.