What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Packing Scripts

Packing Scripts
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Packing Scripts
quote:
Originally posted by pedro_cesar
Are function as feof, fget*, etc available in JavaScript?
No. Those are PHP functions and they don't exist as standard JScript functions. To access files, you'll have to use the FileSystemObject or use API calls. You can take a look at the code snippet on the MPScripts.net site and use those functions to read from or write to text files. :)

Note: the functions in the snippet use a variable called 'fsObj', this can be declared in global like this:
code:
var fsObj = new ActiveXObject("Scripting.FileSystemObject")
but it's recommend you declare it per function to keep the memory usage low. This means, that instead of using:
code:
// Reads the full contents of a text file to a variable
function ReadFile (file) {
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var contents = fileObj.ReadAll();
  fileObj.Close();
  return contents;
}
you use
code:
// Reads the full contents of a text file to a variable
function ReadFile (file) {
  var fsObj = new ActiveXObject("Scripting.FileSystemObject");
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var contents = fileObj.ReadAll();
  fileObj.Close();
  return contents;
}
and so on for the other functions. ;)

This post was edited on 12-23-2006 at 02:46 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-23-2006 02:41 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Packing Scripts - by pedro_cesar on 12-22-2006 at 02:22 PM
RE: Packing Scripts - by EBFL on 12-22-2006 at 02:25 PM
RE: Packing Scripts - by pedro_cesar on 12-22-2006 at 02:30 PM
RE: Packing Scripts - by NanaFreak on 12-22-2006 at 02:31 PM
RE: Packing Scripts - by alexp2_ad on 12-22-2006 at 02:33 PM
RE: Packing Scripts - by pedro_cesar on 12-22-2006 at 02:34 PM
RE: RE: Packing Scripts - by CookieRevised on 12-23-2006 at 02:48 PM
RE: Packing Scripts - by Felu on 12-22-2006 at 02:34 PM
RE: Packing Scripts - by pedro_cesar on 12-22-2006 at 02:49 PM
RE: Packing Scripts - by Menthix on 12-22-2006 at 07:31 PM
RE: Packing Scripts - by pedro_cesar on 12-23-2006 at 01:52 PM
RE: Packing Scripts - by Matti on 12-23-2006 at 02:41 PM
RE: Packing Scripts - by pedro_cesar on 12-23-2006 at 04:41 PM
RE: Packing Scripts - by pedro_cesar on 12-31-2006 at 06:47 PM
RE: Packing Scripts - by CookieRevised on 12-31-2006 at 07:36 PM
RE: Packing Scripts - by pedro_cesar on 12-31-2006 at 09:30 PM
RE: Packing Scripts - by CookieRevised on 01-01-2007 at 01:45 AM
RE: Packing Scripts - by pedro_cesar on 01-01-2007 at 01:24 PM
RE: Packing Scripts - by rajvora on 01-01-2007 at 02:42 PM
Packing Scripts - by pedro_cesar on 01-06-2007 at 01:43 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On