Thread: please help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    1
    Rep Power
    0

    please help


    hello brothers,
    I have this VBScript program:
    Code:
    Set WSHShell = Wscript.CreateObject("WScript.Shell")       
    Set FSO = Wscript.CreateObject("Scripting.FileSystemObject") 
    Set EnvVar = wshShell.Environment("Process")
    tBestand= EnvVar("USERPROFILE") & "\Desktop\Items Numbers.txt"
    Set Bestand = fso.createtextfile(tBestand,2)
    For x = 1048639472 To 1048640474
    Bestand.WriteLine("Item Number is=" & (x))
    Next
    Bestand.close
    WScript.quit
    The Output is: (about 1002 lines).
    Item Number is=1048639472
    .
    .
    .
    Item Number is=1048640474

    My question is I don't want the output in sequence, I want the output like this function in php language (I found it online):
    Code:
    function check($id){
    $id = trim($id);
    if(!is_numeric($id)) return false;
    if(strlen($id) !== 10) return false;
    $type = substr ( $id, 0, 1 );
    if($type != 2 && $type != 1 ) return false;
    for( $i = 0 ; $i<10 ; $i++ ) {
    //echo "  $id <b>"."</b> -";
    if ( $i % 2 == 0){
    $ZFOdd = str_pad ( ( substr($id, $i, 1) * 2 ), 2, "0", STR_PAD_LEFT );
    $sum += substr ( $ZFOdd, 0, 1 ) + substr ( $ZFOdd, 1, 1 );
    }else{
    $sum += substr ( $id, $i, 1 );
    }
    }
    //echo $sum;
    return $sum%10 ? false : $type;
    is it possible to convert this code php language to vbscript, because i want to add it to my above vbscript program.
    thanks in advance.
  2. #2
  3. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,093
    Rep Power
    9644
    I gave you a link on another site where you asked this question. And I told you there not to call your threads "please help". Did you not read my reply at all?

    Comments on this post

    • salem agrees

IMN logo majestic logo threadwatch logo seochat tools logo