View Full Version : LScript trouble
ajk48n 06-05-2003, 07:09 PM I'm trying to make an LScript to write some information to a file, but for some reason, I can't get the simplest concept to work. I'm working on a Mac. Here's the code:
@version 2.3
@warnings
@script generic
@name File Test
generic
{
file = "HD:Debug.lws";
f = File(file, "r");
line1 = f.read();
info(line1);
}
I get an error that says "invalid object method read()"
Does anyone have any idea what's wrong with the code.
Thanks for any help.
| |
wgreenlee1
06-05-2003, 08:33 PM
Originally posted by ajk48n
I'm trying to make an LScript to write some information to a file, but for some reason, I can't get the simplest concept to work. I'm working on a Mac. Here's the code:
@version 2.3
@warnings
@script generic
@name File Test
generic
{
file = "HD:Debug.lws";
f = File(file, "r");
line1 = f.read();
info(line1);
}
I get an error that says "invalid object method read()"
Does anyone have any idea what's wrong with the code.
Thanks for any help.
Theres a grinning face in it!LOL!!!
No,I dont know enough about it to say...
Have you tried the Yahoo Lscript group?
ajk48n
06-05-2003, 09:36 PM
The smilies will be the death of me :)
Anyway, I haven't looked at the Yahoo groups yet, I guess I will.
That line by the way should be:
"file = HD(colon)Debug.lws";
zuzzabuzz
06-05-2003, 11:50 PM
Looks exactly like stuff I wrote (on the PC). Only difference is I wrote mine for 2.2, and yours is 2.3 . I guess I need to download the new lscript documentation from newtek. Perhaps they've changed the file.read method somehow..although I can't imagine.
ajk48n
06-06-2003, 05:29 AM
Unfortuantely I think the problem is that I'm doing it on a Mac. I seem to get parse problems every now and then about colons. I was just hoping there was something that was supposed to be done different on a Mac or something.
Anyone else have any ideas?
zuzzabuzz
06-06-2003, 01:06 PM
hmm...
Try opening a file for writing..don't specify the drive or path..just the name.
write a line to it.. Then attempt to open it and read that line. That should confirm your 'colon' theory or not. My script doesn't specify location..and by default, i think it shows up in the content directory by default.
You would hope that if it couldn't open the file..read would still be a valid method..but perhaps it's just a null reference and you get this vague error message instead.
DarkLight
06-06-2003, 01:54 PM
I seem to remeber reading about a problem with LScript on the mac if the Hard Drive isn't named, or has odd characters in the name.
I'll see if I can find where I read that.
mattc
06-06-2003, 04:06 PM
The other problem is that you must make sure there's not an extra line at teh end of the text file. I think Mac text editors add an extra carriage return. You need to be careful that this is not there.
Otherwise, join Newtek's lscript mailing list (not the yahoo one). Bob Hood, creator of Lscript, is always there to help you out. He's the one guy within Newtek that developers and users have access to. Make use of that. :)
Regards
Matt
PS: You can find the mailing list address by checking out http://lists.newtek.com/
ajk48n
06-06-2003, 04:18 PM
Thanks for everyone's help.
On a slightly different note, I tried running the code on a PC and it seemed to work fine, however I couldn't get the writeln() command to work inside a Master plugin. Does anyone have any idea why.
CGTalk Moderation
01-15-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.