I am not sure what this code was supposed to do. There are some syntax error here, e.g.
 
a. view should be View
b. The import statement should be outside of the View constructor.
c. Also note that there are some "," related bugs.
d. Lastly you are not showing the View, so you will not see it and so its contents.
 
Try this:
 
{let v:View =
    {View
        {Canvas
            width = 9cm,
            height = 8cm,
            {ShapeGroup
                translation = {Distance2d 0cm, 7cm},
                {RectangleShape
                    {GRect 0cm, 1cm, 1cm, 0cm},
                    color = "#006968",
                    translation = {Distance2d (1.1cm * 1), 0cm}
                },
                {RectangleShape
                    {GRect 0cm, 1cm, 5cm, 0cm},
                    color = "#2462a2",
                    translation = {Distance2d (1.1cm * 6), 0cm}
                }
            }
        }
    }
}
 
{v.show}
 
{value
    let random:Random = {Random}
    {random.next-in-range 1, 1328}
}
----- Original Message -----
From: pang tee
Sent: Saturday, December 17, 2005 5:09 AM
Subject: Re: Generating Random number

Hi,
 
Ultimately, I hope to get the random number appearing between 2 bouncing balls displayed in an applet and a new random number shows up everytime someone clicks on a button.
 
I tried the code below but does not seem to be working.
 
Is there something i am missing. Also, do you know how i can create bouncing balls in Curl?
 
Thanks,
PangTee
{curl 4.0 applet}
{curl-file-attributes character-encoding = "windows-latin-1"}
{applet manifest = "file:///c:/manifest.mcurl",
    {compiler-directives careful? = true}
}
{view
{import * from CURL.GUI.SHAPES}
{Canvas
    width = 9cm,
    height = 8cm,
    {ShapeGroup
        translation = {Distance2d 0cm, 7cm},
        {RectangleShape
            {GRect 0cm, 1cm, 1cm, 0cm},
            color = "#006968",
            translation = {Distance2d (1.1cm * 1), 0cm}
        },
        {RectangleShape
            {GRect 0cm, 1cm, 5cm, 0cm},
            color = "#2462a2",
            translation = {Distance2d (1.1cm * 6), 0cm}
        }
    }
   {value
    let random:Random = {Random}
     {random.next-in-range 1, 1328}
},
 
}  
}

pang tee <[EMAIL PROTECTED]> wrote:
Thanks. I wrote the below code but would like to try to change it to use RolledRandom.next-roll instead. Can someone guide me with the change?
 
I keep getting syntax errors.

{View
{value
    let random:Random = {Random}
     {random.next-in-range 1, 1328}
},
    visibility = "normal",
    {on WindowClose do
        {exit}
    }
}
 
Thanks,
PangTee

Kamal Bhatt <[EMAIL PROTECTED]> wrote:
Use the class Random.
 
{value
    let random:Random = {Random}
 
     {random.next-float}
}
 
Note that Random had several methods to get a random int16, int32, uint8, etc 
----- Original Message -----
From: pang tee
Sent: Friday, December 16, 2005 6:29 AM
Subject: Re: MenuManager and MenuItem.get-prev

does anyone have a simple example of a random number generator created and displayed in Curl? I want to replace the current usage of _javascript_ Math object to generate and display a random number.
 

 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply via email to