How to create random @ put in field using winlib
------=_NextPart_000_0013_01C0436F.7D3C2B60
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
This is probably elementary to most of you but I want to create a random =
number between 1 and 100 and then place it in a field as below. Please =
help.
-- code generated by Win32Lib IDE v0.9
include Win32Lib.ew
without warning
-------------------------------------------------------------------------=
-------
-- Window SafeWindow
global constant SafeWindow =3D create( Window, "Random Safe Codes", 0, =
90, 148, 680, 696, 0 )
global constant OneNumber =3D create( EditText, "", SafeWindow, 48, 68, =
36, 20, 0 )
global constant TwoNumber =3D create( EditText, "", SafeWindow, 108, 68, =
36, 20, 0 )
global constant ThreeNumber =3D create( EditText, "", SafeWindow, 164, =
68, 36, 20, 0 )
global constant CreateButton =3D create( PushButton, "Create Code", =
SafeWindow, 80, 104, 90, 30, 0 )
-------------------------------------------------------------------------=
-------
procedure CreateButton_onClick ()
object temp =20
temp =3D 1
while temp < 48 do
temp =3D rand(99) =20
end while =20
setText(OneNumber,{temp})=20
end procedure
onClick[CreateButton] =3D routine_id("CreateButton_onClick")
WinMain( SafeWindow, Normal )
------=_NextPart_000_0013_01C0436F.7D3C2B60
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This is probably elementary to most of =
you but I=20
want to create a random number between 1 and 100 and then place it in a =
field as=20
below. Please help.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>-- code generated by Win32Lib IDE =
v0.9</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>include Win32Lib.ew<BR>without =
warning</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial=20
----------------<BR>-- =20
Window SafeWindow<BR>global constant SafeWindow =3D create( Window, =
"Random Safe=20
Codes", 0, 90, 148, 680, 696, 0 )<BR>global constant OneNumber =3D =
create(=20
EditText, "", SafeWindow, 48, 68, 36, 20, 0 )<BR>global constant =
TwoNumber =3D=20
create( EditText, "", SafeWindow, 108, 68, 36, 20, 0 )<BR>global =
constant=20
ThreeNumber =3D create( EditText, "", SafeWindow, 164, 68, 36, 20, 0 =
)<BR>global=20
constant CreateButton =3D create( PushButton, "Create Code", SafeWindow, =
80, 104,=20
90, 30, 0=20
------------<BR>procedure=20
CreateButton_onClick ()<BR>object temp <BR>temp =
=3D=20
1<BR>while temp < 48 do<BR>temp =3D rand(99) <BR>end =
while =20
<BR>setText(OneNumber,{temp}) <BR>end procedure<BR>onClick[CreateButton] =
=3D=20
routine_id("CreateButton_onClick")</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>WinMain( SafeWindow, Normal=20
------=_NextPart_000_0013_01C0436F.7D3C2B60--
|
Not Categorized, Please Help
|
|