Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Easy , Adding Strings..


Hi.. may I know how to add two string in VB..
in C++, I do

Code:

CString str1,str2, str;
str1 = "c:\myfolder" ;
str2 = "pagecount.txt";
str = str1+ "\" + str2;
ofstring file;
file.open(str);



in VB I wrote,

Code:

Dim fileName As String
fileName = frmPrinterProperties.IDpath.Text & "pagecount.txt"
IDprefix.Text = fileName
Open fileName For Output As iFileNum ' opening file.. pagecount.txt

but only "pagecount.txt" shows and I can't open the file.. how to fix that?

thank you




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Really Easy Question About Strings
hi all, this one is really easy.
i have a string MyStr$, and i want to remove from it the first 3 lines and the last 2.

thanks..

Here Is An Easy Question {formatting Strings}
How do i display formatted text in a text box? Financial data in this case. I know I can brute my way through this by adding ".00" or "0" to the end of the string. But this is barbaric and there would seem to be a better way to do it in this wonderful language. Thanks in advance.

[VB] Message Strings Easy To Change
Hello All,

I am looking for a way to be able to change my strings in label boxes and message boxes with one quick change right before compile..

example of this would be something like this.

frmInitialization.lblWaitMessage.Caption = myMsgArray(ArrayIndex).InitMessage




where message class is
Public myMsgArray(0 To 5) As MyMessageClass

Public ArrayIndex as Integer
ArrayIndex = 0 ' THIS SHOULD BE THE ONLY THING I SHOULD HAVE TO CHANGE

Public Type MyMessageClass
Name As String
InitMessage As String
LoginId As String
LoginPass As String
End Type

myMsgArray(0).InitMessage = "Welcome, Please wait while Something happens"
myMsgArray(0).LoginId = "Please enter your Nextel Login Id"
myMsgArray(0).Name = "Nextel 500 Pro UserId"
myMsgArray(0).LoginPass = "Please Enter your Password"

myMsgArray(1).InitMessage = "Welcome, Please wait while Something Else happens"
myMsgArray(1).LoginId = "Please enter your Cocaine re-order Login Id"
myMsgArray(1).Name = "Cocaine re-order UserId"
myMsgArray(1).LoginPass = "Please Enter your Password"


Picture this senario as having 200 fields in the "MyMessageClass" class
what I would also love to do is include images and Icons in this "Class" so once it is tested I only have to change the value of arrayIndex and BAM working like a charm...

I don't know what other way is more efficient then this one...
any help would be great..

Adding Two Strings Together
In this function I use the left method to seperate a string, and then combine it with another string in a Select Case function. Here is the code I have:

Function convPeriod(strPeriod As String)

Dim strMon As String
Dim strYear As String
strMon = UCase(Left(strPeriod, 3))
strYear = Right(strPeriod, 3)

Select Case strMon

Case "JAN"
convPeriod = JAN&strYear
Case "FEB"
convPeriod = JAN&strYear&;&FEB&strYear
End Select
End Function


I get an error at the highlighted area saying Expected: End of Statement

Any ideas? I know it is something simple but I just cant figure it out. Thanks.

Adding Two Strings Together
I'd like to add two strings together, which contain one byte data each.
Let's call them "p0" and "p1". "sum1" would be the result.
For example in "p0" there is F1h and in "p1" there is 55h if I add them together, the result is 155h, which should be in "sum1"
How do I do this?
thank you

Adding Strings
I need to make a 6 function calculator, it works fine with *,- and , but messes up with the +'ing (eg. 2 + 2 = 22). How do I make this work?

Also, could you explain MOD's and DIV's: Roughly what they are and how they work?

Thanks

BTW: I'm new here, Hello.

Adding Up 2 Strings
i have strA and strB
strA = 1
strB = 1
i try text1.text = strA + strB

but it doesn't work the result is 11 not 2 why?

Adding Strings
I have 3 strings like this:

String1=Word1

String2=Word2

String3=Word3

I want to build a fourth string as a result of adding the previous 3:

String4=String1+String2+String3

or

String4=Word1-Word2-Word3 (separated by "-")

Can you give me help on this one?
Thanks in advance.

Adding Strings
Is there an equivalent of the val() function in VBScript? I am getting string concatentation using (although they are numbers):

Score.Text = Score.Text + Bonus.Text

