|
-
Aug 6th, 2005, 04:05 PM
#1
Thread Starter
Junior Member
How Split?
How I can split this passage?
Color [A=255, R=100, G=200, B=50]
and I get 255,100,200 and 50 to one array or variable?
-
Aug 6th, 2005, 04:38 PM
#2
Re: How Split?
You mean parse out the argb values of a Color?
VB Code:
Dim oColor1 As System.Drawing.Color = Color.Red
Dim iA As Integer
Dim iR As Integer
Dim iG As Integer
Dim iB As Integer
iA = oColor1.A
iR = oColor1.R
iG = oColor1.G
iB = oColor1.B
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 6th, 2005, 04:55 PM
#3
Thread Starter
Junior Member
Re: How Split?
very thanks
but if I want split "Color [A=255, R=100, G=200, B=50]"
and get numbers from that, I must do?!
-
Aug 6th, 2005, 04:56 PM
#4
Re: How Split?
You have that as a string? You are probably getting that from the Color.FromArgb?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 6th, 2005, 05:03 PM
#5
Thread Starter
Junior Member
Re: How Split?
that's an example
for this string "my cost = 30530$"
how I can discrete 30530 from another string?
-
Aug 6th, 2005, 05:30 PM
#6
Fanatic Member
Re: How Split?
I don't know much about them but you might be able to use Regular Expresions (RegEx) to find numbers inside a string. But if they need to be identified as in your first example, things get complicated.
There is no 'magic' function to do this, for each situation you will have to write a specific function. String parsing is also very error-prone because it is hard to think of all the variations you might encounter.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Aug 6th, 2005, 07:34 PM
#7
Re: How Split?
You can use .SubString and other string functions to parse the number.
VB Code:
Dim str As String = "my cost = 30530$"
Dim iNum As Integer = str.IndexOf("=", 0)
str = str.Substring(iNum + 1)
str = str.Substring(0, str.Length - 1)
MessageBox.Show(str) '30530
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 7th, 2005, 06:32 AM
#8
Thread Starter
Junior Member
-
Aug 7th, 2005, 04:39 PM
#9
Re: How Split?
But note that the format of the string needs to remain with the numbers after the "=" sign and the last character always being necessary to be trimmed off.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|