I'm migrating a Visual Fox Pro code to C #. NET
What makes the Visual Fox Pro: generates a string of 5 digits ("48963") based on a text string (captured in a textbox), if you always enter the same text string will get that string always 5 digits (no reverse), my code in C #. NET should generate the same string.
There is some code that I can not play in dot.net Rand (int)
in VisualFoxPro:
rand(intValue)
in C #. net:
Random r = new Random ();
return r.Next(intValue);
in C# I can´t generate a single value based on the same intValue I know they are very different libraries (VFP and C #) but not if there is any way to match the method of Visual Fox Pro and C #. Net
I want to migrate the following code (Visual Fox Pro 6 to C#)
gnLower = 1000
gnUpper = 100000
vcad = 1
For y=gnLower to gnUpper step 52
genClave = **Rand(vcad)** * y
vRound = allt(str(int(genclave)))
IF Len(vRound) = 3
vDec = Right(allt(str(genClave,10,2)), 2)
finClave = vRound+vDec
Thisform.txtPass.value = Rand(971);
Exit
Endif
Next y
outputs:
vcad = 1 return: 99905 vcad = 2 return: 10077 vcad = thanks return: 17200