Welcome Guest.   Make a donation to an author on the site December 19, 2014, 06:52:29 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 [2]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Generate sequential serial numbers  (Read 11672 times)
4wd
Supporting Member
**
Posts: 3,528



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #25 on: June 25, 2012, 07:54:01 PM »

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.

[copy or print]
Func _IniBool($val)
    If $val = "True" Or $val = "1" Then Return True
    Return False
EndFunc   ;==>_IniBool


Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. Func _IniBool($temp)
  2.  Return ($temp = 1 Or (Not StringCompare($temp, "true")))
« Last Edit: June 26, 2012, 12:24:38 AM by 4wd; Reason: \'cos I\'m an idiot. » Logged

I do not need to control my anger ... people just need to stop pissing me off!
MilesAhead
Member
**
Posts: 5,151



View Profile WWW Give some DonationCredits to this forum member
« Reply #26 on: June 25, 2012, 11:17:27 PM »

Ways to skin cat > 1 smiley

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. smiley Personal preference I guess. smiley
« Last Edit: June 25, 2012, 11:58:53 PM by MilesAhead » Logged

"I worked myself up from nothing to a state of extreme poverty."
- Groucho Marx
MilesAhead
Member
**
Posts: 5,151



View Profile WWW Give some DonationCredits to this forum member
« Reply #27 on: June 25, 2012, 11:54:44 PM »

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.

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.
« Last Edit: June 26, 2012, 12:00:21 AM by MilesAhead » Logged

"I worked myself up from nothing to a state of extreme poverty."
- Groucho Marx
4wd
Supporting Member
**
Posts: 3,528



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #28 on: June 26, 2012, 12:15:33 AM »

@4wd your version of _IniBool() would never return True. The reason is values read from ini files using IniRead are always strings.

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  embarassed

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. Func _IniBool($temp)
  2.  Return ($temp = 1 Or (Not StringCompare($temp, "true")))

My excuse is I was writing it on my netbook, lying in bed, with less than 3 minutes of battery remaining  smiley
« Last Edit: June 26, 2012, 12:23:32 AM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
MilesAhead
Member
**
Posts: 5,151



View Profile WWW Give some DonationCredits to this forum member
« Reply #29 on: June 26, 2012, 01:54:23 AM »

@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. smiley

« Last Edit: June 26, 2012, 02:03:06 AM by MilesAhead » Logged

"I worked myself up from nothing to a state of extreme poverty."
- Groucho Marx
MilesAhead
Member
**
Posts: 5,151



View Profile WWW Give some DonationCredits to this forum member
« Reply #30 on: July 05, 2012, 02:26:29 PM »

Hmm, seems I inadvertently posted bad info. According to AHK_L author himself, AHK_L doesn't use Variants for everything.  They are used in Object implementation. But evidently ahk cooked up its own scheme for variable storage.

http://www.autohotkey.com...8410&p=548540#p548382

In any case, there is no "type" only fluid storage, outside of the Object implementation.
Logged

"I worked myself up from nothing to a state of extreme poverty."
- Groucho Marx
danlock77
Supporting Member
**
Posts: 3


My photo=Jesse, 2008/08/30 15:17

View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #31 on: July 12, 2012, 02:52:38 PM »

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.

I think you're correct (from what I've read) with your first paragraph and I would "+1" your post for that paragraph...

However, the second paragraph is a little confusing:  As it is most-commonly used (IMO), "IQ" is a number which indicates someone's "intelligence" (Intelligence Quotient, with average being 100 and many other words describing other ranges of IQ values).  I think that's how you are using it.  Anyway, the standard IQ test is pretty limited in scope and might result in widely-varying results for different people based only on how they cognitively interpret the questions (their method of attack or thought patterns while considering how to respond) and how well they can recall lists of items, for example.  Some people who score in the 70s on IQ tests can thumb through a book in a few seconds and then tell you immediately on which page such-and-such event in the book occurs, or how many times a word is used in the text, etc.  That's just one example of how IQ might misrepresent one aspect of the brain.  (I'm thinking loosely of Kim Peek, the person on whose life the movie "Rain Man" was based.)

My second paragraph above is merely 'food for thought', since the thread's topic has mutated a few times already...
« Last Edit: July 12, 2012, 02:57:23 PM by danlock77; Reason: final parenthetical sentence added. oi! » Logged
Pages: Prev 1 [2]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.153s | Server load: 0.05 ]