<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>It’s not a snippet, that’s the entire thing.   It’s pretty simple, just a sequential set of events to fix a file.  It would be a great help if you could get me an example of how to make this work.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>James<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> fpc-pascal <fpc-pascal-bounces@lists.freepascal.org> <b>On Behalf Of </b>Ralf Quint<br><b>Sent:</b> Saturday, November 3, 2018 5:57 PM<br><b>To:</b> fpc-pascal@lists.freepascal.org<br><b>Subject:</b> Re: [fpc-pascal] Windows programming tutorials for FPC<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On 11/3/2018 1:20 PM, James wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='margin-bottom:12.0pt'>>And you can't just pop up a dialog window without having a window/form in the first place.  <o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>That’s probably my problem…  My idea of just calling up the windows-API to get the save-as dialog probably won’t work without a form, even though I was able to get message boxes working<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><br>>In general, the logic of a GUI based program (regardless if Windows, macOS, Linux, etc) simply is different from a console program. Your console program main loop simply  pretty much just becomes a procedure within the GUI main loop.<br><br><br><o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>This logic difference is what is most confusing to me.   I just don’t know where to put my main program and I don’t know how to output things to some kind of text box.   I don’t want the user to do anything at all unless it’s necessary… so if everything is set up correctly, the program opens, does it’s thing, writes some status stuff to a text box and closes,  no buttons to push or anything…. If I get a GUI program to work, I guess I can put a percentage complete barograph somewhere.  If there’s an error, I need to stop and wait for acknowledgement of the error, or if the output file was not specified, I want the Save-As box to just open up on it’s own with out anyone pushing any buttons, and when the save-as box is closed the process completes on it’s own and the program exits without any further user intervention. <o:p></o:p></p></blockquote><p class=MsoNormal>I had that problem many years ago as well, having literally written hundreds of console of TUI based programs, mainly on DOS, myself. And then switching some of them to a GUI program in Delphi (there was no Lazarus at that time) took quite a bit of rethinking of  a couple of decades habits in console/command line ways or even self written TUI programs.<br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='margin-bottom:12.0pt'>I’ve been tinkering with Lazarus, and I managed to get a form with some buttons based on the examples, and I did make one button open the save-as box… but I’m clueless on how to make the save-as box only come up when needed and by a programming command, not because someone pushed a button.  I still can’t figure out how to write my writeln’s into a text box of some sort.    I get the idea… instead of a sequential program the executes from beginning to end,  everything kind of all happens at the same time<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></blockquote><p class=MsoNormal style='margin-bottom:12.0pt'>Yup, all the windows (as in GUI) stuff happens all the time, at the same time as your actual program. I have no had a program myself where I had a dialog "come up out of the blue" (as you kind of describe it), but I have written a lot of data conversion programs that at some point required to open up an additional open or save dialog. A lot though depends on what the actual logic behind the actual processing of your console program is. A lot of times, it might take a bit of re-organizing.<br>I am a bit short of time, as I am dealing on and off all day with some CERT stuff, but I will see that I take a closer look at that program (snippet?) that you posted later today or tomorrow morning  and return a rough sample of a GUI "solution" for it...<br><br>Ralf<o:p></o:p></p><p><o:p> </o:p></p><div id=DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2><p class=MsoNormal><o:p> </o:p></p><table class=MsoNormalTable border=1 cellpadding=0 style='border:none;border-top:solid #D3D4DE 1.0pt'><tr><td width=55 style='width:41.25pt;border:none;padding:9.75pt .75pt .75pt .75pt'><p class=MsoNormal><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon" target="_blank"><span style='text-decoration:none'><img border=0 width=46 height=29 style='width:.4791in;height:.302in' id="_x0000_i1025" src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"></span></a><o:p></o:p></p></td><td width=470 style='width:352.5pt;border:none;padding:9.0pt .75pt .75pt .75pt'><p class=MsoNormal style='line-height:13.5pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#41424E'>Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link" target="_blank"><span style='color:#4453EA'>www.avast.com</span></a> <o:p></o:p></span></p></td></tr></table><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>