ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Generate sequential serial numbers

<< < (4/7) > >>

4wd:
Please explain to me how the code would work correctly, even if variable data types are allowed. What is the outcome of mySerial += myFactor when mySerial is something like "000001" (a string). I would be very surprised if you claimed it would equal 3 (integer).-Ruffnekk (June 22, 2012, 02:30 AM)
--- End quote ---

While I'm no good at AutoHK, it did spring from AutoIt - so here's a little excerpt from the help file:
In AutoIt there is only one datatype called a Variant.  A variant can contain numeric or string data and decides how to use the data depending on the situation it is being used in.  For example, if you try and multiply two variants they will be treated as numbers, if you try and concatenate (join) two variants they will be treated as strings.

If a string is used as a number, an implicit call to Number() function is done. So if it doesn't contain a valid number, it will be assumed to equal 0.
--- End quote ---

So this:

--- Code: AutoIt ---$mySerial = '000001gh'$myFactor = 2$mySerial += $myFactor  ; With the implicit call becomes: Number($mySerial) += $myFactor
$mySerial = 3

Add this:

--- Code: AutoIt ---StringFormat('%06s', $mySerial) ; With the implicit call becomes: StringFormat('%06s', String($mySerial))
$mySerial = '000003'

Keep up the bad practice if you like!  :Thmbsup:
--- End quote ---

I'll take function over form any day as long as it gets the job done  ;)

MilesAhead:
Like I said, I was just trying to give a tip on good practice in coding.

Please explain to me how the code would work correctly,
...

-Ruffnekk (June 22, 2012, 02:30 AM)
--- End quote ---

I think you are taking the wrong approach. Since you are expert on correct programming practice it should be trivial to post original working code in ahk that does what mine does, but in a superior fashion. If it's better I'll say so and probably copy it. But until I see working code from you in ahk, pardon me, but I'll ignore your comments on this issue.  Anyone can heckle. Producing something that works is more impressive. :)

Ruffnekk:
I´m not taking the wrong approach, I was explaining something that is useful for general practice in programming. Right off the bat I admitted I don´t know AHK and I wasn´t specifically criticizing AHK. Anyway, I don´t want or have to prove anything to anyone; I´ve been a senior programmer for over 15 years at the same multinational company and if you refuse to take good advice for what it is, then that´s your loss. No hard feelings, man. You´re taking this way too seriously.  :-*

IainB:
...I don´t want or have to prove anything to anyone; I´ve been a senior programmer for over 15 years at the same multinational company and if you refuse to take good advice for what it is, then that´s your loss.

--- End quote ---
Sorry to chip in, but really, this seems to be becoming an absurd discussion.
In what the speaker says here there seem to be not a few direct/implied logical fallacies:

* there is an implied argumentum ad hominem (argument against the person, including, for example @MilesAhead) - viz: "he's inexperienced/unqualified".
* there is an argumentum ad ignorantiam (forwarding a proposition without any certain proof) - that the speaker is implicitly "an authority".
* there is an unproven (QED) and implied argumentum ad verecundiam (appeal to authority) - based on the above fallacy, the implication that because the speaker is an authority he/she is therefore correct in all his/her statements.
* there is an ignoratio elenchi (a "red herring" or genetic fallacy) - the speaker's opinions of their own qualities or those of @MilesAhead or anyone else are irrelevant as they prove nothing - except perhaps the speaker's own self-opinionated arrogance, in this case at any rate.
* there is a non sequitur ("it does not follow") - for all we know, the speaker's work experience might have meant 15 long and dreary years with the same company, with annually poor training and repetitive and bad programming practice, with the adverse effects of same being spread multinationally, leaving him angrily stuck in the rut where he is, unacceptable for employment with another company.
I would suggest that if I have the above more or less right, then it could be worth reflecting as to whether there is generally a requirement that programmers need to be able to reason logically to be able to do their job. If there is, and if a person cannot, then a vocational guidance counsellor would probably suggest that programming was an inadvisable vocation for such an individual.
I say this because, without such advice, a person might spend the best part of their working life doing something for which they were naturally ill-suited, and living in a sense of unhappiness, inner frustration, incompleteness and anger as a result. This might be coped with in a sub-optimal manner by, (say) angrily hitting out at or running down others as though they were the cause of the inner turmoil and ego-conflict.

In any event, I would suggest that the speaker's apparently absurd reasoning and rudeness on display in this thread is uncalled for, unnecessary and unconstructive.

Ruffnekk:
This is my last reply to this thread, because it is utterly absurd the reactions I get. I always thought DonationCoder was a friendly forum, where people are able to discuss something rationally, but I guess I was wrong. I just want to point out once more, that I was only giving advice, I wasn´t claiming anything from authority, nor was I trying to be rude and I most certainly don´t think anything I said was uncalled for or directly aimed at a person or his/her skills.

@IainB: Throwing around some fancy words and Latin phrases makes you neither an authority, nor an intelligent person. On the contrary, your complete post is exactly all the things you accuse someone else of in it. Wanna-be-psychologist, much?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version