Thanks for any help.

Adding Strings
Is it possible to set up a scenario like this:



txtHelp(0).text = "is"
txtHelp(1).text = "it"
txtHelp(2).text = "possible"

if txtHelp(0 and 1 and 2) = "is it possible" then
Boolean is true

How would I go about setting this up?

Help Me Please... About Adding Strings...etc
This time i will make it clear what i am trying to establish...please help me...
firstly, i have lots of files with extension *.zip(for example 123.zip) after i unzip them it gives me *.mp3(123.mp3-same name but different extension). However, there are some spoilt zip files which does not produce *.mp3. What i want is to del those zip files which is successfully extracted to give its mp3 files, and then keep the spoilt ones. i have created the batch file to delete the zip files but it does not spare the spoilt ones. therefore i thought of a way by using the command "dir/b *.mp3 > goodmp3.bat" to produce the list of unzip files, then i use a string replacement program to edit the goodmp3.bat by replacing all ".mp3" strings with ".zip" string. Now goodmp3.bat contains the list of zipfiles that are not spoilt. while the rest are spoilt. i can rename the bat file into a textfile therefore, by adding "del " to every line in the goodmp3.bat file, i can del the good zip files and keep the bad ones. can someone help me on this, how to do that(by adding string to everyline valid-not empty lines) using visual basic? is there a better and faster way?

In additional, Can someone help me on the part:
adding "del " string to every line of the batch file and stop adding after the last valid line with a filename is reached
the list goes like this:
1.zip
dcasd.zip
asdad.zip
asdasd.zip
...etc

what i want is the final file:
del 1.mp3
del dcasd.mp3
del asdad.mp3
del asdasd.mp3
...etc
with out adding any unneccessary "del "
to those empty lines that follow in the end of the file

Adding Strings To Each Other
For i = 3 To 53
        Dim clLoc As String
        clLoc = "B"+(Format(String)(i))
       
That last line is where the problem is... So i want the string clLoc to end up being something like "B5" but i keep getting a usage error. I know it's something to do with my format...

NOT Adding Strings
I have a routine that runs through an array of textboxes - my intent is to add them all together and update a master box:
Code:
Public Sub Total_Installs()


Dim i
i = 1
Do While i <= 12
    TotalInstallTick = 1
    
     frmMatPackageEditor.txtTotalInstalls.Value = frmMatPackageEditor.txtTotalInstalls.Value + (frmMatPackageEditor.Controls("txtMonth" + CStr(i)).Value)
    i = i + 1
Loop

End Sub


Trouble is that it concatenates the strings rather than adding the values... I think it has something to do with the way that I am referring to the textboxes; is there any better way to do this (apart from defining every single textbox?)

Thanks!

-----------------------------
looks like another bug...

Adding Strings To Registry
ok well im an idiot and need someone with a brain to help. Im trying to store strings in the registry's Value area but keep getting Unicode instead of normal characters? here's the code:

'This program needs 3 buttons

