You are viewing our Forum Archives. To view or take place in current topics click here.
Java Help? .-. sigh
Posted:

Java Help? .-. sighPosted:

GeoDexon
  • Junior Member
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
Status: Offline
Joined: Jun 20, 201212Year Member
Posts: 74
Reputation Power: 2
so im learning java and i get this error but i have no idea what is wrong ._.

[ Register or Signin to view external links. ]
#2. Posted:
o7scape
  • New Member
Status: Offline
Joined: Feb 01, 201410Year Member
Posts: 37
Reputation Power: 1
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
#3. Posted:
GeoDexon
  • Junior Member
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,
#4. Posted:
o7scape
  • New Member
Status: Offline
Joined: Feb 01, 201410Year Member
Posts: 37
Reputation Power: 1
Status: Offline
Joined: Feb 01, 201410Year Member
Posts: 37
Reputation Power: 1
are u sure sleepcheck should be a variable not a integer
#5. Posted:
GeoDexon
  • Junior Member
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
#6. Posted:
RedMonster
  • 2 Million
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.

function sleepcheck(numHours) {
       other code here
}


then to call the function use:

sleepcheck(11);
#7. Posted:
UnrealEgg
  • Powerhouse
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.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.