-
Mar 23rd, 2015, 11:46 AM
#1
Thread Starter
Hyperactive Member
Help with ByVal as Token
Hi All
A strange one here that I haven't encountered before, I have to integrate to a third party application. Everything has gone swimmingly until I found a sub with a ByVal as token, I get a type mismatch whenever I try and pass data to it.
Code:
Public Sub TestCode(ByVal Code As token)
'blah blah blah'
End Sub
So when I pass data from my VB6 app like TestCode (1234567), it always generates a type mismatch error no matter what I do. All the other subs that are strings, integers or longs all work spot on except this token one. Does anyone have any ideas ?
Many thanks
AJ.
-
Mar 23rd, 2015, 12:29 PM
#2
Re: Help with ByVal as Token
Well what is Token? That is not a VB data type so I assume it must be a UDT or a Class you are passing a literal number and apparently it is not compatible with whatever Token is hence the mismatch.
Search your project for Token and see where it is defined and as what.
-
Mar 23rd, 2015, 12:45 PM
#3
Re: Help with ByVal as Token
Well since this is calling a thrid-party function, I doubt searchying the source code will help. But what should is reading the documentation ... find out what "token" is ... clearly it's an object of some kind. Whther it is a structure/UDT or a class makes a difference, albeit small. But likely you need to Dim something as Token ... then after setting the fields/properties of something to their proper values, you can pass something to the method.
-tg
-
Mar 23rd, 2015, 01:10 PM
#4
Re: Help with ByVal as Token
I somehow missed the 3rd party reference so yes it probably is not in the project code, may be able to see it in the object browser or buy dimming some as token like suggested above.
-
Mar 23rd, 2015, 01:20 PM
#5
Thread Starter
Hyperactive Member
Re: Help with ByVal as Token
Hi All
The documentation unfortunately isn't very helpful, the Token is supposed to be a 6 - 12 digit OTP and that's about all the information I can extrapolate from their masterpiece reference document. The function i need to call of theirs is declared as token, so even if i try and declare my own variables as something else it still doesn't work as i am connecting to an external service and token gets recognized.
-
Mar 23rd, 2015, 01:29 PM
#6
Re: Help with ByVal as Token
Right... because you need a variable defined as type "Token" ... what ever the heck that is... so delcaring it as something else isn't going to work. It's like taking an orange and trying to pass it to the Marinara method that's expecting a Tomato... might look similar (round & a fruit & with a skin) but it's still not a Tomato ...
And as a matter of pedantry and semantics, Token is not supposed to be a 6-12 digit OTP ... Token is a TYPE... Code maybe a 6-12 digit OTP (what ever OTP means) ... but you still need a variable that has been typed as Token to pass the information over.
-tg
-
Mar 23rd, 2015, 03:29 PM
#7
Re: Help with ByVal as Token
If a TOKEN type is defined in the 3rd party source, then you should be able to declare a variable as type token, i.e., Dim myToken As Token. This was suggested above. Also suggested is to look at your object browser (F2). Type Token in the search window & see what you get
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
|