Code:
Const REG_SZ = 1 ' Unicode nul terminated string
Const REG_BINARY = 3 ' Free form binary
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
phkResult As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" _
(ByVal hKey As Long, _
ByVal lpValueName As String) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" _
(ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal lpReserved As Long, _
lpType As Long, _
lpData As Any, _
lpcbData As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" _
(ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal Reserved As Long, _
ByVal dwType As Long, _
lpData As Any, _
ByVal cbData As Long) As Long
Function RegQueryStringValue(ByVal hKey As Long, ByVal strValueName As String) As String
Dim lResult As Long, lValueType As Long, strBuf As String, lDataBufSize As Long
'retrieve nformation about the key
lResult = RegQueryValueEx(hKey, strValueName, 0, lValueType, ByVal 0, lDataBufSize)
If lResult = 0 Then
If lValueType = REG_SZ Then
'Create a buffer
strBuf = String(lDataBufSize, Chr$(0))
'retrieve the key's content
lResult = RegQueryValueEx(hKey, strValueName, 0, 0, ByVal strBuf, lDataBufSize)
If lResult = 0 Then
'Remove the unnecessary chr$(0)'s
RegQueryStringValue = Left$(strBuf, InStr(1, strBuf, Chr$(0)) - 1)
End If
ElseIf lValueType = REG_BINARY Then
Dim strData As Integer
'retrieve the key's value
lResult = RegQueryValueEx(hKey, strValueName, 0, 0, strData, lDataBufSize)
If lResult = 0 Then
RegQueryStringValue = strData
End If
End If
End If
End Function
Function GetString(hKey As Long, strPath As String, strValue As String)
Dim Ret
'Open the key
RegOpenKey hKey, strPath, Ret
'Get the key's content
GetString = RegQueryStringValue(Ret, strValue)
'Close the key
RegCloseKey Ret
End Function
Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String)
Dim Ret
'Create a new key
RegCreateKey hKey, strPath, Ret
'Save a string to the key
RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData)
'close the key
RegCloseKey Ret
End Sub
Sub SaveStringLong(hKey As Long, strPath As String, strValue As String, strData As String)
Dim Ret
'Create a new key
RegCreateKey hKey, strPath, Ret
'Set the key's value
RegSetValueEx Ret, strValue, 0, 1, CByte(strData), 4
'close the key
RegCloseKey Ret
End Sub
Sub DelSetting(hKey As Long, strPath As String, strValue As String)
Dim Ret
'Create a new key
RegCreateKey hKey, strPath, Ret
'Delete the key's value
RegDeleteValue Ret, strValue
'close the key
RegCloseKey Ret
End Sub
Private Sub Command1_Click()
Dim strString As String
'Ask for a value
strString = InputBox("Please enter a value between 0 and 255 to be saved as a binary value in the registry.", App.Title)
If strString = "" Or Val(strString) > 255 Or Val(strString) < 0 Then
MsgBox "Invalid value entered ...", vbExclamation + vbOKOnly, App.Title
Exit Sub
End If
'Save the value to the registry
SaveStringLong HKEY_CURRENT_USER, "KPD-Team", "BinaryValue", CByte(strString)
End Sub
Private Sub Command2_Click()
'Get a string from the registry
Ret = GetString(HKEY_CURRENT_USER, "KPD-Team", "BinaryValue")
If Ret = "" Then MsgBox "No value found !", vbExclamation + vbOKOnly, App.Title: Exit Sub
MsgBox "The value is " + Ret, vbOKOnly + vbInformation, App.Title
End Sub
Private Sub Command3_Click()
'Delete the setting from the registry
DelSetting HKEY_CURRENT_USER, "KPD-Team", "BinaryValue"
MsgBox "The value was deleted ...", vbInformation + vbOKOnly, App.Title
End Sub
Private Sub Form_Load()
'KPD-Team 1998
'URL: [url]http://www.allapi.net/[/url]
'E-Mail: [email]KPDTeam@Allapi.net[/email]
Command1.Caption = "Set Value"
Command2.Caption = "Get Value"
Command3.Caption = "Delete Value"
End Sub

Is there a way of sending strings, of normal ASNI, to the "Data" area of a registry key? If the above code doesnt work here is a link to where I got the code. It's from Allapi.net

http://www.allapi.net/apilist/RegCreateKey.shtml#

Ex: I want to store a string like this "Cats taste like chicken" in the Data section og the registry. Any ideas?

Adding Integers To Strings
How would I add an integer to a string.

Like
Dim y As Integer
Dim x As String

y = 1
x = "number"

Then add it to be "number 1" as a string

Why Is VB Adding The Characters (hex) 0D And 0A To The End Of My Strings?
I have to save a string that ends in chr(0).. but vb is adding chr(&h0d) + chr(&h0A) to the end of the string..

the sub i use to save is

Public Sub SaveData(tData As String, mLoc As String)
On Error Resume Next
fileCont = FreeFile
Open mLoc For Output As #fileCont
Print #1, tData
Close #fileCont
End Sub

VB Math - Adding Strings?
I have three strings which count the amount of characters, symbols and numbers in a document. I need to know how to add the three strings to get a Total ouput. For example:

Characters: 10
Numbers: 10
Symbols: 10

Total: Add the three above to get 30.

The code used is:


VB Code:
Dim vstring As StringDim vstring2 As StringDim vstring3 As Stringvstring$ = (txtMain.Text)vstring2$ = (txtMain.Text)vstring3$ = (txtMain.Text)frmMessage!lblMessage.Caption = "Characters: " & CountCharacters(vstring$) & vbNewLine & "Numbers: " & CountNumbers(vstring2$) & vbNewLine & "Symbols: " & CountSymbols(vstring3$) & vbNewLine & "" & vbNewLine & "Total: "            frmMessage.Show vbModal


