Converting from atom to sequence & Vica Versa

new topic     » topic index » view thread      » older message » newer message

------=_NextPart_000_0007_01C045D1.1030F820
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

Help please

I can now convert a atom to a sequence but how to I go the other way.
I need to create three random numbers between 1 and 99. The third number =
must be between the NullFrom and the NullTo fields.

--  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 )
global constant LText6 =3D create( LText, "Last Wheel Null Zone", =
SafeWindow, 32, 184, 116, 20, 0 )
global constant NullFrom =3D create( EditText, "", SafeWindow, 172, 184, =
40, 20, 0 )
global constant NullTo =3D create( EditText, "", SafeWindow, 224, 184, =
40, 20, 0 )
-------------------------------------------------------------------------=
-------
procedure CreateButton_onClick ()
object temp, temp2
temp =3D rand(99)
setText(OneNumber,sprintf("%d", temp))=20
temp =3D rand(99)
setText(TwoNumber,sprintf("%d", temp))

-- here is where I want this last number to be between NullFrom and =
NullTo
-- It must loop until a random number is created within this parametre

temp =3D rand(99)
setText(ThreeNumber,sprintf("%d", temp))
end procedure




onClick[CreateButton] =3D routine_id("CreateButton_onClick")



WinMain( SafeWindow, Normal )


------=_NextPart_000_0007_01C045D1.1030F820
        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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Help please</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I can now convert a atom to a sequence =
but how=20
to&nbsp;I go the other way.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I need to create three random numbers =
between 1 and=20
99. The third number must be between the NullFrom and the NullTo=20
fields.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>--&nbsp; code generated by Win32Lib IDE =

v0.9</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>include Win32Lib.ew<BR>without =
warning</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
----------------<BR>--&nbsp;=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 )<BR>global constant LText6 =3D create( LText, "Last Wheel =
Null Zone",=20
SafeWindow, 32, 184, 116, 20, 0 )<BR>global constant NullFrom =3D =
create(=20
EditText, "", SafeWindow, 172, 184, 40, 20, 0 )<BR>global constant =
NullTo =3D=20
create( EditText, "", SafeWindow, 224, 184, 40, 20, 0=20
------------<BR>procedure=20
CreateButton_onClick ()<BR>object temp, temp2<BR>temp =3D=20
rand(99)<BR>setText(OneNumber,sprintf("%d", temp)) <BR>temp =3D=20
rand(99)<BR>setText(TwoNumber,sprintf("%d", temp))</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-- here is where I want this last =
number to be=20
between NullFrom and NullTo<BR>-- It must loop until a random number is =
created=20
within this parametre</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>temp =3D=20
rand(99)<BR>setText(ThreeNumber,sprintf("%d", temp))<BR>end=20
procedure</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>onClick[CreateButton] =3D=20
routine_id("CreateButton_onClick")</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>WinMain( SafeWindow, Normal=20

------=_NextPart_000_0007_01C045D1.1030F820--

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu