You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

steveraymon

Beginner

  • "steveraymon" is male
  • "steveraymon" started this thread

Posts: 3

Date of registration: Nov 4th 2010

Location: Telford UK

Occupation: IT Consultant

Hobbies: IT Music

  • Send private message

1

Monday, October 10th 2011, 10:11pm

Text from a file

Hello
Can anybody tell me whats wrong with this code:
Dim FNam As String
Dim FNr As Integer
FNam = "C:\Test.txt"
FNr = 1

Open FNam, Output, FNr
Print FNr, "anything"
Close FNr

Just trying to open a text file for input and output....but i cant...its so frustrating.... ?(
Thanks.

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Tuesday, October 11th 2011, 12:08am

RE: Text from a file

Can anybody tell me whats wrong with this code:


Nothing is wrong with your code.
On my computer with WinXP it works perfct. Here as Console Application:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
Public Sub main(ByJava args() As String)
  Dim FNam As String
  Dim FNr As Integer
  FNam = "C:\Test.txt"
  FNr = 1

  Open FNam, Output, FNr
  Print FNr, "Irgendwas ist hier faul"
  Close FNr
End Sub


Possibly it helps to mention the class from where Open, Print and Close comes from direct:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
Public Sub main(ByJava args() As String)
  Dim FNam As String
  Dim FNr As Integer
  FNam = "C:\Test.txt"
  FNr = 1

  FileSystem.Open FNam, Output, FNr
  FileSystem.Print FNr, "Irgendwas ist hier faul"
  FileSystem.Close FNr
End Sub


Don't know why it don't run on your computer.
Do you use Win Vista or Win 7, then it can be possible, that your program have no access to C:\.
What is the error message.

As you can see at
[ http://www.jabaco.org/board/p1370-file-o…operations.html ]
the file handling feature was added by Olimilo on September 21st 2009. The latest Jabaco-Version (1.5.2) is from September 1st 2009.
So you have to update your Jabaco.jar. Have you already done it?
The latest Jabaco SVN version is revision 84.
Where you can download and how you can use revion 84, you can read at:
[ http://www.jabaco.org/board/p2941-error-…t.html#post2941 ]

If all don't help, write your error message of the program here.

Greatings
theuserbl

steveraymon

Beginner

  • "steveraymon" is male
  • "steveraymon" started this thread

Posts: 3

Date of registration: Nov 4th 2010

Location: Telford UK

Occupation: IT Consultant

Hobbies: IT Music

  • Send private message

3

Tuesday, October 11th 2011, 11:25am

Hello theuserbl


Thanks for response the issue is solved!


I am running Windows XP SP3


I tried both versions of your code and neither worked, the error given was: compile error. Class 'Form1' Line 16: Method 'Print' not found with this parameters!


I then updated the Jabaco.jar file and the second version of code worked. So mentioning the FileSystem Class and updating the Jabaco.jar is the cure.


Very many Thanks.


Steve.

Rate this thread
WoltLab Burning Board