Thanks

Adding Strings To List
Hi everyone!

I have a list window named "ListView" to which I add strings of text.

I use the command:

Set NewLine = ListView.ListItems.Add(, , "text")

Now I would like to add a string below the previous one (on the next line), not after it as my command does (on the same line).

Is this possible and if so which command do I use?

Thanks!

Regex Does Not Work After Adding Two Strings
Can somebody explain me why it is that when I add 2 strings up like so:

string1 = "&lt;page&gt;&lt;column&gt;1111111111&lt;/column&gt;&lt;column&gt;22222222
<br>"

string2 = "-----222222&lt;/column&gt;&lt;column&gt;3333333333&lt;/column&gt;&lt;/page&gt;
<br>"

string3 = string1 + string2

the object pattern I use does not work

objRE.Pattern = "&lt;page&gt;.*?&lt;/page&gt;"

The strange stuff is that when I just said
string3 ="&lt;page&gt;&lt;column&gt;1111111111&lt;/column&gt;&lt;column&gt;22222222
<br>-----222222&lt;/column&gt;&lt;column&gt;3333333333&lt;/column&gt;&lt;/page&gt;
<br>"

it works like a charm!

In both cases string3 outputs the same string in my VB debug Immediate Window...

Sequential Adding Of Strings In A Listbox
Hello all, any help is highly appreciated..

i have 3 text boxes namely tbname, tbcompany and tbaddress. When the users inputs some data in the above fields it should get added to a list box in a single row.. Like the ex:

Ex: Name Company Address { these are labels only}
Scsii PSI factor W.Virginia

The user should be able to add as many records. I would also
like to know how do i remove a particular row from the listbox. Suppose if the user selects a row in the listbox and clicks remove the data in that row should be deleted.. please advise

Adding Strings Together To Make Variables?
Hi,
is it possible to add together strings to declare and set variables?

i.e.

dim node & count as ListNode
set node & count = new ListNode

where count is a number the increases.

Thanks
Nick

Easy VB Adding?
Well, when i try to add 5 different numbenrs in the 5 different text boxes, it doesnt *** properly....

'If intTestPercentage + intQuizPercentage + intAssPercentage + intHWPercentage + intExamPercentage > 100 Then
'MsgBox "you have put more then 100%"

'ElseIf intTestPercentage + intQuizPercentage + intAssPercentage + intHWPercentage + intExamPercentage < 100 Then
'MsgBox "you have put less then 100%"

'ElseIf intTestPercentage + intQuizPercentage + intAssPercentage + intHWPercentage + intExamPercentage = 100 Then
'frmMarkScheme.Hide
'frmEditClass1.Show

As you can see, the 5 numbers have to equal 100, but they never do when they do actually add up to 100. It always says "you have put more then 100%" even when its equal to or less then 100. But when 1 textbox has the numbers, it works perfectly, telling me if i put over 100% or less than 100% or it exits successfully...

Im new to VB so show me some love

Replacing Strings In RichTextBox Control W/out Adding To File Length
Is there a way to insert text into a richtextbox control without increasing the length of the file?

I have a word document that serves as a fax sheet and I've converted it to .rtf so I can load it into an rtb control. I wrote some code that will take input from another form and write it to the rtfText on the control. I set selStart where I want the string to appear, I set selLength equal to length of the string, and I set selRtf equal to the string, which is the input from another form. This works, but I notice that the text below moves the number of characters I just added. This is bad because it effects the format of the document and it causes the document to print out a blank page. What can I do?

