Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 18th, 2006, 10:59 PM
xreddawg909x xreddawg909x is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 91 xreddawg909x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 27 m 20 sec
Reputation Power: 4
Seperate files

how do you include seperate files in the main driver program that contain function definitions.

Reply With Quote
  #2  
Old September 19th, 2006, 08:20 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
Quote:
Originally Posted by xreddawg909x
how do you include seperate files in the main driver program that contain function definitions.


I was just going start my own thread to ask the same question. However, I have tried it using php ie include 'somefile.js'; in the header, however it doesn't work. I was wondering if there's a javascript way of doing it so the file could be called in between the javascript tags in the header. the js data I have to put in another file are a load of vars etc.

Last edited by SnapCracker : September 20th, 2006 at 04:32 AM.

Reply With Quote
  #3  
Old September 19th, 2006, 08:27 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Click here for more information. Click here for more information
 
Join Date: Sep 2005
Posts: 734 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 3 Days 11 h 57 m 2 sec
Reputation Power: 4
Is this a Java or Javascript question?

Reply With Quote
  #4  
Old September 19th, 2006, 12:23 PM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
Quote:
Originally Posted by Icon
Is this a Java or Javascript question?

Oops! Wrong one sorry!

Last edited by SnapCracker : September 20th, 2006 at 04:22 AM.

Reply With Quote
  #5  
Old September 19th, 2006, 03:52 PM
xreddawg909x xreddawg909x is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 91 xreddawg909x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 27 m 20 sec
Reputation Power: 4
Java

how do you get the main driver program to include a seperate java file that contains function definitions so you can use those function via an object created in the main driver program ?

Reply With Quote
  #6  
Old September 20th, 2006, 01:29 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Click here for more information. Click here for more information
 
Join Date: Sep 2005
Posts: 734 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 3 Days 11 h 57 m 2 sec
Reputation Power: 4
Well, each java file has to include a class. If you just want 'functions' you could make a class with static methods only. You use the import statement to include the seperate file. Will this help you? Need an example, or am I on the wrong track?

Reply With Quote
  #7  
Old September 22nd, 2006, 11:52 PM
xreddawg909x xreddawg909x is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 91 xreddawg909x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 27 m 20 sec
Reputation Power: 4
i think i got it ..

i just named the java file the same as the class thanx
though

Class_name object = new Classname();

object.membefunction_name();

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Seperate files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT