|
-
May 31st, 2000, 02:03 PM
#1
Thread Starter
Addicted Member
I think i am right in this but i need some advice.
If i wanted to store a string into a variable..would i use this in a part of my code too store it?
Dim strName As String
Private Sub_text1()
Name = " "
end sub
Is the (" ") the correct way to store the string??
I know this must be a very basic question to all of you..but the damn book i have never gets to the point of something..the author just rambles on and on..
If someone could tell me of a good visual basic book that is straight to the point and very good for a beginner....i need a book that teaches...not a book on run-on sentances..
thank you.
-
May 31st, 2000, 02:18 PM
#2
Addicted Member
Quotes DO mean strings...
Code:
Dim myString As String
myString = "I am the evil Sophtware!!!"
' $ means string; no Dim needed...
ymString$ = "Yes, I meant to put ym instead of my!"
' This would show you your strings...
MsgBox myString & vbCrLf & ymString$
' as opposed to non-strings...
Dim myNumber As Integer
myNumber = 1800
-
May 31st, 2000, 03:05 PM
#3
transcendental analytic
Name is a used property of most objects (in this case Me.Name)
and it is readonly so you will get an error.
Either use of prefixes or careful use of names wont.
Yeah strings can be stored in code, but also in control properties, but don't store binary data in textboxes.
Also to have special characters you can use chr(asciinumber) vb constants (check up visual basic constants)
Code:
"HEre comes some characters" & chr(1) & chr(255) & chr(17) & " and here they end" & _
vbcrlf & "That was a carriage return ""this is quoted"" & _
vbtab & "that was a tab"
[Edited by kedaman on 06-01-2000 at 11:08 AM]
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 31st, 2000, 04:05 PM
#4
Conquistador
Code:
Option Explicit
Dim strName As String
Private Sub_text1()
strName = " "
end sub
You should put option explicit at the front of your code, then it will give you hell if you have something undeclared,
and use the same name for the string as the one you declARed, don't declard it strName and use the name "Name" cause it will not work.
-
May 31st, 2000, 04:10 PM
#5
Lively Member
I think that the web, such as this site will teach you a lot, as you have learnt already, ppl here do answer simple question for ya. The one book that i've got however is "Sams Teach Yourself VB in 21 Days" and i got a huge discount off it on amazon. That book and this site is what taught me everything i know....(err....well ) so have fun, and enjoy programming in m$'s brilliant language...CHOKE CHOKE.... lol
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
May 31st, 2000, 04:48 PM
#6
New Member
I agree with Mag-Net, you will be able to learn many things from the combined eternal knowledge from the people you talk with in this cool place.
----------------------------------
If all fails, there must be a VINFOC - Virus In Front Of Computer
-- /\/\/C
-
May 31st, 2000, 11:18 PM
#7
Thread Starter
Addicted Member
-
Jun 1st, 2000, 03:22 AM
#8
Thread Starter
Addicted Member
One more question, once i have stored the text into a string what code should i input into my command button to display the message into another text box?
I have two text box's and one command button
the first text box property name is "txtMessage" and the second text box's property name is "txtMessage1".
I want to transfer the stored information that a user puts into "txtMessage" into "txtMessage1",when the user presses the command button.
What code do i use?
Thank you.
-
Jun 1st, 2000, 03:36 AM
#9
transcendental analytic
In the commandbutton Click event put
Code:
txtMessage1=txtMessage
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|