Adding Another One String To The List Of Strings From Table Or Query In Combo Box (MS
I'm working with MS Access

I want to make such thing with combo box: it's necessary to make a choice from a set of values what are already written into table, but if it's needed to add another one value to the table it should be done through the special string in combo box. Choosing of this string should start an add dialog.

So the questions:

1. To use the set of values from a table or a query it's required to set "RowSourceType" property of combo box to "Table/query", in this case SQL string should be assigned to "RowSource" property. How can I add another one string to the list of combo box, except values from the table, in this case??? And what should be another case, if it's impossible to add string in this case

2. How to process choosing from combo box. List Box has ListIndex property, do Combo Box have something similar?



If somebody knows help me please!

Adding A Counter To An Easy Program
Hello everyone, Diesel here. I have one more question that I hope someone can help. The program that I have created, tells you in a messagebox if the letter r or n is the a word when you type it in an inputbox. But, my problem is that I have to make it count the amount of r's and n's in the word. The program is really easy, but it's a problem I just can't get around.
Here's the code...
Dim word As String, num1 As Integer, num2 As Integer

Private Sub cmdexit_Click()
End
End Sub

Private Sub CmdStart_Click()
num1 = 0
num2 = 0
Call jinput(word, num1, num2)
Call jprocess(word, num1, num2)
Call joutput(word, num1, num2)
End Sub
Private Sub jinput(word As String, num1 As Integer, num2 As Integer)
word = UCase(InputBox("Enter a word"))
End Sub
Private Sub jprocess(word As String, num1 As Integer, num2 As Integer)
num1 = InStr(word, "N")
num2 = InStr(word, "R")
End Sub
Private Sub joutput(word As String, num1 As Integer, num2 As Integer)
If num1 > 0 Then
MsgBox "This word contains the letter N"
Else
MsgBox "Sorry no N, try again"
End If
If num2 > 0 Then
MsgBox "This word contains the letter R"
Else
MsgBox "Sorry no R, try again"
End If
If num1 = 0 Then
num1 = 1000
End If
If num2 = 0 Then
num2 = 1000
End If
If num1 > num2 Then
MsgBox "The letter R comes first"
End If
If num2 > num1 Then
MsgBox "The letter N comes first"
End If
End Sub
Thanx
diesel

Easy Solution For Adding And Subtracting Time
I have two combo boxes. In each combo box the user can select a time. It basically is for a user to select what time he wants to run a certain train pattern. So lets say in the one combo box, he selects 8:00 and in the next he selects 12:00. What i need to do is find the difference and display how many hours the pattern is run. In this case it is 4 hours if it is 8:00 AM to 12:00PM and 16 hours if it is 8:00 AM to 12:00 AM. You see the mess you can get into. But, does vb have some time format that would make this easy to do, that would automatically do time subtraction and addition. Any suggestions would be greatly appreciated.

Thanks,

Jeff

Easy Method For Adding Alpha Channel To Bitmaps
Ok. The game I am writing uses 24 bit BMPs. I am really interested in converting these to 32-bit to support alpha channeling. What is the easiest method for doing this? And once I have them converted what is the easiest method for setting the alpha channel? Is there a way to directly edit the first byte? (I think that's the one for the alpha channel). Finally, once I have a 32-bit BMP which directdraw (or directxgraphics) function is best for handling these bitmaps?

StatusBar Problems... Adding Text (quick And Easy... Help!)
If I have a statusbar, that is NOT set to simple, how do I add, or change text in different parts of the status bar, if it has multiple sections...?

Parsing Long Text Strings Into Shorter Strings
Any help on the following would be greatly appreciated!

I need to split a long text string (variable in length) into shorter strings which are no more than 60 (or X) characters in length, but only breaking on full words (i.e. no hyphenation).

Example: The target string could be a full paragragh such as: "Customer called and wanted to know how to post invoices using a past invoice date, and yet age the invoices as of a future invoice date. I told her this would violate the integrity of her accounts receivable system, but would contact one of our systems analysts regarding a quote on the number of hours required. I informed her I would send out a software modification agreement to her within one (1) week.”

I need to break it into shorter strings (of X length, in this case 60) which I can use and insert into other text fields. The above paragraph would be parsed into separate strings as follows:

“Customer called and wanted to know how to post invoices ”
“using a past invoice date, and yet age the invoices as of a “
“future invoice date. I told her this would violate the “
“integrity of her accounts receivable system, but would “
“contact one of our systems analysts regarding a quote on “
“the number of hours required. I informed her I would send “
“out a software modification agreement to her within one (1) “
“week.”

Thanks for your help!

Anyone Have A Function To Return In An Array All Strings Between 2 Inputted Strings?
For example

a string (myString) contains
<html><table id =whatever><tr><td>some data</td><td>some more data</td>...... etc etc etc

anyone have a function where i can go
myArray = GetBetween("<td>","</td>",myString)

and myarray would be

myarray(0) = some data
myarray(1) = some more data

anyone know?

Why Wont This Work? EASY EASY EASY
Option Explicit
Dim numbers(10) As Integer
Dim counter As Integer

Private Sub Command1_Click()
counter = 1
While counter < 10
Preserve numbers(10)
lblDisplay = numbers(counter)
counter = counter + 1
Wend
End Sub

Needs to display #'s 1 to 10 using this method

EASY EASY EASY Quesation, Just Woundering!!!
What does this mean, I see it at the top of code windows and I just woundered what it is there for. Every one probably knows this but I don't cause it isn't mentioned I any books on VB.


Code:
Option Explicit

How To Extract Strings From Within Other Strings With The Use Of Delimiters
I have put a web page's html code into a string and now I am trying to extract a string from within that string. I.E. I need to get access to the meta tags. These are denoted by the following

<meta name "keywords" content = $$$, $$$, $$$, $$$ ......>

I was hoping to be able to extract this string by using the < and > as delimiters. Can this be done? Grateful for any help.

Activate Command Button Excel - EASY, EASY
This is probably as basic as questions come. I have no problems with VB coding have done plenty of that and have tested my code but now, I want my code to be executed when a command button (embedded in the worksheet) is pressed. I have created a new command button from the ActiveX Control Toolbox and placed it on my spreadsheet, BUT, when I click on it, it selects the button, allows me to resize or move it but that's not what I want. I want it to execute the Command1_Click function.

Help greatly appreciated...

Easy Upper Case Question..or Not So Easy?
This is probably easy. Using txtfirst.text, how do I convert each letter to uppercase AS IT IS TYPED.

I am trying to use:
old = txtFirst.SelStart
txtFirst.Text = UCase(txtFirst.Text)
txtFirst.SelStart = old

But if text is entered in lowercase, it types the text backwards in uppercase.

Help?!

Thanks!

Easy Answer To An Easy Question
I want to populate a combobox for a filelist. How can I do it?

Do Until Index = File1.ListCount

Combo1.AddItem File1.FileName
File1.listIndex = File1.listIndex + 1
Loop

Easy Maths Question (yes, Easy!)
I have two points, X1,Y1 and X2,Y2. I want to find the value from true north of X1,Y1 that X2,Y2 is.

How do I do it? I know you have to find the distance between the points, eg. X1 - X2, Y1 - Y2, but beyond that I have no idea. ;-)

If you don't know what I mean, then look here:

........o

....|
....o/

| is true north, / is the angle. o are the points. Ignore the .'s. =)

-Git

[Edited by git on 10-08-2000 at 05:10 AM]

Searching For Strings Within Your Strings...
I am trying to write a program using Visual Basic.Net / 6.0 that will search through a very long piece of text pasted into a text-box.

Inside the text-box are patterns of numbers like this, representing a file number

12345-123456
12345-123456-1234
1234

and patterns of numbers with letters like this, representing the location code

01R05AA02F

The above represents one occurrence of possibly hundreds in a single document. Between the file number and the location code is extraneous information that needs to be separated from the file number and the location code.

My approach at first was to delete the extraneous information from the text-box. After some time of debatable progress, I decided to try the opposite – pull the desired information into a new text-box. Getting hung up here also.

I have been trying various string manipulations, Find, Like, Instr, IndexOf, etc… I feel like I am on the right track but my Monday morning deadline is rapidly approaching and stress has begun to surface.

I was hoping someone may be able to lend me some wisdom, please.

Filtering Strings With AND/OR Strings?!
Euhm.. the topic isnt the best explanation..

I want my users to be able to enter a string like:
"rocket and port graffiti"

When i the textfile with all the rows i want to filter it out
with AND/OR.

So it should display only rows that contains "rocket" AND "graffiti", along with rows containing "graffiti".

Any suggestions from all you gurus?

// Peter

Gettings Strings Out Of Strings
hey.
lets say i have this string:
S678N33P10H108H111

what i want to do, is split it between every letter. for instance, in this case, i would want to split it here
S678|N33|P10|H108|H111
so then while its splitting, i can read the first letter, and its numbers, do some stuff my program needs to do, then continue to the next splitted string which would be N33

any help? if u need more a clearer explanation, just post.

Easy Easy Easy Question
This solution to this is very simple but I can't for the life of me remember it. I've been out of VB for a while.

I have the following SQL statement...


VB Code:
strWriteData = "INSERT INTO Clinic_Info(ID,Location_Num) " & _                     " VALUES (strUniqueID,strLocation)"


When I print this to the immediate window it's sending Oracle the names strUniqueID and strLocation. I don't want it to do this, I want it to (obviously) send in the VALUES of these variables. Not the variable names!

NOTE: That code might contain a syntax error because I just typed a quick example.

Easy Easy Question
What is the command for a carriage return when displaying text?
Thanks (:
By the way, anyone out there know how create a new Task in outlook 2K, but in Public Folders, not in your private mailbox.
this is the code that creates the new task, how though, to get it in a custom task folder in public folders

Set NewTask = ThisOutlookSession.CreateItem(olTaskItem)

Thanks)

Two Easy Questions That Are Too Easy To Ask.
I'm writing a program that inputs text into a textbox.

Now I need 2 things:
1) How can I erase the last character from the text box?
2) How can I copy the contents of the text box to the clipboard so that it can be easily pasted elsewhere?

