You are viewing our Forum Archives. To view or take place in current topics click here.
Java Help? .-. sigh
Posted:
Java Help? .-. sighPosted:
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
#2. Posted:
Status: Offline
Joined: Feb 01, 201410Year Member
Posts: 37
Reputation Power: 1
change if (numHours to if (sleepcheck
there no point in initializing sleepcheck if you arent going to use it
there no point in initializing sleepcheck if you arent going to use it
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
my main concern is the error on the first line.. i have no idea how that is wrong ,0,
- 0useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Feb 01, 201410Year Member
Posts: 37
Reputation Power: 1
are u sure sleepcheck should be a variable not a integer
- 0useful
- 0not useful
#5. Posted:
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
im just following the instructions the website gave :| so if i read everything right idk what is wrong with it
- 0useful
- 0not useful
#6. Posted:
Status: Offline
Joined: Dec 24, 200915Year Member
Posts: 1,224
Reputation Power: 58
Status: Offline
Joined: Dec 24, 200915Year Member
Posts: 1,224
Reputation Power: 58
Create a function, not a var.
then to call the function use:
function sleepcheck(numHours) {
other code here
}
then to call the function use:
sleepcheck(11);
- 0useful
- 0not useful
#7. Posted:
Status: Offline
Joined: May 30, 201014Year Member
Posts: 438
Reputation Power: 49
Status: Offline
Joined: May 30, 201014Year Member
Posts: 438
Reputation Power: 49
In javascript you can define a function as a var. I'm not aware of which is the better approach but I know you can.
Removing the semicolon on on line 3 should get rid of the error. Then call sleepcheck(11); as suggested in the previous post.
Removing the semicolon on on line 3 should get rid of the error. Then call sleepcheck(11); as suggested in the previous post.
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.