last day (15 days later) » 

4:58 AM
5
A: Progress bar in console application in Delphi?

Ken WhiteHere's a sample that will produce the message Processing X of Y (Z%) ... in a loop, with a delay that would represent the time spent doing something in the loop. Obviously, it's a contrived example, but it shows one possibility. (Also obviously, you would replace the value for the upper limit of ...

 
@David: No, it isn't. The sleep() is simply a placeholder to delay the progress during the demo. It clearly wouldn't be in real code. The comment even says to replace it, and the progress is based on the loop progress, not time. You're simply being obtuse. Again, clearly personal. Do I need to have a mod speak to you again?
 
Real world example please. What credible real world example can be sliced into 250ms packages like this. In reality there will be two threads. One thread working giving out periodic updates of progress. And the main thread reporting that progress.
 
This takes me back to Turbo Pascal days.. @DavidHeffernan why not just offer up a better answer rather than degrade Ken?
 
@David: That entitles you to downvote the question and vote to close it, not to punish those that answer, and you've not downvoted other answers. Ergo, it's a personal attack, not technically motivated.
 
I have one vote to cast on an answer. It's up to me how to cast it. Thanks. Sleep can't readily be replaced by a long running task.
 
4:58 AM
@David: Votes are not intended to be punitive, especially when used by a high-rep user to punish people he doesn't like. You've admitted you're a liar and it's personal, in writing, in public, and it's been flagged for moderators again. And nobody said long running task. Poster asked how to display progress in a console app. Stop fixating on Sleep. Maybe get some yourself; your fatigue is clearly muddling your ability to think. This has absolutely nothing to do with the technical merits of my answer. It's personally motivated punishment.
@David: And you're downvoting because you've added requirements to the question that don't exist in the question, such as threads and long running processes. The question asks about displaying progress in a console application, and nothing more. Downvoting because an answer doesn't address non-existent requirements of the question is clearly not appropriate. Once again, you've proven it's personal and not technical.
 
I don't think any answer here would require a real world example, the question asks how to implement a progress bar. Implementing a callback mechanism or dividing the work to 250ms chunks should be up to the question poster.
 
@Sertac: Thanks. Nice to see that others can read the question requirements as well.
@David: Sleep can't readily be replaced Sleep has absolutely nothing to do with anything. You've decided to obsess over one line that is irrelevant to the question, that was used only to introduce a delay in the loop to slow it for display purposes and commented (and explained in text) as being used for that purpose. You clearly are intent on trying to justify your abusive behavior here, and others are even pointing it out to you.
 
To add, I actually never knew it was this easy. In prior console applications, I attempted to resort to elaborate measures to read/write the same line. I'm now a bit puzzled why I never knew that Write() would replace the current line. I always thought it merely added text to the end of the current line, and thus never even tried to use it (thinking it was useless). The moral of the story: I learned something drastically new as a result of this answer, and therefore up-voted it. I can see why someone would decline an up-vote, but a down-vote? Beyond me.
"This answer is not useful to me" is not what a down-vote means "This answer is not useful for a majority of future readers" is more-so what it means.
 
@Jerry: Write typically adds to the current line. The addition of a carriage return (CR), AKA #13, at the beginning of the output acts like pushing a typewriter carriage to the left without using the lever to feed a new line, which would be #10). So each line of output says Move back to the left side of the current line and then write this content. Without the CR (#13), it would simply continue adding to the previous content. WriteLn writes the content and then automatically adds the CR/LF pair to move left and go to the next line.
(continued) Console apps are extremely easy to use for testing purposes, as they don't require any controls, can quickly test functionality of an algorithm or concept, can write the textual output very quickly, and provide easy-to-use test apps (like the one here) with minimal content or use of additional units.
 
You've admitted you're a liar and it's personal, in writing, in public. Not at all.
 
4:58 AM
@David: No, you're not. The answer is clearly correct, directly answers the question asked, and has been compiled and tested. You're voting on the poster, imposing arbitrary conditions on the answer that are not applicable to the question asked. Others have pointed that out to you as well, but you're choosing to ignore them. I'm flagging again for moderator attention as abusive practices by you. At some point they'll address them.
@David: The question asks about displaying progress from a console app. Nothing else. Your addition of extra requirements in order to justify a punitive downvote because you didn't think the question should have been answered, particularly when you've not downvoted any of the other answers, is simply a personal attack on me. Nothing else. If it were based on technical merit, you would have also downvoted the other answers, and you did not do so. That clearly indicates you've singled me out personally for punishment. Those answers contain the same type info.
 
So just in case it's not clear, this is how the question starts: "I would like to display some kind of animation in my console application during a long process." so can we please out to bed the idea that nobody said anything about a long running task.
 
@David: Can we please put to bed the idea that you're not personally attacking me? It's clear you are, you've admitted it, others have pointed it out, and now you're trying to pretend it's not. You singled out only my answer for downvote, with the others containing similar content not getting that attention. You've not commented to them, objected to their answers, or downvoted. You've simply attacked me personally. It's clearly not technical, because the other answers were not downvoted. It's a petty personal attack by a high rep user being childish.
 
Anyway, I'm curious to know how you'd handle the usage stated in the question. My application loads a text file and traverses all lines one by one by performing a search for words to be replaced. Where does that fit into your answer.
 
@David: Read the comment in the post. It clearly indicates where that would fit. Your reading skills seem to be lacking here; I very clearly explained that in the answer. Once again, singling me out and not the others who posted the same type answer, and adding requirements that were not part of the question. The comment was added specifically for readers who can't seem to comprehend the example.
 
It's clear you are, you've admitted it. No I have not. Could you point to a statement of mine that backs up your claim. You seem to be trying to avoid the technical thrust of my comments by claiming that they are personal. I can't see how you'd fit the usage stated in the question into your code.
 
4:58 AM
@David: You have absolutely no technical thrust to your comments. Otherwise, they would be addressed to the other two answers as well. I'm done here. Knock yourself out. You've clearly indicated a personal bias by continuing to comment negatively about my answer while not posting a single comment to the other posts, by downvoting mine while not downvoting theirs, and by imposing requirements on my answer that do not exist in the question and that you're not imposing on the other answers. That's personal.
@David: I'm through here. Your personal bias is clear, and I've once again pointed it out to moderators. It's also clearly been pointed out by others in comments above, which I've also pointed out to the mods.
 
Remember also that I commented on this: stackoverflow.com/revisions/47230841/1 Your answer has improved slightly. It now fleshes out the merging of the file processing loop with the progress. For sure you might get away with that in a quick toy program, but it won't scale.
 
@David: I didn't say it would scale. I answered the question asked here. That's all. You're imposing conditions that do not exist here.
 
Take it personally if you wish. I don't really care. If you'd rather do that than consider what I wrote, I can't stop you.
Correct. I'm saying that it won't scale and it isn't practical. That's my point.
 
@David: So what? Neither will the code posted in the other two answers. Personally attacking me. No comments to them, no downvotes of their answers, just mine. You've singled me out personally, again. I never said the code written was a useful app; it was a demo of a way to display progress from a console application. Surely someone of your claimed intellect understands the difference between a demo and a fully functional, scalable implementation? Let's look at the code you've posted here that isn't a full blown scalable implementation, shall we? Hypocritical of you, isn't it?
Especially when the text says contrived example. Again, lacking the ability to read. And too late. The timing of your votes to cover your conduct is clear.
 
Why should I have to post my own answer that is better than yours? I don't want to. The question doesn't merit it. Does that disqualify me from voting and commenting? No it does not. I'll vote how I please. If you don't like it, tough. I'll keep on voting as I please. This nonsense won't put me off.
 
4:58 AM
@David: Never asked you to post an answer. Not once. Read every comment here again. I never made such a suggestion. Again, lack of reading skills. Assuming facts not in evidence. False accusations. Clear bias and now trolling.
 
You stated that I was hypocritical because I had not answered. It's right there above. But I'm glad you agree that there's no need for me to answer in order to be eligible to vote and comment. Reading skills? Maybe you are right. Maybe mine are deficient. "You've admitted you're a liar." I couldn't find that part anywhere. Can you point it out to me?
 
No, I said you were hypocritical because you've answered hundreds of questions here with code that wasn't a fully functional, scalable solution, but now want to require me to do so. Again, reading comprehension. Read again what I wrote. Here refers to SO. Clearly it isn't referring to an answer to this post, because you didn't write one. Go back to every single answer you've written here at SO, and delete all of them that are not full, scalable implementations but are only demonstrations. Guess what? Probably not enough rep left to downvote. Double standards, anyone?
@David: And how about you go around this entire site and DV every answer that isn't a full, scalable implementation? Let's see how much rep you have after that, shall we? Double standard. Personal. Clearly you don't understand the words example and demo - unless they apply to your answers, of course.
 
"Let's look at the code you've posted here that isn't a full blown scalable implementation, shall we? Hypocritical of you, isn't it?" I took that to mean here as in this question. Anyway, I don't expect you to produce finished code. Demo code to get across the concept is perfectly fine. But your demo code demonstrates the wrong concept.
Now, you are picking and choosing what you address. Let me repeat. "You've admitted you're a liar." I couldn't find that part anywhere. Can you point it out to me?
 
@David: Certainly. my contributions here are always technically motivated is clearly a lie, because a) there is no technical reason for a downvote here, as others have pointed out; you're adding a requirement for a full blown, scalable implementation to a demo or example in order to invent one; and b) because you did not (until the last few minutes) downvote the others for the same "technical merits* that you imposed on mine. That's a clear lie, and you admit it with (The criticism of your answer applies equally to the other answers I agree. I will vote on them too.) hours later.
@David: And to clarify, the entire relevant content of my post (which answered the question) was a single line: Write(Format(StatusMsg, [i, StopValue, Pct]));. The rest was demonstration code to show how it worked. Your obsession (first about Sleep, and then about scalability) is based on that demonstration code and not the actual answer content. It's clearly biased and personal, not technical whatsoever.
 
Nope. That's a bizarre and twisted interpretation. If you want to regard this as personal, I can't stop you. It feels like you'd rather do that than consider the technical content of what I say. I'm done here.
 
4:58 AM
@David: You have no technical content here, and I've explained repeatedly (as have others) why that is fact. If anyone isn't considering facts, it's you. It's clear to me and to others that there is no technical reason for your stance here that couldn't be applied to every single post you've ever made here, as well as that of almost every single answer by anyone here.
 
Well, I guess we are just going to have to accept that we don't agree with each other.
 
@David: I posted 26 lines of code (including blank lines), of which 25 were for demonstration purposes. That leaves a single line that you can claim has technical issues (the single Write line). What technical problem is there with that single line of code? The rest is all demonstration code that simply displays the output of the single relevant line. What technical issue do you have with that line that is deserving of a downvote? Please tell me what you would like me to address with that single line of code and I'll do so, at which point you can un-downvote (not upvote).
 

last day (15 days later) »