|
-
Jul 15th, 2018, 04:00 PM
#1
Thread Starter
New Member
I have a function in VB6 where I am trying to return a string from the function
So here is a code snippet. The error I am getting is "Function call on left side of assignment must return Variant or Object". I changed the function return to a variant data type, but that did not help.
I am trying to generate a random string using function calls. Because it is a large number of sub tables I want to maintain the tables separated like so instead of in a single long series of code for ease of maintainability.
If this is not viable, can anyone suggest an alternative method of doing this?
Private Function GenAstStrategicResouce() As Variant
Dim X As Integer
X = Int((200 * Rnd) + 1)
If X < 10 Then
GenStrategicResouce = "Bose-Einstein Condensates"
ElseIf X < 20 Then
GenStrategicResouce = "Diamonds"
End If
End Function
Tags for this Thread
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
|