Help Me about Convert Data Type 
Author Message
 Help Me about Convert Data Type

Hi,
    I'm still writting program but I found problem about I can't convert
String Variable into Long Variable. I used code bolow

dim NewLong    as LONG
dim  OldVar        as String

    OldVar = "TEST"
    NewLong = CLNG(OldVar)

 It's type mismatch I want to know How I do ?
 Please answer me  via e-mail.

                                        Regard



Sat, 21 Oct 2000 03:00:00 GMT  
 Help Me about Convert Data Type

jikko:

I do not think you understand the meaning of a long data type.

It can only hold numbers.

Have A Great Day

Rob

Quote:

>Hi,
>    I'm still writting program but I found problem about I can't convert
>String Variable into Long Variable. I used code bolow

>dim NewLong    as LONG
>dim  OldVar        as String

>    OldVar = "TEST"
>    NewLong = CLNG(OldVar)

> It's type mismatch I want to know How I do ?
> Please answer me  via e-mail.

>                                        Regard




Sat, 21 Oct 2000 03:00:00 GMT  
 Help Me about Convert Data Type

Quote:

>Hi,
>    I'm still writting program but I found problem about I can't convert
>String Variable into Long Variable. I used code bolow

>dim NewLong    as LONG
>dim  OldVar        as String

>    OldVar = "TEST"
>    NewLong = CLNG(OldVar)

> It's type mismatch I want to know How I do ?
> Please answer me  via e-mail.

>                                        Regard


You can't do it.  Long variables can only contain numbers.  The only
way you can do this is to make it an array and do somehing like:

dim NewLong(1 to 4) as long
dim OldVar as string

OldVar = "TEST"
NewLong(1) = asc(mid(OldVar,1,1))
NewLong(2) = asc(mid(OldVar,2,1))
NewLong(3) = asc(mid(OldVar,3,1))
NewLong(4) = asc(mid(OldVar,4,1)

I don't know why you want to put a string into a long value anyways...

Donkey

????????????????????????????????????????????
DOS never says "EXCELLENT command or filename"
-
Note: remove "NOSPAM" from my address
to e-mail me
????????????????????????????????????????????



Sun, 22 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help Me About Convert Data Type

2. Help Me about Convert Data type

3. help me about convert data type

4. help me about convert data type

5. problem of converting C's union type to VB's a data type

6. problem of converting C's union type to VB's a data type

7. Access 2000 converted to Access 97 report query data type errors

8. Converting Data Types in Code

9. Converting a GUID data type to a String

10. Convert date serial to a date data type

11. How to convert a GUID string to a GUID data type

12. Converting integer (or long) data type to array of bytes

 

 
Powered by phpBB® Forum Software