DIR statement : file attributes for Newbies

Post your FreeBASIC tips and tricks here. Please don’t post your code without including an explanation.
deltarho[1859]
Posts: 2092
Joined: Jan 02, 2017 0:34
Location: UK

Re: DIR statement : file attributes for Newbies

Postby deltarho[1859] » Oct 17, 2017 13:28

@Trinity

"I would like to suggest that you stop trying to impose your values in this matter on me !!!"

I am not - they are universally accepted. It is clear that you would like to be a better programmer but this will be difficult to achieve by side stepping some of the basics. "And I do not agree with your opinion about what is necessarily needed and not needed to program in FB." It is not my opinion exclusively and as an acknowledged newbie how can you tell what is needed or not. ",but I don't need to I just need to be able to make what I need." OK, but you not be able to do so if some of the basics are side stepped.

To persistently seek the light will have no effect on our darkness, only our ability to be aware of and respond to our surroundings.
Yours truly wrote:Like I said, I may be barking up the wrong tree but only one person knows the truth.

We did not get an answer to that.

Never mind, I don't actually need one.

"Now! , that's out of the way , could we then please drop this discussion ?"

I cannot speak for others but I am out now. I will see you again in another thread, probably, to talk about why we are both here - coding. <wink>
grindstone
Posts: 656
Joined: May 05, 2015 5:35
Location: Germany

Re: DIR statement : file attributes for Newbies

Postby grindstone » Oct 17, 2017 19:42

Maybe this thread should be renamed and shifted to "Community Discussion" <smirk>

And I find that it (this thread) gives some interesting food for thought for another one:
Most important concepts to learn for a new developer (Top 50)

IMHO "Bitmasks" should be added to the list by all means. ;-)
deltarho[1859]
Posts: 2092
Joined: Jan 02, 2017 0:34
Location: UK

Re: DIR statement : file attributes for Newbies

Postby deltarho[1859] » Oct 17, 2017 20:30

Had to call back.

I conducted a forum search for <smirk>. It has never been used before.

Congratulations, grindstone, you win a FB mug.

It should arrive from amazon.de this Thursday. <enjoy>
grindstone
Posts: 656
Joined: May 05, 2015 5:35
Location: Germany

Re: DIR statement : file attributes for Newbies

Postby grindstone » Oct 17, 2017 21:48

You mean, it was a real premiere? I was the first one who ever did it? Such as Neil Armstrong once on the moon? WOW!
you win a FB mug
I'm looking forward to it! <grin>
Trinity
Posts: 214
Joined: Sep 16, 2017 17:07

Re: DIR statement : file attributes for Newbies

Postby Trinity » Oct 17, 2017 22:23

grindstone wrote:Maybe this thread should be renamed and shifted to "Community Discussion" <smirk>
It's not my fault if people have run amok over my initial post - I think it helpful but apparently not considered so by those that it's not supposed to help - go figure :-D
Kuron
Posts: 31
Joined: Jul 26, 2005 3:22
Location: Nashville

Re: DIR statement : file attributes for Newbies

Postby Kuron » Oct 17, 2017 22:40

Trinity wrote:It's not my fault if people have run amok over my initial post - I think it helpful but apparently not considered so by those that it's not supposed to help - go figure :-D

Your experience is an example of why many will never post code, tutorials, etc. You try and do something helpful and get kicked in the teeth for your efforts. The old saying, no good deed goes unpunished definitely applies to programming forums. :cD
Trinity
Posts: 214
Joined: Sep 16, 2017 17:07

Re: DIR statement : file attributes for Newbies

Postby Trinity » Oct 17, 2017 22:44

Kuron wrote:Your experience is an example of why many will never post code, tutorials, etc.
Yeah , well , it certainly has taught me to reconsider more than once if I ever get that urge again ;-) :-D
St_W
Posts: 1477
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: DIR statement : file attributes for Newbies

Postby St_W » Oct 17, 2017 23:13

Trinity wrote:the thread is not aimed at satisfying you or other "expert programmers", it's from me to whoever can appreciate it.
The thing is that it is showing other newbies a suboptimal implementation. The bad thing about this is that they will use code like this found in the "Tips and Tricks" section and thus will produce bad code themselves instead of reading about how to do it better.

Trinity wrote:It's not my fault if people have run amok over my initial post - I think it helpful but apparently not considered so by those that it's not supposed to help
Examples demonstating bad practices are not helpful for anybody, and especially not for beginners who do not know how to do it better and can not rate the quality of the code.

It becomes helpful when the example is improved with suggestions from other forum members, like the one by José. I also tried to provide suggestions for improvement. Thus I can't explain why you interpret every suggestion as personal critique and are seeking for appreciation for your inital post. The goal of a forum thread is to develop a (high quality) solution with the help of various people suggesting things. The final solution may look completely different than the initial approach. Ideally this helps both the initial author (by learning improvements or new solutions) and other readers of the thread (by providing interesting, high quality content). Unfortunately it just doesn't work out in that ideal way sometimes.

