## scotandz's Profile User Rating:

Reputation: 0 Apprentice
Group:
Members
Active Posts:
27 (0.02 per day)
Joined:
04-May 10
Profile Views:
846
Last Active:
Dec 07 2014 02:28 PM
Currently:
Offline

### Previous Fields

Country:
Who Cares
OS Preference:
Windows
Favorite Browser:
Internet Explorer
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Who Cares
Dream Kudos:
0

### Latest Visitors

scotandz has not set their status

1. #### In Topic: Adding 2 numbers using 3 functions

Posted 30 Jul 2013

got it working used if statement as opposed to switch though

```function num1()
{
var randomNumber1 = Math.floor((Math.random()*10)+1)
return randomNumber1;
}
function num2()
{
var randomNumber2 = Math.floor((Math.random()*10)+1)
return randomNumber2;
}
function randomMath()
{
var randomMath = Math.floor((Math.random()*4)+1)
return randomMath;
}
function sum()
{
var math = randomMath();
var n1 = parseInt(num1());
var n2 = parseInt(num2());
var total;
if (math == "1")
{
total= n1 + n2;
}
if (math == "2")
{
total= n1 - n2;
}
if (math == "3")
{
total= n1 * n2;
}
if (math == "4")
{
total= n1 / n2;
}

//alerts to check the calculation was correct

```

Next task is to remove those pointless 3 functions and change if to switch. thanks all
2. #### In Topic: Adding 2 numbers using 3 functions

Posted 30 Jul 2013

Yea thanks im in the process of trying your suggestion think i was getting a bit ahead of myself hoping it would some how know its a mathematical sign in the variable ill post my results
3. #### In Topic: Adding 2 numbers using 3 functions

Posted 30 Jul 2013

Hi

Basically im just learning javascript and i decided to make a small program that would generate 2 number randomly and a mathematical sign randomly and ask the use to input the answer if correct the user is the winner if not they are the loser i created 3 functions 2 of which returns a randomized number the other returns a randomized mathematical symbol i want to use the 3 functions to get the total so for example function1 = 10 function 2 = - function3 = 5 would give a total of 5

var total = 10 - 5;

what im looking for is

var total function1() function2() function3();

```function num1()
{
var randomNumber1 = Math.floor((Math.random()*10)+1)
return randomNumber1;
}
function num2()
{
var randomNumber2 = Math.floor((Math.random()*10)+1)
return randomNumber2;
}
function randomMath()
{
var text = "";
var possible = "/+-*";

for( var i=0; i < 4; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text.substring(3);
}
function sum()
{
var total = num1()','randomMath()','num2();
}

```
4. #### In Topic: Process.Start not working within if statement

Posted 29 Jan 2013

Skydiver, on 29 January 2013 - 06:10 AM, said:

I believe that you are close to the reason, but not quite there. I think that it' not Start.Process() that is taking time, but it's firing up and communicating to your browser that is taking time. I believe that when use only a URL, the underlying ShellExecute() will use DDE to communicate with the browser instead of simply passing the URL on the command line.

```Process.Start(url);

```

```Process.Start("IExplore.exe", url);

```

Replace "IExplore.exe", with your browser. Put in a full path if needed.

tried your suggestion and it worked first time thanks for taking the time to help.
5. #### In Topic: Process.Start not working within if statement

Posted 29 Jan 2013

tlhIn`toq, on 28 January 2013 - 07:34 PM, said:

Using the textboxes to be your variables is not recommended and I think this is an example as to why. If the GUI doesn't get a chance to update, then referencing those controls gets you null.

I would strongly suggest you stop looking at textboxblahblahblah.Text and start using properties. Uncouple this tight binding between code and GUI.

Hi i have changed it so now i have it saving to a db and reading from it into a list which asigns its values to each of the varibles so Copy1 has the value of Copy1 in the db but again while debgging the values are getting asigined and the start.process is executing each of them but if i simply run the program only one is executed its almost as if start.process is exiting before the other if staements are executed but while debiggin this isnt the case i also thought it might be something to do with how fast each of the start.process is called maby if it was to close together then the second was called before the first finished and that would be the problem but i added a time laps in each if statement but it didnt work just made my program slower lol.

### My Information

Member Title:
Age:
25 years old
Birthday:
January 14, 1989
Gender:
Years Programming:
2
Programming Languages:
C#
Vb.net

E-mail:
Private

### Friends

scotandz hasn't added any friends yet.