All of which I need to do by pressing a button.

Thanks in advance.

~Complex Solutions to Simple Problems!!~
CornEmpire Ruler
http://www.cornempire.com

Here An Easy EASY Question For Someone
I want to make the textbox show *'s for a password, how do i do that >=), mua ha ha

Easy Easy Question
is there a way in visual basic to delete a folder that contains files our other folders, like a deltree in dos.
I've tried "rmdir (path)" but there is a error if the folder contains file.
thanxs

Adding An Image To A RTF Textbox???, Adding Tables To A RTF Textbox??
How can I add an Image to a rtf textbox???

And what about positioning it to the text, left, center, right, top, middle, bottom????

I also would like to be able to add a table to the textbox.

Anyone done this???

/Smirre

About Strings
Im working on a RPG and i need to load a map file to strings when the game loads (To speed up the process) and load the map from the strings.

First of all the strings will look something like this(But MUCH MUCH longer)

From
1111111203111111
0000000456000000
0000000191000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000

i get
Row$(1)=1111111203111111
Row$(2)=0000000456000000
Row$(3)=0000000191000000
Row$(4)=0000000000000000
Row$(5)=0000000000000000
Row$(6)=0000000000000000
Row$(7)=0000000000000000
Row$(8)=0000000000000000

I can do that part but this i cant