Kuron wrote:Your experience is an example of why many will never post code, tutorials, etc. You try and do something helpful and get kicked in the teeth for your efforts.
If you consider every critique and improvement suggestion for your solutions as "getting kicked in the teeth", then you're probably right. However, if you're open to learn from other's suggestions and do not consider your solutions as the one and only one it can be a helpful experience, from which both you and others can learn from.
Trinity
Posts: 214
Joined: Sep 16, 2017 17:07

Re: DIR statement : file attributes for Newbies

Postby Trinity » Oct 17, 2017 23:41

St_W wrote:The thing is that it is showing other newbies a suboptimal implementation.
<BLAH BLAH BLAH>
You are repeating yourself (Keeps writing the same stuff over and over just using different ways of writing the same)
St_W wrote:Examples demonstating bad practices are not helpful for anybody, and especially not for beginners who do not know how to do it better and can not rate the quality of the code.
<BLAH BLAH BLAH>
You keep repeating yourself (Keeps writing the same stuff over and over just using different ways of writing the same)
St_W wrote:Thus I can't explain why you interpret every suggestion as personal critique
No , I can understand why it would be incredibly hard for someone like you to see that since you would obviously never stoop to anything such as criticizing me yourself :-D
deltarho[1859]
Posts: 2092
Joined: Jan 02, 2017 0:34
Location: UK

Re: DIR statement : file attributes for Newbies

Postby deltarho[1859] » Oct 18, 2017 0:23

Trinty wrote:could we then please drop this discussion ?

You stayed with it.

It never ceases to amaze me how a single event can have disparate perceptions.

I am appalled that someone with St_W's views can be implicitly included amongst "people have run amok over my initial post".

I am now convinced that my artist post was correct and what we have here is a response to a failure to get a "seeking for appreciation for your initial post". I was hoping for an admission for displaying a bruised ego, which most, if not all of us, would have accepted since none of us is 'as pure as the driven snow' but it did not happen.

It is with regret then that I have decided to put Trinity on my ignore list; which had been empty.

@St_W

You have served this forum well by being good tempered throughout this thread. I, on the other hand, would have 'blown my stack' well before now.
deltarho[1859]
Posts: 2092
Joined: Jan 02, 2017 0:34
Location: UK

Re: DIR statement : file attributes for Newbies

Postby deltarho[1859] » Oct 18, 2017 0:31

grindstone wrote:Such as Neil Armstrong once on the moon?

Well, erm, err, ....., yeah! <Ha,ha,ha>
Trinity
Posts: 214
Joined: Sep 16, 2017 17:07

Re: DIR statement : file attributes for Newbies

Postby Trinity » Oct 18, 2017 0:35

deltarho[1859] wrote:You stayed with it.
No , I didn't , what I did was to defend myself against the derailing thing here , which I could not just ignore : viewtopic.php?p=238011#p238011
deltarho[1859] wrote:I am now convinced that my artist post was correct and what we have here is a response to a failure to get a "seeking for appreciation for your initial post".
Accusation with no link link to reality , the only reason that the view or opinion of other people were ever brought up were as a response to this post where I tried to explain that people were negative (as opposed to positive) : viewtopic.php?p=237963#p237963
deltarho[1859] wrote:It is with regret then that I have decided to put Trinity on my ignore list; which had been empty..
Whatever :-)
St_W
Posts: 1477
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: DIR statement : file attributes for Newbies

Postby St_W » Oct 18, 2017 0:53

Trinity wrote:You are repeating yourself
May be, but that doesn't make the content less true. Anyway, I'm not going to discuss about "bla bla" arguments, which could have equally likely come from a teenager.

Trinity wrote:No , I can understand why it would be incredibly hard for someone like you to see that since you would obviously never stoop to anything such as criticizing me yourself
I did not criticise you as a person; I highlighted faults and suggested improvements for your example in the first post - not only for you, but also (and probably more importantly) for all other (future) readers of the thread.

I'm really sorry that you interpet that as accusations and feel offended, but I was just writing about the initial example in a technical, unemotional way without any intensions to offend anybody.
Josep Roca
Posts: 449
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: DIR statement : file attributes for Newbies

Postby Josep Roca » Oct 18, 2017 0:58

Imagine that you're programming with Windows and want to add a style to a window if it has not it set. Using Trinity suggestion you will have to retrieve the window style and check it against several hundred possible combinations... Yet we can do it with a simple OR:

Code: Select all

PRIVATE FUNCTION AfxAddWindowStyle (BYVAL hwnd AS HWND, BYVAL dwStyle AS DWORD) AS DWORD
   DIM dwOldStyle AS DWORD = GetWindowLongPtr(hwnd, GWL_STYLE)
   SetWindowLongPtr(hwnd, GWL_STYLE, dwOldStyle OR dwStyle)
   FUNCTION = dwOldStyle
END FUNCTION
Kuron
Posts: 31
Joined: Jul 26, 2005 3:22
Location: Nashville

Re: DIR statement : file attributes for Newbies

Postby Kuron » Oct 18, 2017 4:23

@Trinity, when you have a clear head, go back and reread José's posts.

Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 3 guests