What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » how do i do this...

how do i do this...
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: how do i do this...
quote:
Originally posted by SpunkyLoveMuff
code:
var myVar = <variable with source code in it>.split("http://www.youtube.com/v/");
myVar = myVar[1].substr(0,11)//Change 11 to another number if needed
<variable with source code in it>.replace(/myVar/g);

Remember to write back to the file for changes to take affect
Not tested, but it should work

EDIT: Beaten :o

that will not work...

The split function is not needed and will actually make that this wont work. Delimeters ("http://www.youtube.com/v/" in your case) will obviously be deleted from the final array the split function has created.

-------

The proper way to do this:

1) read the entire file into a variable

now you have the entire contents of the file in 1 string. All it takes now is just replacing parts of the string like you replace text in strings...

2) replace the number with your own number in that variable (use the string.replace() function for this with a regular expression so you replace all occurances and not simply the first one).

3) overwrite the file with the new text in that variable

But as stated several times by now, look things up yourself roflmao456. You clearly don't learn a thing by asking copy/paste solutions as you keep comming asking for basic programming stuff. Study the JScript 5.6 documentation (available from the official Plus! scripting database, category "others").

Hence I'm not going to give the code, you need to look this up and find out by yourself using the documentation. Start by reading about files and how to open, read and write them. It is clearly explained with examples in the documentation.

This post was edited on 12-11-2006 at 02:55 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-11-2006 02:49 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
how do i do this... - by roflmao456 on 12-09-2006 at 10:50 PM
RE: how do i do this... - by Baggins on 12-09-2006 at 11:09 PM
RE: how do i do this... - by roflmao456 on 12-11-2006 at 12:03 AM
RE: how do i do this... - by Baggins on 12-11-2006 at 12:12 AM
RE: how do i do this... - by Spunky on 12-11-2006 at 12:16 AM
RE: how do i do this... - by CookieRevised on 12-11-2006 at 02:49 AM


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