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

<< < (6/7) > >>

4wd:
I'm one of those strange people that always try to use the smallest amount of space possible: in electronics I pack components together on a board, (and then have fun finding the faults); packing items, I'll try to use the smallest practical space; in code, I'll look for less lines.

Easy to see it as boolean instead of string.) That's why I came up with _IniBool() function. It seems trivial but with it you can actually use Boolean values in AutoIt variables and True or False will be written to the .ini using IniWrite. If the user changes it to 1 for true and 0 for false, it still functions as expected.


--- ---Func _IniBool($val)
    If $val = "True" Or $val = "1" Then Return True
    Return False
EndFunc   ;==>_IniBool
-MilesAhead (June 25, 2012, 04:45 PM)
--- End quote ---



--- Code: AutoIt ---Func _IniBool($temp)  Return ($temp = 1 Or (Not StringCompare($temp, "true")))EndFunc

MilesAhead:
Ways to skin cat > 1 :)

edit: I liked Pascal when I first started since it's nearly self-commenting. That's why I like it if my code "spells out" what I'm doing. If it works consistently I'm cool with it. :) Personal preference I guess. :)

MilesAhead:
FWIW, I think there's been a genuine misunderstanding here. My impression is of two people intending to be helpful. I can learn a little something from either side of the discussion, so thank you both.

I don't think it's a matter of IQ. If another is better at something than I, that doesn't necessarily result from a higher IQ than mine (though in my own case it almost certainly does mean that — the "For Dummies" series was clearly written for those like me). It probably means that the other has more or different experience.
-cranioscopical (June 25, 2012, 07:00 PM)
--- End quote ---

I agree with you. In fact I have a sig I like to use sometimes "How come we don't know the I.Q. of the guy who invented the test?"

What I keep running into, even on scripting language forums is "using scripting language = beginner" assumptions. I was doing OOP over 20 years ago. For small utilities on Windows AHK_L and AutoIt3 are simpler and more fun. The hotkey functions in MS Windows API don't even work.  At least trying the simple mouse click ones I got zero functionality. A waste of time. For what I'm doing the scripting stuff is superior.

I suppose since I don't have a CS degree I should keep a reading list of all the text books I studied on my own when learning this stuff.  But then some nerd will  imply I copied the author's names and didn't read any of the material. You can't win with these types.

4wd:
@4wd your version of _IniBool() would never return True. The reason is values read from ini files using IniRead are always strings.-MilesAhead (June 25, 2012, 11:17 PM)
--- End quote ---

It would have returned True if $val = 1, $val = '1' or $val = True - the only case it failed was if $val = 'True' because the implicit Number() call returns 0 for 'True'.

So yeah, my goof  :-[


--- Code: AutoIt ---Func _IniBool($temp)  Return ($temp = 1 Or (Not StringCompare($temp, "true")))EndFunc
My excuse is I was writing it on my netbook, lying in bed, with less than 3 minutes of battery remaining  :)

MilesAhead:
@4wd sorry. I tend to post, then go back and edit. I should proof my posts more thoroughly before hitting the button.  It contributes to confusion.  Trouble is I get so many typos that slip through the spell check that I seem to need to edit endlessly.  Sheesh. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version