I have been using PBDLL and PBCC for what seems like forever.
I consider myself pretty good. I have written numerous
heavy duty programs that have been running for years.
With the help of these forums, I can't even begin to count
all the things you guys have helped me with and taught me.
I ran into something the other day and for some reason I am
drawing a total blank. (Blank Look On Face. Dha!!!!)
If I have declared 2 variables:
Dim stX as String
Dim szY as ASCIIZ * 100
If I want to CAST the stX variable to be a ASCIIZ all I need
to do is:
stX = "Something"
szY = stX
Now the string information is in the ASCIIZ variable.
However, what if I want to go the other way.
szY = "Something"
stX = szY
This should work and it does.
Now the real question.
When a function is expecting a parameter to be String but the
variable is a ASCIIZ, how can I CAST it on the fly to be
a String.
Function Hello(stX as String) as Long
' This will result in an error. Param type mismatch
Result = Hello(szY) << Parm should be of type String
I know I can first move the szY into stX but the program I
am working on would require alot of this.
Is there any way to just convert it.
Example: Result = Hello(Trim$(szY))
This will work, however, any leading or trailing spaces will be
trimmed off. NOT what I want.
I guess the short version of this whole thing is:
Is there a function for:
String = MakeStringFromASCCIZ(asciiz)
Thanks
------------------
I consider myself pretty good. I have written numerous
heavy duty programs that have been running for years.
With the help of these forums, I can't even begin to count
all the things you guys have helped me with and taught me.
I ran into something the other day and for some reason I am
drawing a total blank. (Blank Look On Face. Dha!!!!)
If I have declared 2 variables:
Dim stX as String
Dim szY as ASCIIZ * 100
If I want to CAST the stX variable to be a ASCIIZ all I need
to do is:
stX = "Something"
szY = stX
Now the string information is in the ASCIIZ variable.
However, what if I want to go the other way.
szY = "Something"
stX = szY
This should work and it does.
Now the real question.
When a function is expecting a parameter to be String but the
variable is a ASCIIZ, how can I CAST it on the fly to be
a String.
Function Hello(stX as String) as Long
' This will result in an error. Param type mismatch
Result = Hello(szY) << Parm should be of type String
I know I can first move the szY into stX but the program I
am working on would require alot of this.
Is there any way to just convert it.
Example: Result = Hello(Trim$(szY))
This will work, however, any leading or trailing spaces will be
trimmed off. NOT what I want.
I guess the short version of this whole thing is:
Is there a function for:
String = MakeStringFromASCCIZ(asciiz)
Thanks
------------------
Comment