Results for "Category: String Manipulation"
Ok, this time all the bugs are fixed. Apparently it was giving file errors (Not for me) but thats fixed now guaranteed. If you asked it its age it came out wrong, fixed. Apparantly somebody said one of the files was missing. ell I ve double checked this time.
After looking here and a few other places for a simple code that allows only numerals and not to allow text to be pasted into a textbox and with no prevail I figured it out. Not a major thing but for beginners this will help them.
Updated to v1.1, Fixed few bugs. I always feel I loose a lot of time formating my msgbox strings. String Maker is a program that formats your "normal text" into a variable string usable in visual basic. Lets say, for example, you want a msgbox to show this: ------------------------------------- Warning: The "input" parameters found in the data size field can generate a general protection error ------------------------------------- String maker will format it for you to just copy and paste like this: MyString = "-------------------------------------" & vbNewLine MyString = MyString & " Warning:" & vbNewLine MyString = MyString & "The " & chr(34) & "input" & chr(34) & "parameters" & vbNewLine MyString = MyString & "found in the data size" & vbNewLine MyString = MyString & "field can generate a" & vbNewLine MyString = MyString & "general protection error" & vbNewLine MyString = MyString & "-------------------------------------" Then you could use it like: MsgBox mystring It also has the capability to create SQL table strings: MyString = "CREATE TABLE [tblThisTable] (" MyString = MyString & "[fldBinary] Binary(20)," MyString = MyString & "[fldBit] BIT," MyString = MyString & "[fildInteger] Short," MyString = MyString & "[fldText] Text(240)" MyString = MyString & ")" All you have to do is execute the string like dbobject.execute mystring. And, as always, it also shows the use of MDI projects, menus, tray icon, popup menu in the tray icon, selections, etc... You are allowed and encouraged to continue this project to grow its capabilities... just keep me informed. Thanx to the guy of the tray area control. Note that you must use the exit menu command to close the program, since pressing the X button in the window's controls will just send the program to the tray area... Pretty much like audiogalaxy. -Fongus
This code show you how to count the letters, numbers, characters ("A","b",etc.), Spaces, Word's, Lenght, etc. in a text.
This is a subroutine to automatically wrap a text string in whole words to a printer.
ever made a program capable of showing barcodes ? if you did than you`ve been there ,,, at the oficial EAN standards site,, than you would have seen how to calculate the check digit. they hold the standard they publish that standard also on their website ,,, http://www.ean-int.org/index800.html i never found code in VB that calculates the check digit ,, so my conclusion is that it was hold for comercial reassons ( there are lots of controls out there for a lot of monney :-) so i donate this M. Posseth code to the public and make it public domain ,,, uhmmm votes would be apreciated :-)
I hope I'm not the only person who wants to cringe every time I see something like "You have been online for 1 minutes." 1 minutes?? I see this kind of thing everywhere; here on PSC, even. It looks very unprofessional to me, and it's so easy to fix! That's why I listed this code as beginner level. Hopefully, Planet Source Code will implement this code and I won't have to see that I got an excellent vote from "1 users." ;-) I would like to hear any comments you have about this code. Also, please click to see my other submissions to PSC. My latest program, Music Maker is nearing the top of the Code of the Month list. If I can get a few more votes it would really help me out! :-) Thanks for looking!
Break up variables in a string, whatever separator is used.
The ODL Converter Project is designed to take VB Types, Enums and Declare Statements and convert them into a format used by Visual C++'s .odl files (odl = Object Description Language). This also shows how to colorize code, for those who are interested
Removes extra spaces from given string. eg. Squeeze("^^too^^many^^^spaces^^")returns "too^many^spaces". NB.Read a carat ^ as a single space above. Planet Source code mangles multiple spaces in submitted text.
A small ultra-fast function used to count the number of words in a string.
If you want your strings routines to be as fast as possible, learn C. If you don't want to learn C use string mapping, its nearly as fast and pure VB. In this article I give you the silver bullet for strings. If strings are bottlenecking your code, I'm your new best friend. I've included a project that attempts to visualize the string for you. It also contains a word count comparision which uses four methods string mapping being the fastest by far (compiled).
Pads a string with any character you like. I usually use it to pad numbers with leading zeros. But you can use it for other things.
The Most difficult Thing in VB..How to Get UNICODE From Pointer Of Ansi String..
Shell sort is a greath sorting method,but I find "FIRST ARRAY BUG" after resorting array list,and fix it! See The Different beetween SHELL and BUBBLE!
Not like other cra*py word counters. You cant fool this one. Here are some errors i fixed that i saw in other word counters. If you still see an error in mine please inform me! 1) In some counters "This is a test" will read 10 words. Why? it counts the double/triple/etc... spaces in between. 2)On some if you add spaces to the end, it wont count them as words 3)It counts the first word, unlike some 4)Commented 5)If you add spaces to the beggining of the word it wont count as an extra word. 6)Typing no text will not result in counting 1 word unlike some counters 7)typing all spaces will not result in 1 or 2 words unlike some. Well there are the errors ive seen and fixed, please inform me of more errors if you spot them.
A textbox for TCP/IP or DNS entry with validation and formatting. It behaves like Windows TCP/IP entry. Very nice in developing program that requires valid IP entry.
Scripting engine based off pointers and OP codes. Updated 4/6/02(I fixed the order of operations problem, I think:)
parse a string with a delimiter... choose your own delimiter and replace it with whatever you want to. Very basic.. but it works. :)
tis is a simplest way of validating user input. Yust open the project and press F5... check TAG properti in text boxes... You can program validation in RUN TIME or at DEVELOPMENT TIME...