|
-
Aug 25th, 2004, 02:46 PM
#1
Thread Starter
New Member
Strings as parameters
Dear all,
I would like to pass a string as parameter to a form that would modify it. Then, as a result, I would like, when finish the form, to change this variable.
Observe that the I will need to access the parameter in many subs and functions before it is ready to be returned.
I am thinking use pointers to this string to have how to modify it?
How can I do it?
If I pass a Label.Caption as parameter, could I modify it on a function?
Thanks in advance,
Nizam
-
Aug 25th, 2004, 02:52 PM
#2
The picture isn't missing
Why did you post the same post twice?
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 25th, 2004, 02:59 PM
#3
Thread Starter
New Member
I didn't know that VBForums and VBExtreme was the same site and I was wanting to publish my doubt in many places to have a fast answer. Do u know how to solve this problem frd?
-
Aug 25th, 2004, 03:06 PM
#4
Hyperactive Member
i didnt understand your problem exactly but maybe you mean this...
If I pass a Label.Caption as parameter, could I modify it on a function?
Label.Caption = sCaption
then sCaption variable can be changed in a function or sub you just need to declare it at very top of your code in Declarations area... -.- or module.......
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Aug 25th, 2004, 03:11 PM
#5
Thread Starter
New Member
But when I do this and change sCaption I will not change Label1.Caption, will I?
Actually I would like my form woks like a function.
-
Aug 25th, 2004, 03:15 PM
#6
The picture isn't missing
Originally posted by nizam
I didn't know that VBForums and VBExtreme was the same site and I was wanting to publish my doubt in many places to have a fast answer. Do u know how to solve this problem frd?
I meant this: http://www.vbforums.com/showthread.p...hreadid=302417
Anyways, usually you would use ByRef, but apparently you can't for the Caption property. You can still do something like this though:
VB Code:
private sub Whatever(byval SomeStr as String)
SomeStr="hello"
end sub
'in another procedure
dim tmp as string
tmp=Label1.Caption
whatever tmp
Label1.Caption=tmp
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 25th, 2004, 03:24 PM
#7
Thread Starter
New Member
ByRef or ByVal? Because I want to pass the reference as parameter and not the value, right?
-
Aug 25th, 2004, 03:39 PM
#8
Dbl posting is a bad habit.
Read my reply to your other thread.
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
|