title:
Put the knife down and take a green herb, dude.
descrip:
One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com
Self-Pimpin':
Member of an email list?
You need The Digest Handler !!
FOR ENTERTAINMENT PURPOSES ONLY!!! Back-up your data and always wear white.
URLs I want to remember:
* Atari 2600 programming on your Mac
* joel on software (tip pt )
* resume , mostly for Google
* Regular Expression Introduction
(copy )
* gpl xbrowser API for dhtml
* mulder (old css tutorial)
* Using CommonDialog in VB 6
* Free zip utils
* that hardware vendor review site I forget about is here
*
Javascript 1.5 ref
* Read the bits about the zone
* w3c.org index of HTML 4.01 elements
* Mozilla COM control
* Quick intro to Javascript
* Editable Firefox Page
* Parsing str's in VB6
email if ya gotta ,
RSS if ya wanna RSS
- Archives -
11/01/2001 - 12/01/2001
12/01/2001 - 01/01/2002
01/01/2002 - 02/01/2002
02/01/2002 - 03/01/2002
03/01/2002 - 04/01/2002
04/01/2002 - 05/01/2002
05/01/2002 - 06/01/2002
06/01/2002 - 07/01/2002
07/01/2002 - 08/01/2002
08/01/2002 - 09/01/2002
09/01/2002 - 10/01/2002
10/01/2002 - 11/01/2002
11/01/2002 - 12/01/2002
12/01/2002 - 01/01/2003
01/01/2003 - 02/01/2003
02/01/2003 - 03/01/2003
03/01/2003 - 04/01/2003
04/01/2003 - 05/01/2003
05/01/2003 - 06/01/2003
06/01/2003 - 07/01/2003
07/01/2003 - 08/01/2003
08/01/2003 - 09/01/2003
09/01/2003 - 10/01/2003
10/01/2003 - 11/01/2003
11/01/2003 - 12/01/2003
12/01/2003 - 01/01/2004
01/01/2004 - 02/01/2004
02/01/2004 - 03/01/2004
03/01/2004 - 04/01/2004
04/01/2004 - 05/01/2004
05/01/2004 - 06/01/2004
06/01/2004 - 07/01/2004
07/01/2004 - 08/01/2004
08/01/2004 - 09/01/2004
09/01/2004 - 10/01/2004
10/01/2004 - 11/01/2004
11/01/2004 - 12/01/2004
12/01/2004 - 01/01/2005
01/01/2005 - 02/01/2005
02/01/2005 - 03/01/2005
03/01/2005 - 04/01/2005
04/01/2005 - 05/01/2005
05/01/2005 - 06/01/2005
06/01/2005 - 07/01/2005
07/01/2005 - 08/01/2005
08/01/2005 - 09/01/2005
09/01/2005 - 10/01/2005
10/01/2005 - 11/01/2005
11/01/2005 - 12/01/2005
12/01/2005 - 01/01/2006
01/01/2006 - 02/01/2006
02/01/2006 - 03/01/2006
03/01/2006 - 04/01/2006
04/01/2006 - 05/01/2006
05/01/2006 - 06/01/2006
06/01/2006 - 07/01/2006
07/01/2006 - 08/01/2006
08/01/2006 - 09/01/2006
09/01/2006 - 10/01/2006
10/01/2006 - 11/01/2006
11/01/2006 - 12/01/2006
12/01/2006 - 01/01/2007
01/01/2007 - 02/01/2007
02/01/2007 - 03/01/2007
03/01/2007 - 04/01/2007
04/01/2007 - 05/01/2007
05/01/2007 - 06/01/2007
06/01/2007 - 07/01/2007
07/01/2007 - 08/01/2007
08/01/2007 - 09/01/2007
09/01/2007 - 10/01/2007
10/01/2007 - 11/01/2007
11/01/2007 - 12/01/2007
12/01/2007 - 01/01/2008
01/01/2008 - 02/01/2008
02/01/2008 - 03/01/2008
03/01/2008 - 04/01/2008
04/01/2008 - 05/01/2008
05/01/2008 - 06/01/2008
06/01/2008 - 07/01/2008
07/01/2008 - 08/01/2008
08/01/2008 - 09/01/2008
09/01/2008 - 10/01/2008
10/01/2008 - 11/01/2008
11/01/2008 - 12/01/2008
12/01/2008 - 01/01/2009
01/01/2009 - 02/01/2009
02/01/2009 - 03/01/2009
03/01/2009 - 04/01/2009
04/01/2009 - 05/01/2009
05/01/2009 - 06/01/2009
06/01/2009 - 07/01/2009
07/01/2009 - 08/01/2009
08/01/2009 - 09/01/2009
09/01/2009 - 10/01/2009
10/01/2009 - 11/01/2009
11/01/2009 - 12/01/2009
Thursday, December 04, 2008
Parsing strings in VB 6
I don't know why, but when I need to code something ugly and quickly, I use VB6. When I need to parse lines, I use String functions instead of regexps. I tell myself it's because it's hard to anticipate how flawed, complicated regexps might work. This is true. Not a good excuse, but it's true. regexps can be difficult to debug. Still, there's something I freakin' always screw up, and that's finding a substring in a line and cutting it into two. So here's some code for idiots that are me. Dim strTest As String Dim strToFind As String strTest = "this is a long line of words" strToFind = "long" Debug.Print "#" & InStr(strTest, strToFind) & "#" Debug.Print "#" & Left(strTest, InStr(strTest, strToFind)) & "#" Debug.Print "#" & Right(strTest, Len(strTest) - InStr(strTest, strToFind)) & "#" Debug.Print Debug.Print "#" & Left(strTest, InStr(strTest, strToFind) - 1) & "#" Debug.Print "#" & Right(strTest, Len(strTest) - (InStr(strTest, strToFind) + Len(strToFind))) & "#" Here's our result:#11# #this is a l# #ong line of words# #this is a # #line of words# I don't know why, but I get more OBO errors doing this than I can stand. ---------------- Now playing: The Black Crowes - Cursed Diamond
Labels: code , vb6
posted by ruffin
at 12/04/2008 11:52:00 PM
0 comments
- Archives -
11/01/2001 - 12/01/2001
12/01/2001 - 01/01/2002
01/01/2002 - 02/01/2002
02/01/2002 - 03/01/2002
03/01/2002 - 04/01/2002
04/01/2002 - 05/01/2002
05/01/2002 - 06/01/2002
06/01/2002 - 07/01/2002
07/01/2002 - 08/01/2002
08/01/2002 - 09/01/2002
09/01/2002 - 10/01/2002
10/01/2002 - 11/01/2002
11/01/2002 - 12/01/2002
12/01/2002 - 01/01/2003
01/01/2003 - 02/01/2003
02/01/2003 - 03/01/2003
03/01/2003 - 04/01/2003
04/01/2003 - 05/01/2003
05/01/2003 - 06/01/2003
06/01/2003 - 07/01/2003
07/01/2003 - 08/01/2003
08/01/2003 - 09/01/2003
09/01/2003 - 10/01/2003
10/01/2003 - 11/01/2003
11/01/2003 - 12/01/2003
12/01/2003 - 01/01/2004
01/01/2004 - 02/01/2004
02/01/2004 - 03/01/2004
03/01/2004 - 04/01/2004
04/01/2004 - 05/01/2004
05/01/2004 - 06/01/2004
06/01/2004 - 07/01/2004
07/01/2004 - 08/01/2004
08/01/2004 - 09/01/2004
09/01/2004 - 10/01/2004
10/01/2004 - 11/01/2004
11/01/2004 - 12/01/2004
12/01/2004 - 01/01/2005
01/01/2005 - 02/01/2005
02/01/2005 - 03/01/2005
03/01/2005 - 04/01/2005
04/01/2005 - 05/01/2005
05/01/2005 - 06/01/2005
06/01/2005 - 07/01/2005
07/01/2005 - 08/01/2005
08/01/2005 - 09/01/2005
09/01/2005 - 10/01/2005
10/01/2005 - 11/01/2005
11/01/2005 - 12/01/2005
12/01/2005 - 01/01/2006
01/01/2006 - 02/01/2006
02/01/2006 - 03/01/2006
03/01/2006 - 04/01/2006
04/01/2006 - 05/01/2006
05/01/2006 - 06/01/2006
06/01/2006 - 07/01/2006
07/01/2006 - 08/01/2006
08/01/2006 - 09/01/2006
09/01/2006 - 10/01/2006
10/01/2006 - 11/01/2006
11/01/2006 - 12/01/2006
12/01/2006 - 01/01/2007
01/01/2007 - 02/01/2007
02/01/2007 - 03/01/2007
03/01/2007 - 04/01/2007
04/01/2007 - 05/01/2007
05/01/2007 - 06/01/2007
06/01/2007 - 07/01/2007
07/01/2007 - 08/01/2007
08/01/2007 - 09/01/2007
09/01/2007 - 10/01/2007
10/01/2007 - 11/01/2007
11/01/2007 - 12/01/2007
12/01/2007 - 01/01/2008
01/01/2008 - 02/01/2008
02/01/2008 - 03/01/2008
03/01/2008 - 04/01/2008
04/01/2008 - 05/01/2008
05/01/2008 - 06/01/2008
06/01/2008 - 07/01/2008
07/01/2008 - 08/01/2008
08/01/2008 - 09/01/2008
09/01/2008 - 10/01/2008
10/01/2008 - 11/01/2008
11/01/2008 - 12/01/2008
12/01/2008 - 01/01/2009
01/01/2009 - 02/01/2009
02/01/2009 - 03/01/2009
03/01/2009 - 04/01/2009
04/01/2009 - 05/01/2009
05/01/2009 - 06/01/2009
06/01/2009 - 07/01/2009
07/01/2009 - 08/01/2009
08/01/2009 - 09/01/2009
09/01/2009 - 10/01/2009
10/01/2009 - 11/01/2009
11/01/2009 - 12/01/2009