I load each character to a integer variable
Example

from
Row$(1)=1111111203111111

i get
Map%(0,0)=1
Map%(1,0)=1
Map%(2,0)=1
Map%(3,0)=1
Map%(4,0)=1
Map%(5,0)=1
Map%(6,0)=1
Map%(7,0)=2
Map%(8,0)=0
Map%(9,0)=3

How do I load a certian character from a string?

Strings
When dealing with a parsed string, I am having a WEIRD problem. Basically, when I have a string of MANY parsed items, like the windows SYSTEM directory and it's files, I can split it up and put it into a listbox, and every single file is listed, when it is the ONLY operation that winsock performs. Example:

Code:
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim Data As String, Files() as String
Winsock.GetData Data
Files = Split(Data,"*")
For i = LBound(Files) To UBound(Files)
List1.AddItem Files(i)
Next i
End Sub

When winsock can perform numerous operations using the "Select Case" method, it will only list about half of the items, if even that. Example:

Code:
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim Data As String, Files() as String, Request() as String
Winsock.GetData Data
Request = Split(Data,"#")

Select Case Request(0)

Case "FILE"
Files = Split(Data,"*")
For i = LBound(Files) To UBound(Files)
List1.AddItem Files(i)
Next i
Exit Sub

End Sub
I hope that I explained this clearly. Somebody please help!

VB Strings To Dos...
Hi
Im currently Making a program to simplify the netsend command by running it through a windows form. I have two textboxes (one for the target e.g. user or computer, an one for the Message) When someone clicks the button, both texboxes are declared as strings (Target and Message). Then I need to run the SHELL command and for it to enter "net send" then Target then Message all in one command and run it.

So far I have tried:

Dim sCommand As String
sCommand = "net send " & Target & Message
Shell("cmd.exe c" & sCommand)


Please help me!!!

Copyright © 2005-08 www.BigResource.com, All rights reserved