
September 25th, 2008, 11:09 AM
|
|
|
|
VBScript - How do you ADD two Variables multiplied ...
I don't think this title explains what I'm trying to ask here.
K, so, I was brainstorming the other night and came across a challenge (Well, at least for me it's a challenge).
Let's see if I can describe this.
Code:
Function GetNumber()
Randomize
GetNumber = Round(FormatNumber(Int((13 * Rnd) + 1)))
End Function
intVarA = GetNumber()
intVarB = GetNumber()
strVarA = " + " & intVarA
strAdditAll = Left(strVarA, intVarB)
MsgBox intVarA & " x " & intVarB & " = " & (intVarA * intVarB) & vbCrLf & _
"This means you add " & intVarA & ", " & intVarB & " times, like so, " & vbCrLf & _
intVarA & strAdditAll & " = " & (intVarA * intVarB)
As you can see, I'm not getting the same results.
How can I take these two variables and display them added together to get the same results as the multiplication equation ?? Another words, how can I add intVarA, intVarB times ??
Wow, I don't even understand what I'm asking
Thank you in advance for allowing me to put you through this mess. it's fun though isn't it ?? 
|