![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Newbie
Join Date: Oct 2005
Location: The othe side
Posts: 19
Rep Power: 0
![]() |
Class problem
I have a problem in that I have created this class below it is designed to allow the user to set the full path to a file and store that data in the variable fullPath, but when I try to retreive that data in the fullPath variable and try to use it in the main program
Quote:
Quote:
Can any one help?
__________________
Cheers Ithaqua |
||
|
|
|
|
|
#2 |
|
Newbie
Join Date: Oct 2006
Location: Australia - Gold Coast
Posts: 8
Rep Power: 0
![]() |
Hi,
I am not quite sure what you are trying to do here exactly...(and I am a novice ..) The FileDetails class has a private string to hold the file address in, but it only seems to have one method... a get (an accessor). If you want to specify the file path wouldn't you need to set it? Also in your main program wouldnt you then need to call on the get method to get that address string?
__________________
Everything works out in the End...so if its not all worked out...your not at the end! |
|
|
|
|
|
#3 |
|
Programmer
|
I am not sure what you are trying to achieve here. YOu have a property which is read only. So you can not allow a user to set full path through it. you can only get what ever is in the fullpath variable.
If you set it up earlier then there could be some other problems. You have not mentioned what kind of error it is generating. File not found or like that.
__________________
Iftikhar Ahmed Khan For doing an experiment on programmer's mood please visit http://uxisfyp1.brunel.ac.uk/cspgiak |
|
|
|
|
|
#4 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
@Iftikhar: This has been mentioned before, but perhaps you don't get it.
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2006
Posts: 12
Rep Power: 0
![]() |
your property in class is read-only! why?
you can make it read-write... Property FullPathAndFilename() As String set(vaslue as string) _fullPath = value end set Get Return _fullPath End Get End Property |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rs232 class problem | Brent | C++ | 3 | Jun 29th, 2006 6:38 PM |
| 1 class, 1 problem = 1 big headache | Eric the Red | Java | 7 | May 24th, 2006 12:49 AM |
| Problem with class constructor | paeck | C++ | 8 | Feb 7th, 2006 1:53 PM |
| problem with user defined class mixed with functions | willj729 | C++ | 4 | Oct 9th, 2005 4:26 PM |
| MFC/OpenGL: problem with 'Document' class | brenda | C++ | 11 | May 23rd, 2005 9:10 PM |