473,511 Members | 10,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting a int32 from a string (VB6)

Subject line says it all really.
I have a 4 character long string, that contains a 32bit integer. Problem is
i have no idea how i go about extracting it.

Any help will be appreciated.
Jul 17 '05 #1
2 3648
On Fri, 14 Nov 2003 12:39:07 -0000, "Sammy" <no@isp.com> wrote:
Subject line says it all really.
I have a 4 character long string, that contains a 32bit integer. Problem is
i have no idea how i go about extracting it.

Any help will be appreciated.


It may be 4 characters long, but due to the perversity of MS, it is 8
bytes
Private Declare Sub MoveString _
Lib "kernel32" _
Alias "RtlMoveMemory" _
(Dest As Any, _
ByVal Source As String, _
ByVal Bytes As Long)
Public Function CVL(S$) As Long
If Len(S$) < 4 Then
MsgBox "CVL Error - String too Short"
Exit Function
End If
Call MoveString(CVL, S$, 4)
End Function

Jul 17 '05 #2
Perfect, thanks very much for the help.

Sammy.

"J French" <er*****@nowhere.com> wrote in message
news:3f****************@news.btclick.com...
On Fri, 14 Nov 2003 12:39:07 -0000, "Sammy" <no@isp.com> wrote:
Subject line says it all really.
I have a 4 character long string, that contains a 32bit integer. Problem isi have no idea how i go about extracting it.

Any help will be appreciated.


It may be 4 characters long, but due to the perversity of MS, it is 8
bytes
Private Declare Sub MoveString _
Lib "kernel32" _
Alias "RtlMoveMemory" _
(Dest As Any, _
ByVal Source As String, _
ByVal Bytes As Long)
Public Function CVL(S$) As Long
If Len(S$) < 4 Then
MsgBox "CVL Error - String too Short"
Exit Function
End If
Call MoveString(CVL, S$, 4)
End Function

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10448
by: cassandra.flowers | last post by:
Hi, I am using VB6 and want to extract text from a string. But ONLY take out words that begin with 't' or 'd'. The mainstring is input by the user into 'txtMain' and then by clicking a command...
2
2808
by: Dickyb | last post by:
Extracting an Icon and Placing It On The Desktop (C# Language) I constructed a suite of programs in C++ several years ago that handle my financial portfolio, and now I have converted them to...
1
4841
by: Hifni Shahzard | last post by:
Hi, I got a stored procedure, where it returns a value. But if I execute it. It gives an error as "Invalid cast from System.Int32 to System.Byte.". To make clear how do I execute this, below I'm...
3
3615
by: Richard | last post by:
how can I extract an icon from a fil for example this sentence "F:\WINDOWS\System32\shell32.dll,3" how can I extract icon nr 3 from the shell32.dll?? I found some code for VB6 that might...
0
1151
by: Ankit Aneja | last post by:
string comm="CONTSCAN E:\\projects backup\\ankitclam backup\\Clamtest\\testing\\hello.txt\r\n" int x=comm.Length; x=x-7; string path; path=comm.Substring(9,x); MessageBox.Show(path); it...
2
2688
by: ammmmmu | last post by:
Hi all, I need a code to extract the sub string from a string in VB6 EX I have a string str = "Post your QSquestion in a relevant forum" and I want to store the word which starts from QS...
1
2585
by: northerntechie | last post by:
Ok, I don't normally post (I would rather rummage around in the thoughts and frustrations of others) but this one has got me stumped. I am using MS VB 2005 Express and I am using a COM object...
6
3897
by: geegeegeegee | last post by:
Hi All, I have come across a difficult problem to do with extracting UniCode characters from RTF strings. A detailed description of my problem is below, if anyone could help, it would be much...
2
1792
by: Per Juul Larsen | last post by:
hi. I do want to extract this string "abcdefg" from string "C:\dir1\dir2\abcdefg-12345gsd" Note : the length of the text string "abcdefg" may vary, but the last character is always "-". I...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.