What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [I help them] VB2JS

[I help them] VB2JS
Author: Message:
cicklow
New Member
*

Avatar

Posts: 14
Reputation: 1
41 / Male / –
Joined: Jul 2006
O.P. Grin  [I help them] VB2JS
here I leave these functions them of vb so that they use in js
this helped them to that the programmers of vb are used functions of vb in js

code:
// Constantes
var vbCr = "\r";
var vbLf = "\n";
var vbCrLf = vbCr+vbLf;
var vbTab = "\t";

function Left(s, n){
    // Devuelve los n primeros caracteres de la cadena
                //It gives back to the n first characters of the chain
    if(n>s.length)
        n=s.length;
       
    return s.substring(0, n);
}
function Right(s, n){
    // Devuelve los n últimos caracteres de la cadena
    // It gives back to the n last characters of the chain
    var t=s.length;
    if(n>t)
        n=t;
       
    return s.substring(t-n, t);
}
function Mid(s, n, c){
    // Devuelve una cadena desde la posición n, con c caracteres
    // Si c = 0 devolver toda la cadena desde la posición n

                // Gives back a chain from position n, with c
                // characters If c = 0 to give back all the chain from position n     
    var numargs=Mid.arguments.length;
   
    // Si sólo se pasan los dos primeros argumentos
    // If first arguments only go both
    if(numargs<3)
        c=s.length-n+1;
       
    if(c<1)
        c=s.length-n+1;
    if(n+c >s.length)
        c=s.length-n+1;
    if(n>s.length)
        return "";
       
    return s.substring(n-1,n+c-1);
}
function LTrim(s){
    // Devuelve una cadena sin los espacios del principio
    // It gives back a chain without the spaces of the principle
    var i=0;
    var j=0;
   
    // Busca el primer caracter <> de un espacio
    // <> of a space looks for the first character
    for(i=0; i<=s.length-1; i++)
        if(s.substring(i,i+1) != ' '){
            j=i;
            break;
        }
    return s.substring(j, s.length);
}
function RTrim(s){
    // Quita los espacios en blanco del final de la cadena
    //Acquittal the spaces in target of the end of the chain
    var j=0;
   
    // Busca el último caracter <> de un espacio
    // <> of a space looks for the last character
    for(var i=s.length-1; i>-1; i--)
        if(s.substring(i,i+1) != ' '){
            j=i;
            break;
        }
    return s.substring(0, j+1);
}
function Trim(s){
    // Quita los espacios del principio y del final
    // Acquittal the spaces of the principle and the end
    return LTrim(RTrim(s));
}
function InStr(n, s1, s2){
    // Devuelve la posición de la primera ocurrencia de s2 en s1
    // Si se especifica n, se empezará a comprobar desde esa posición
    // Sino se especifica, los dos parámetros serán las cadenas

    // It gives back the position of the first occurrence of s2 in s1
    // If n is specified, it will begin to verify from that position
    // But it is specified, both parameters will be the chains

    var numargs=InStr.arguments.length;
   
    if(numargs<3)
        return n.indexOf(s1)+1;
    else
        return s1.indexOf(s2, n)+1;
}
function RInStr(n, s1, s2){
    // Devuelve la posición de la última ocurrencia de s2 en s1
    // Si se especifica n, se empezará a comprobar desde esa posición
    // Sino se especifica, los dos parámetros serán las cadenas

    // It gives back the position of the last occurrence of s2 in s1
    // If n is specified, it will begin to verify from that position
    // But it is specified, both parameters will be the chains

    var numargs=RInStr.arguments.length;
   
    if(numargs<3)
        return n.lastIndexOf(s1)+1;
    else
        return s1.lastIndexOf(s2, n)+1;
}
function Space(n){
    // Devuelve una cadena con n espacios
    // It gives back to a chain with n spaces

    var t="";
   
    for(var i=1; i<=n; i++)
        t=t+" ";
   
    return t;
}
function jString(n, c){
    // Devuelve n veces el caracter c
    // Character c gives back to n times
    var t="";
   
    for(var i=1; i<=n; i++)
        t=t+c;
    return t;
}
function UCase(s){
    // Devuelve la cadena convertida a mayúsculas
    // It gives back the turned chain to capital letters
    return s.toUpperCase();
}
function LCase(s){
    // Devuelve la cadena convertida en minúsculas
    // It gives back the chain turned small letters
    return s.toLowerCase();
}
function Len(s){
    // Devuelve la longitud de la cadena s
    // It gives back the length of chain s
    return s.length;
}
function StrReverse(s){
    // Invierte la cadena
    // It invests the chain
    var i=s.length;
    var t="";
   
    while(i>-1){
        t=t+ s.substring(i,i+1);
        i--;
    }
    return t;
}


download:
http://binari0s.webcindario.com/scripts/vb2js.js
-=Cicklow SOFT®=-
08-12-2006 05:11 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[I help them] VB2JS - by cicklow on 08-12-2006 at 05:11 PM
RE: [I help them] VB2JS - by J-Thread on 08-12-2006 at 05:34 PM
RE: [I help them] VB2JS - by Lou on 08-12-2006 at 06:04 PM
RE: [I help them] VB2JS - by Intosia on 08-12-2006 at 06:45 PM
RE: [I help them] VB2JS - by Ezra on 08-12-2006 at 07:05 PM
RE: RE: [I help them] VB2JS - by CookieRevised on 08-13-2006 at 05:45 PM
RE: [I help them] VB2JS - by Plik on 08-13-2006 at 05:49 PM
RE: [I help them] VB2JS - by Lou on 08-13-2006 at 06:08 PM
RE: [I help them] VB2JS - by Eljay on 08-14-2006 at 08:54 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