|
-
Sep 11th, 2010, 12:02 PM
#1
Thread Starter
Junior Member
[RESOLVED] Defining large string name in vb 6
Hi,
Can anyone tell me how to define a long string name in a variable?
For example my file name is cb.21c.2010092382343476.
When i am defining as
Dim s as string & then using it for further operation, it fails & a sound from RAM generates. How to define this long file name in s
Thnkx
-
Sep 11th, 2010, 12:07 PM
#2
Re: Defining large string name in vb 6
Dim s As String should never produce any error I can think of, unless you are using s for something else.
You will need to provide more information, including the error and the related code causing that error. You are not giving us enough information to help you out. Spend a few minutes and read the short hitchhikers guide, linked in my signature below. It will help you help us to help you.
-
Sep 11th, 2010, 12:26 PM
#3
Re: Defining large string name in vb 6
 Originally Posted by sajib
& then using it for further operation....
What is that "further operation"?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Sep 11th, 2010, 12:33 PM
#4
Thread Starter
Junior Member
Re: Defining large string name in vb 6
LaVolpe, my code is like this,
Dim s as string
s = CommonDialog1.FileTitle
Actually I m trying to get the file title cb.21c.2010092382343476 into s . With this s (filename) I will do some operation, but failed to do it.
Is there any way that from this large file name [cb.21c.2010092382343476] I can get only cb & put it into string s.
Thnkx.
-
Sep 11th, 2010, 12:39 PM
#5
Re: Defining large string name in vb 6
With this s (filename) I will do some operation, but failed to do it.
Yes, but are you trying to do... Can you show us the exact code that your are using?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Sep 13th, 2010, 11:30 AM
#6
Re: Defining large string name in vb 6
Code:
Private Sub Command1_Click()
Dim s As String
s = "cb.21c.2010092382343476"
s = Left(s, 2)
MsgBox s
End Sub
-
Sep 13th, 2010, 12:10 PM
#7
Re: Defining large string name in vb 6
CommonDialog1.FileTitle <-- Try FileName ... you're getting just the title... which isn't the same as the filename (if I'm remembering correctly).... What you want is the full filename.
-tg
-
Sep 14th, 2010, 12:46 AM
#8
Thread Starter
Junior Member
Re: Defining large string name in vb 6
@techgnome,
Filename is different from Filetitle. when we define as Filename it interprets the complete path of the file but Filetitle means only name of the file...
nyways I got my problem solved by hack's method... thankx buddy.........now its only taking the 1st 2 characters from left..
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
|