<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GuShH&#039;s Development Blog &#187; GuShH</title>
	<atom:link href="http://gushh.net/blog/tag/gushh/feed/" rel="self" type="application/rss+xml" />
	<link>http://gushh.net/blog</link>
	<description>This blog is about software, electronics and game development.</description>
	<lastBuildDate>Wed, 08 Sep 2010 03:02:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Declar&#8217;em! &#8211; Automatic declaration of procedures.</title>
		<link>http://gushh.net/blog/2009/09/05/automatic-declare-tool/</link>
		<comments>http://gushh.net/blog/2009/09/05/automatic-declare-tool/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 20:32:44 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[automatic procedure declaration]]></category>
		<category><![CDATA[declare]]></category>
		<category><![CDATA[declarem]]></category>
		<category><![CDATA[GuShH]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[pb]]></category>
		<category><![CDATA[procedures]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/?p=240</guid>
		<description><![CDATA[This is a tool that I&#8217;ve been using for quite a long while, just recently I fixed a small bug in the regexp and I thought it was time to share it. For those of you using the official IDE, there&#8217;s no real solution to this &#8220;problem&#8221;. When you&#8217;re working on something small, it&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<!-- AdSense Now! V1.95 -->
<!-- Post[count: 3] -->
<div class="adsense adsense-leadin" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-2462949361920197";
/* 468x15, created 4/6/10 */
google_ad_slot = "8315313616";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>This is a tool that I&#8217;ve been using for quite a long while, just recently I fixed a small bug in the regexp and I thought it was time to share it.</p>
<p>For those of you using the official IDE, there&#8217;s no real solution to this &#8220;problem&#8221;. When you&#8217;re working on something small, it&#8217;s not a big deal to define a couple of declares here and there&#8230; However, on bigger code this becomes a real issue!. So why waste the time switching between IDEs or doing it by hand?&#8230;</p>
<p style="text-align: left;"><a title="Declar'em!" href="http://gushh.net/dls/declarem.zip" target="_blank">Grab it</a> and let me know how it runs! (<span style="text-decoration: line-through;">nasty</span> <em>ugly </em>source included).</p>
<p style="text-align: center;">The tool is very simple to install, I recommend you unzip directly into your PB directory and configure it as follows:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-243" title="Declarem_installation" src="http://gushh.net/blog/wp-content/uploads/2009/09/Declarem_installation.PNG" alt="Declarem_installation" width="485" height="296" /></p>
<p style="text-align: center;">That&#8217;s it. You&#8217;re ready to declar&#8217;em!.</p>
<p style="text-align: left; ">Cheers.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://gushh.net/blog/2009/07/28/guitar-rig-3-a-couple-of-helpful-tools/" rel="bookmark" class="crp_title">Guitar Rig 3 &#8211; A couple of helpful tools.</a></li><li><a href="http://gushh.net/blog/2010/09/08/3d-scanning-is-fun-fun-fun/" rel="bookmark" class="crp_title">3D Scanning is fun fun fun!</a></li><li><a href="http://gushh.net/blog/2010/04/08/latching-current-limiter/" rel="bookmark" class="crp_title">Latching Current Limiter (resettable fuse if you will!)</a></li><li><a href="http://gushh.net/blog/2010/04/17/very-simple-oscillator/" rel="bookmark" class="crp_title">Very Simple Oscillator</a></li><li><a href="http://gushh.net/blog/2008/03/03/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/" rel="bookmark" class="crp_title">Faster ways of finding a character inside a string, in PureBasic.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/2009/09/05/automatic-declare-tool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Centered MessageRequester() / MessageBox()</title>
		<link>http://gushh.net/blog/2009/07/02/centered-messagerequester-messagebox/</link>
		<comments>http://gushh.net/blog/2009/07/02/centered-messagerequester-messagebox/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 16:25:00 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[CBT]]></category>
		<category><![CDATA[Centered Dialog]]></category>
		<category><![CDATA[Dual Screen]]></category>
		<category><![CDATA[Fanboy]]></category>
		<category><![CDATA[GuShH]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[MessageBox]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[pb]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[SetWindowsHookEx]]></category>
		<category><![CDATA[UnhookWindowsHookEx]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/?p=87</guid>
		<description><![CDATA[As usual, I was browsing the PureBasic forums to see what was new, nothing much (heh&#8230;) but something caught my attention, the fact that some user requested for the IDE&#8217;s message dialogs to be &#8220;centered&#8221; ( because he had multiple displays and the messages would appear in between them ) just to get shit-faced by [...]]]></description>
			<content:encoded><![CDATA[<p>As usual, I was browsing the PureBasic forums to see what was new, nothing much (heh&#8230;) but something caught my attention, the fact that some user requested for the IDE&#8217;s message dialogs to be &#8220;centered&#8221; ( because he had multiple displays and the messages would appear in between them ) just to get shit-faced by an actual staff member!</p>
<p>You can&#8217;t just say &#8220;it&#8217;s Microsoft&#8217;s fault&#8221; &#8212; Are you in some sort of mac-only cleanse?, What&#8217;s your #%&amp;%#$ problem?!</p>
<p>Those who &#8220;pass the ball&#8221; (as the user suggested) are part of the problem. You, being a programmer can certainly code a simple CBT hook, right?. Are you against hooks, perhaps &#8211; you are a purist, I hear&#8230; Sorry, but sometimes solutions <strong>are</strong> &#8220;dirty&#8221; and you have to live with them.</p>
<div id="attachment_88" class="wp-caption aligncenter" style="width: 658px"><img class="size-full wp-image-88 " title="split_screen" src="http://gushh.net/blog/wp-content/uploads/2009/07/split_screen.jpg" alt="Just for the record, I too use a split-screen and I find it annoying that dialog boxes are not centered to their parent." width="648" height="203" /><p class="wp-caption-text">Just for the record, I too use a split-screen and I find it annoying that dialog boxes are not centered to their parent.</p></div>
<p><span id="more-87"></span></p>
<p>I certainly think that this sort of behavior is not good for a business, but then again they&#8217;ve been cat-walking away from reality for years now (Look at their website if not, look at the fact that they haven&#8217;t implemented basic functionality to their language and by basic I mean a proper container library and whatnot!). Most of their user-base consists of people who are afraid of real, world-class languages. That&#8217;s my opinion, take it or leave it.</p>
<p>But before you throw crap at me do remember that I support them, I just don&#8217;t like the way they&#8217;re doing things. Pretty much like Apple does (they do crap) however the fanboys don&#8217;t realize this and they see any criticism as bad for the company image, when in fact what damages the company is that nonsense wall they put up when anybody, and I do mean &#8220;anybody&#8221; says &#8220;anything&#8221; that appears to be &#8220;against&#8221; their product/s.</p>
<p>Even if you don&#8217;t like it at least have the decency to hear those who are genuinely interested in your product, those who are giving away (and for free) true and useful suggestions for you to improve them. I don&#8217;t give a damn about this particular user but I do care when a so called company does this sort of things to their own users, it&#8217;s just uncalled for and plainly unprofessional.</p>
<p>Have a nice day, code follows.</p>

<div class="wp_syntax"><div class="code"><pre class="purebasic" style="font-family:monospace;"><span style="color: #ff0000; font-style: italic;">; This snippet was based on the following code by Microsoft:</span>
<span style="color: #ff0000; font-style: italic;">; http://support.microsoft.com/kb/180936</span>
<span style="color: #000066; font-weight: bold;">EnableExplicit</span> <span style="color: #ff0000; font-style: italic;">; The only way to go.</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">Procedure</span>.i CenterMsgCallBack<span style="color: #000066;">&#40;</span> uMsg.i, wParam.i, lParam.i <span style="color: #000066;">&#41;</span> 
&nbsp;
	<span style="color: #000066; font-weight: bold;">Select</span> uMsg
		<span style="color: #000066; font-weight: bold;">Case</span> #HCBT_ACTIVATE
&nbsp;
			<span style="color: #000066; font-weight: bold;">Define</span>.RECT typFormRect, typRectMsg
			<span style="color: #000066; font-weight: bold;">Define</span>.i plMsgHook, hWnd
			<span style="color: #000066; font-weight: bold;">Define</span>.i lxPos, lyPos
&nbsp;
			hWnd <span style="color: #000066;">=</span> GetParent_<span style="color: #000066;">&#40;</span>wParam<span style="color: #000066;">&#41;</span> 																																																		<span style="color: #ff0000; font-style: italic;">; the parent will be the callee</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">If</span> hWnd 																																																											<span style="color: #ff0000; font-style: italic;">; can't hurt to check.</span>
&nbsp;
				plMsgHook 	<span style="color: #000066;">=</span> GetWindowLong_<span style="color: #000066;">&#40;</span> hWnd, #GWL_USERDATA <span style="color: #000066;">&#41;</span> 																																				<span style="color: #ff0000; font-style: italic;">; get the hook address</span>
&nbsp;
				<span style="color: #000066; font-weight: bold;">If</span> plMsgHook 																																																								<span style="color: #ff0000; font-style: italic;">; can't hurt to check.</span>
&nbsp;
					GetWindowRect_<span style="color: #000066;">&#40;</span> hWnd, typFormRect <span style="color: #000066;">&#41;</span>
					GetWindowRect_<span style="color: #000066;">&#40;</span> wParam, typRectMsg <span style="color: #000066;">&#41;</span>
&nbsp;
					lxPos <span style="color: #000066;">=</span> <span style="color: #000066;">&#40;</span>typFormRect<span style="color: #000066;">\</span><span style="color: #0000ff;">Left</span> <span style="color: #000066;">+</span> <span style="color: #000066;">&#40;</span>typFormRect<span style="color: #000066;">\</span><span style="color: #0000ff;">Right</span> <span style="color: #000066;">-</span> typFormRect<span style="color: #000066;">\</span><span style="color: #0000ff;">Left</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">/</span> <span style="color: #CC0000;">2</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">-</span> <span style="color: #000066;">&#40;</span><span style="color: #000066;">&#40;</span>typRectMsg<span style="color: #000066;">\</span><span style="color: #0000ff;">Right</span> <span style="color: #000066;">-</span> typRectMsg<span style="color: #000066;">\</span><span style="color: #0000ff;">Left</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">/</span> <span style="color: #CC0000;">2</span><span style="color: #000066;">&#41;</span>
					lyPos <span style="color: #000066;">=</span> <span style="color: #000066;">&#40;</span>typFormRect<span style="color: #000066;">\</span>Top  <span style="color: #000066;">+</span>	<span style="color: #000066;">&#40;</span>typFormRect<span style="color: #000066;">\</span>Bottom <span style="color: #000066;">-</span> typFormRect<span style="color: #000066;">\</span>Top<span style="color: #000066;">&#41;</span> <span style="color: #000066;">/</span> <span style="color: #CC0000;">2</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">-</span> <span style="color: #000066;">&#40;</span><span style="color: #000066;">&#40;</span>typRectMsg<span style="color: #000066;">\</span>Bottom <span style="color: #000066;">-</span> typRectMsg<span style="color: #000066;">\</span>Top<span style="color: #000066;">&#41;</span> <span style="color: #000066;">/</span> <span style="color: #CC0000;">2</span><span style="color: #000066;">&#41;</span>
&nbsp;
					SetWindowPos_<span style="color: #000066;">&#40;</span> wParam, <span style="color: #CC0000;">0</span>, lxPos, lyPos, <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">0</span>,	#SWP_NOSIZE <span style="color: #000066;">|</span> #SWP_NOZORDER <span style="color: #000066;">|</span> #SWP_NOACTIVATE <span style="color: #000066;">&#41;</span> 														<span style="color: #ff0000; font-style: italic;">; position the window.</span>
					UnhookWindowsHookEx_<span style="color: #000066;">&#40;</span>plMsgHook<span style="color: #000066;">&#41;</span> 																																													<span style="color: #ff0000; font-style: italic;">; release the hook.</span>
					SetWindowLong_<span style="color: #000066;">&#40;</span> hWnd, #GWL_USERDATA, #Null <span style="color: #000066;">&#41;</span> 																																							<span style="color: #ff0000; font-style: italic;">; unset the user data.</span>
&nbsp;
				<span style="color: #000066; font-weight: bold;">EndIf</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">EndIf</span>
	<span style="color: #000066; font-weight: bold;">EndSelect</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">EndProcedure</span> 
&nbsp;
<span style="color: #000066; font-weight: bold;">Procedure</span>.i CenteredMessageRequester<span style="color: #000066;">&#40;</span> Title.s, Text.s, Flags.i<span style="color: #000066;">=</span>#Null, hWnd.i<span style="color: #000066;">=</span>#Null <span style="color: #000066;">&#41;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">Define</span>.i lInstance, lThreadID, plMsgHook
&nbsp;
	<span style="color: #000066; font-weight: bold;">If</span> <span style="color: #000066; font-weight: bold;">Not</span> hWnd
		hWnd <span style="color: #000066;">=</span> <span style="color: #0000ff;">WindowID</span><span style="color: #000066;">&#40;</span> <span style="color: #0000ff;">GetActiveWindow</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">&#41;</span>
	<span style="color: #000066; font-weight: bold;">EndIf</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">If</span> hWnd
&nbsp;
		lInstance <span style="color: #000066;">=</span> GetWindowLong_<span style="color: #000066;">&#40;</span> hWnd, #GWL_HINSTANCE <span style="color: #000066;">&#41;</span>
		lThreadID <span style="color: #000066;">=</span> GetCurrentThreadId_<span style="color: #000066;">&#40;</span><span style="color: #000066;">&#41;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">If</span> lInstance <span style="color: #000066; font-weight: bold;">And</span> lThreadID 																																																			<span style="color: #ff0000; font-style: italic;">; just to make sure, can't hurt.</span>
&nbsp;
			plMsgHook <span style="color: #000066;">=</span> SetWindowsHookEx_<span style="color: #000066;">&#40;</span>#WH_CBT, @CenterMsgCallBack<span style="color: #000066;">&#40;</span><span style="color: #000066;">&#41;</span>, lInstance, lThreadID<span style="color: #000066;">&#41;</span> 																						<span style="color: #ff0000; font-style: italic;">; create the cbt hook.</span>
			SetWindowLong_<span style="color: #000066;">&#40;</span>	hWnd, #GWL_USERDATA, plMsgHook <span style="color: #000066;">&#41;</span> 																																							<span style="color: #ff0000; font-style: italic;">; save the hook address, we'll need it to release it.</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">ProcedureReturn</span> MessageBox_<span style="color: #000066;">&#40;</span> hWnd, Text, Title, Flags <span style="color: #000066;">&#41;</span>																																				<span style="color: #ff0000; font-style: italic;">; finally, create the message box.</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">EndIf</span>
	<span style="color: #000066; font-weight: bold;">EndIf</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">EndProcedure</span></pre></div></div>

<p>And a small example:</p>

<div class="wp_syntax"><div class="code"><pre class="purebasic" style="font-family:monospace;"><span style="color: #0000ff;">OpenWindow</span><span style="color: #000066;">&#40;</span> <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">500</span>, <span style="color: #CC0000;">200</span>, <span style="color: #CC0000;">400</span>, <span style="color: #CC0000;">200</span>, <span style="color: #009900;">&quot;testing&quot;</span> <span style="color: #000066;">&#41;</span>																																											<span style="color: #ff0000; font-style: italic;">; test window</span>
<span style="color: #0000ff;">MessageRequester</span><span style="color: #000066;">&#40;</span> <span style="color: #009900;">&quot;:(&quot;</span>, <span style="color: #009900;">&quot;I'm a normal messagebox&quot;</span>, #MB_APPLMODAL <span style="color: #000066;">|</span> #MB_ICONERROR <span style="color: #000066;">&#41;</span>																									<span style="color: #ff0000; font-style: italic;">; conventional msgbox</span>
CenteredMessageRequester<span style="color: #000066;">&#40;</span> <span style="color: #009900;">&quot;:)&quot;</span>, <span style="color: #009900;">&quot;I'm a centered messagebox!&quot;</span>, #MB_APPLMODAL <span style="color: #000066;">|</span> #MB_ICONEXCLAMATION <span style="color: #000066;">&#41;</span>																	<span style="color: #ff0000; font-style: italic;">; our centered msgbox.</span></pre></div></div>

<p>The &#8220;Programmer&#8221; can now copy&amp;paste and compile.</p>
<p>Cheers.</p>
<p>PS: You can also find the source in here: <a href="http://gushh.net/dev/?file=pb/centermessagebox.pb">http://gushh.net/dev/?file=pb/centermessagebox.pb</a> As usual, that&#8217;s my code repository for PB.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://gushh.net/blog/2009/07/06/things-id-like-to-see-in-the-official-purebasic-ide/" rel="bookmark" class="crp_title">Things I&#8217;d like to see in the official PureBasic IDE.</a></li><li><a href="http://gushh.net/blog/2009/03/06/going-from-basic-to-the-real-world/" rel="bookmark" class="crp_title">Going from Basic to the real world.</a></li><li><a href="http://gushh.net/blog/2010/07/18/validate-email-address/" rel="bookmark" class="crp_title">Validate email address</a></li><li><a href="http://gushh.net/blog/2010/09/08/3d-scanning-is-fun-fun-fun/" rel="bookmark" class="crp_title">3D Scanning is fun fun fun!</a></li><li><a href="http://gushh.net/blog/2008/03/03/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/" rel="bookmark" class="crp_title">Faster ways of finding a character inside a string, in PureBasic.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/2009/07/02/centered-messagerequester-messagebox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An efficient and simple object factory for PureBasic</title>
		<link>http://gushh.net/blog/2009/05/03/object-factory-for-purebasic/</link>
		<comments>http://gushh.net/blog/2009/05/03/object-factory-for-purebasic/#comments</comments>
		<pubDate>Sun, 03 May 2009 16:43:05 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[EasyObject]]></category>
		<category><![CDATA[factory]]></category>
		<category><![CDATA[GuShH]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[purebasic]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/?p=65</guid>
		<description><![CDATA[Whenever you deal with structures and what have you it&#8217;s obvious that there has to be a better way of doing it. Think about it, you encapsulate your structure-related code in such a way that it becomes clean, nice and tidy &#8212; in other words it makes it easy to understand what it does. However [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Whenever you deal with structures and what have you it&#8217;s obvious that there has to be a better way of doing it. Think about it, you encapsulate your structure-related code in such a way that it becomes clean, nice and tidy &#8212; in other words it makes it easy to understand what it does.</p>
<p>However in essence, you end up writing pretty much the same allocate / deallocate, list, etc. code every time you incorporate a new &#8220;class&#8221; into your project. Why should we?, let&#8217;s avoid it all together and focus our efforts in the task at hand rather than in the mundane stuff.</p>
<p>If you open your eyes you&#8217;ll see that this is an obvious pattern but what isn&#8217;t so obvious is how do you implement a template that deals with it in an efficient and clean way within the current constraints of the language.</p>
<p>Well&#8230; Have no fear, EasyObject is here!<br />
First, <a href="http://gushh.net/dls/easyobject.zip" target="_blank">download it</a>. Secondly, embrace it.</p>
<p>Third, you&#8217;re free to post any comments regarding on how to enhance it if you dear to!.</p>
<p><span id="more-65"></span>Ok, now let&#8217;s describe this thing a little more and leave the marketing speech in the past.</p>
<p>From the &#8220;readme&#8221;:</p>
<blockquote><p>EasyObject is an object factory template for PureBasic. It allows you to register any structure as a &#8220;class&#8221;. With EasyObject you can define constructors and destructors as well as iterators with ease.</p>
<p>The purpose of EasyObject is mainly to encapsulate trivial and redundant code usually regarded to allocation, deallocation and keeping track of the objects. The usage is fairly simple: classes can be registered and unregistered. Once a class has been registered, we can create new objects and delete them at will. If we decide to unregister a class, all of the objects will be freed and their respective destructors will be called.</p></blockquote>
<p>More from where that came from&#8230;</p>
<blockquote><p>Macros in this case are used as an aid to define templates (like you would in C++ for instance). There are certain limitations that forced me to design the template as it is right now but the usage is very simple. We&#8217;re not trying to mimic any language here but rather provide a way of dealing with objects without having to write redundant code all the time. Because overloading doesn&#8217;t exist in PB, the constructor will be called twice (once by the template and once by yourself) if you want to define the members using said ctor, just make certain that any dynamic allocations are performed only once or you&#8217;ll have a nasty memory leak in your hands.</p></blockquote>
<p>It&#8217;s clear that some limitations are present in the template but for most of the tasks this is a great addition to anyone&#8217;s code.</p>
<p>Let me know if you find any bugs!</p>
<p>Cheers,<br />
GuShH</p></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://gushh.net/blog/2009/05/10/vec3-and-easyobject-libraries-updated/" rel="bookmark" class="crp_title">VEC3 and EasyObject Libraries updated.</a></li><li><a href="http://gushh.net/blog/2009/08/05/average-template/" rel="bookmark" class="crp_title">Average template</a></li><li><a href="http://gushh.net/blog/2009/07/13/macro-templates-by-example/" rel="bookmark" class="crp_title">Macro Templates, by example.</a></li><li><a href="http://gushh.net/blog/2009/08/28/structuring-libraries-basic-design-tips/" rel="bookmark" class="crp_title">Structuring libraries, basic design tips.</a></li><li><a href="http://gushh.net/blog/2009/03/06/going-from-basic-to-the-real-world/" rel="bookmark" class="crp_title">Going from Basic to the real world.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/2009/05/03/object-factory-for-purebasic/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>StrEscape, StrQuoteMeta From PHP to PB. (quotemeta, addslashes)</title>
		<link>http://gushh.net/blog/2008/06/11/strescape-strquotemeta-from-php-to-pb-quotemeta-addslashes/</link>
		<comments>http://gushh.net/blog/2008/06/11/strescape-strquotemeta-from-php-to-pb-quotemeta-addslashes/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 16:45:43 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[addslashes]]></category>
		<category><![CDATA[fiorenza]]></category>
		<category><![CDATA[GuShH]]></category>
		<category><![CDATA[pb]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[quotemeta]]></category>
		<category><![CDATA[strescape]]></category>
		<category><![CDATA[strquotemeta]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/index.php/2008/06/11/strescape-strquotemeta-from-php-to-pb-quotemeta-addslashes/</guid>
		<description><![CDATA[If you&#8217;re used to PHP, you might of know the functions &#8216;quotemeta();&#8217; and &#8216;addslashes();&#8217; are very, very useful when dealing with user Input and similar activities where escaping certain entities (characters!) is very important. This routines, while not too elegant, do the same (or similar) job as PHP but in PB: The equivalent to quotemeta(); [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re used to PHP, you might of know the functions &#8216;quotemeta();&#8217; and &#8216;addslashes();&#8217; are very, very useful when dealing with user Input and similar activities where escaping certain entities (characters!) is very important.</p>
<p>This routines, while not too elegant, do the same (or similar) job as PHP but in PB:<br />
</p>
<address>The equivalent to quotemeta(); in PHP can be found in <a href="http://gushh.net/dev/?file=pb/StrQuoteMeta.pb">here</a>. </address>
<address>Whereas the addslashes(); counterpart is located in <a href="http://gushh.net/dev/?file=pb/StrEscape.pb">here</a>.<br />
</address>
<address> </address>
<h6><em>(I know, the PHP lexer I&#8217;m using has a bug on the PB definition, I&#8217;ll take a look later).<br />
</em></h6>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://gushh.net/blog/2010/07/18/validate-email-address/" rel="bookmark" class="crp_title">Validate email address</a></li><li><a href="http://gushh.net/blog/2010/08/26/why-i-hate-helpdesks/" rel="bookmark" class="crp_title">Why I hate helpdesks!</a></li><li><a href="http://gushh.net/blog/2008/06/11/ascii-helper-routines-part-1/" rel="bookmark" class="crp_title">Ascii helper routines, part 1</a></li><li><a href="http://gushh.net/blog/2010/07/17/get-mx-records/" rel="bookmark" class="crp_title">Get MX Records</a></li><li><a href="http://gushh.net/blog/2009/07/02/centered-messagerequester-messagebox/" rel="bookmark" class="crp_title">Centered MessageRequester() / MessageBox()</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/2008/06/11/strescape-strquotemeta-from-php-to-pb-quotemeta-addslashes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ascii helper routines, part 1</title>
		<link>http://gushh.net/blog/2008/06/11/ascii-helper-routines-part-1/</link>
		<comments>http://gushh.net/blog/2008/06/11/ascii-helper-routines-part-1/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 16:14:42 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ascii]]></category>
		<category><![CDATA[fiorenza]]></category>
		<category><![CDATA[GuShH]]></category>
		<category><![CDATA[is_alpha]]></category>
		<category><![CDATA[is_numeric]]></category>
		<category><![CDATA[is_symbol]]></category>
		<category><![CDATA[pb]]></category>
		<category><![CDATA[purebasic]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/index.php/2008/06/11/ascii-helper-routines-part-1/</guid>
		<description><![CDATA[Whenever I have to manipulate strings in PB, on a low-level (ie. per-character basis) I find it almost imperative to have the following routines included in my project: is_alpha(); is_numeric(); is_symbol(); They are amongst the most basic routines out there, however, they are still useful nonetheless. You can grab the include/source from here: http://gushh.net/dev/?file=pb/ascii_helpers.pb If [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I have to manipulate strings in PB, on a low-level (ie. per-character basis) I find it almost imperative to have the following routines included in my project:</p>
<pre> is_alpha(); is_numeric(); is_symbol();</pre>
<p>They are amongst the most basic routines out there, however, they are still useful nonetheless.</p>
<p>You can grab the include/source from here:  <a href="http://gushh.net/dev/?file=pb/ascii_helpers.pb"><span style="font-family: 'Lucida Grande'; font-size: 12px; line-height: normal; white-space: pre" class="Apple-style-span">http://gushh.net/dev/?file=pb/ascii_helpers.pb</span></a></p>
<p>If you&#8217;re working on a Lexer, Parser, or similar&#8230; this will come in handy in case you don&#8217;t have it already.</p>
<p>Cheers.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://gushh.net/blog/2008/03/03/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/" rel="bookmark" class="crp_title">Faster ways of finding a character inside a string, in PureBasic.</a></li><li><a href="http://gushh.net/blog/2009/09/05/automatic-declare-tool/" rel="bookmark" class="crp_title">Declar&#8217;em! &#8211; Automatic declaration of procedures.</a></li><li><a href="http://gushh.net/blog/2008/06/11/strescape-strquotemeta-from-php-to-pb-quotemeta-addslashes/" rel="bookmark" class="crp_title">StrEscape, StrQuoteMeta From PHP to PB. (quotemeta, addslashes)</a></li><li><a href="http://gushh.net/blog/2009/07/28/guitar-rig-3-a-couple-of-helpful-tools/" rel="bookmark" class="crp_title">Guitar Rig 3 &#8211; A couple of helpful tools.</a></li><li><a href="http://gushh.net/blog/2007/08/21/proper-coding-and-project-organization-part-1/" rel="bookmark" class="crp_title">Proper coding and project organization (Part 1)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/2008/06/11/ascii-helper-routines-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
