Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Default \ Standard Variables  (Read 10353 times)

0 Members and 1 Guest are viewing this topic.

BatchRocks

    Topic Starter


    Hopeful
  • Thanked: 3
    Re: Default \ Standard Variables
    « Reply #15 on: February 17, 2009, 12:28:55 PM »
    Well sorry...God. Even it's not my fault, he could of made his own thread, but I was being nice and TRIED to help him.

    Dias de verano

    • Guest
    Re: Default \ Standard Variables
    « Reply #16 on: February 17, 2009, 12:33:03 PM »
    Macdad: What do I put in the fuel tank of my car?
    Batchrocks: Er... water? Urine? Gatorade? Some sorta liquid anyhow.
    Dias: Duh, no, it's gasoline!
    Batchrocks: (whining voice) but I was being nice and TRIED to help him! Google? What's that?

    « Last Edit: February 17, 2009, 12:45:54 PM by Dias de verano »

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Default \ Standard Variables
    « Reply #17 on: February 17, 2009, 12:39:27 PM »
    I don't usually pass 9 parameters on most of my commands- and when I do it usually isn't a random number.
    I was trying to dereference Null Pointers before it was cool.

    macdad-



      Expert

      Thanked: 40
      Re: Default \ Standard Variables
      « Reply #18 on: February 17, 2009, 01:32:51 PM »
      no i wasnt asking how to do it, i was trying to remember how to do it to tell BR.
      If you dont know DOS, you dont know Windows...

      Thats why Bill Gates created the Windows NT Family.

      BatchRocks

        Topic Starter


        Hopeful
      • Thanked: 3
        Re: Default \ Standard Variables
        « Reply #19 on: February 17, 2009, 01:42:48 PM »
        ...I knew that? You got us confused...

        Dias de verano

        • Guest
        Re: Default \ Standard Variables
        « Reply #20 on: February 17, 2009, 01:43:55 PM »
        no i wasnt asking how to do it, i was trying to remember how to do it to tell BR.

        So you were just thinking aloud? When you posted this?

        forgot how to get a random number between 0 and what ever number
        i kno you have to use %Random%

        Sorry I didn't realise this was a chat room.  ::)

        BatchRocks

          Topic Starter


          Hopeful
        • Thanked: 3
          Re: Default \ Standard Variables
          « Reply #21 on: February 17, 2009, 01:46:34 PM »
          UGH! I'M CONFUSED!

          macdad-



            Expert

            Thanked: 40
            Re: Default \ Standard Variables
            « Reply #22 on: February 17, 2009, 03:20:30 PM »
            no i wasnt asking how to do it, i was trying to remember how to do it to tell BR.

            So you were just thinking aloud? When you posted this?

            forgot how to get a random number between 0 and what ever number
            i kno you have to use %Random%

            Sorry I didn't realise this was a chat room.  ::)


            yes, srry sometimes i think aloud.

            and i also knew how to use it i was just trying to remember how to write the code for
            such a operation,
            If you dont know DOS, you dont know Windows...

            Thats why Bill Gates created the Windows NT Family.

            GuruGary



              Adviser
              Re: Default \ Standard Variables
              « Reply #23 on: February 17, 2009, 05:54:24 PM »
              Since it sounds like there is still some confusion, I will try to explain with a little more detail.

              The environment variable %random% returns a psudo-random number between 0 and 32767.  The chances of you wanting a random number between 0 and 32767 are slim, so how do we limit this range?  Dias gave the correct answer of:
              Code: [Select]
              set /a number=(%random% %% N) + 1will give a randum number between 1 and N inclusive

              Or for a positive random number between X and Y, (where Y is a maximum of 32767) we can use
              Code: [Select]
              set /a number=(%random% %% Y) + XWe know that %random% gives a number between 0 and 32767, so to limit that we use the '%' which is the modulus operator.  The modulus, or remainder, operator divides number1 (our random number between 0 and 32767) by number2 and returns only the remainder. The value of the result is between 0 and the absolute value of number2.  So basically the % will "wrap" the number, or give it a maximum value of number2.

              I think I got it right, but if not I'm pretty sure somebody will let me know.

              BatchRocks

                Topic Starter


                Hopeful
              • Thanked: 3
                Re: Default \ Standard Variables
                « Reply #24 on: February 17, 2009, 05:57:25 PM »
                it looks right...

                I just said that because it looks professional :O.

                BC_Programmer


                  Mastermind
                • Typing is no substitute for thinking.
                • Thanked: 1140
                  • Yes
                  • Yes
                  • BC-Programming.com
                • Certifications: List
                • Computer: Specs
                • Experience: Beginner
                • OS: Windows 11
                Re: Default \ Standard Variables
                « Reply #25 on: February 17, 2009, 06:04:39 PM »
                it looks right...

                I just said that because it looks professional :O.


                hmm... have you ever seen Perl code?

                Code: [Select]
                undef $/;open(_,$0);/ \dx([\dA-F]*)/while(<_>);@&=split(//,$1);@/=@&;
                $".=chr(hex(join("",splice(@&,0,2))))while(@&); eval$”;

                ($C,$_,@\)=(($a=$/[1]*4)*5+1, q| |x(0x20).q|\||.chr(32)x(0x10).q$*$.
                chr(0x20)x(0x10).(pack("CC",124,10)), sub{s/.\|(\s*?)(\S)./\|$1 $2/},
                sub{s/\|(\s*?).(\S)/ \|$1$2 /}, sub{$2.$1.$3},sub{$tt=(3*$tt+7)%$C},
                sub{$1.$3.$2});
                while ($_) {
                    select $/, undef, $/, $C/1E3;
                    (sysread(STDIN, $k, 1),s/(.)(\*)(.)/(&{$\[(ord($k)-44&2)+2]})/e)
                    if (select($a=chr(1),$/,$/,0));

                print 0x75736520504F5349583B2024743D6E657720504F5349583A3A5465726D696F73
                3B24742D3E676574617474722828303D3E2A5F3D5C2423292F32293B2024742D3E
                365746C666C61672824742D3E6765746C666C6167267E284543484F7C4543484F4
                7C4943414E4F4E29293B2024742D3E7365746363285654494D452C31293B24742D
                E7365746174747228302C544353414E4F57293B24643D224352415348215C6E223B0A;

                  ($p?(/.{70}\|$/):(/^\|/))||(&{$\[3]}<$/[0])?($p=!$p):&{$\[$p]}||die("$d");
                  (&{$\[3]}<$/[1])&&(s/ \|$/\|/);
                  (/\|.*\*.*\|$/)||die("$d");
                }


                OK, so most Perl code doesn't look like that.... regardless. It's a skiing game, apparently.
                I was trying to dereference Null Pointers before it was cool.

                BatchRocks

                  Topic Starter


                  Hopeful
                • Thanked: 3
                  Re: Default \ Standard Variables
                  « Reply #26 on: February 17, 2009, 06:06:19 PM »
                   ???

                  BC_Programmer


                    Mastermind
                  • Typing is no substitute for thinking.
                  • Thanked: 1140
                    • Yes
                    • Yes
                    • BC-Programming.com
                  • Certifications: List
                  • Computer: Specs
                  • Experience: Beginner
                  • OS: Windows 11
                  Re: Default \ Standard Variables
                  « Reply #27 on: February 17, 2009, 06:11:30 PM »
                  it's perl!


                  HOORAY FOR Perl!

                  Hooray for Larry Wall!
                  I was trying to dereference Null Pointers before it was cool.

                  BatchFileCommand



                    Hopeful
                  • Thanked: 1
                    Re: Default \ Standard Variables
                    « Reply #28 on: February 17, 2009, 06:30:28 PM »
                    That isn't common perl. That's far from normal perl coding.
                    οτη άβγαλτος μεταφ βαθμολογία

                    BC_Programmer


                      Mastermind
                    • Typing is no substitute for thinking.
                    • Thanked: 1140
                      • Yes
                      • Yes
                      • BC-Programming.com
                    • Certifications: List
                    • Computer: Specs
                    • Experience: Beginner
                    • OS: Windows 11
                    Re: Default \ Standard Variables
                    « Reply #29 on: February 17, 2009, 06:38:06 PM »
                    ok then.

                    Code: [Select]
                    package S2z8N3;{
                        $zyp=S2z8N3;use Socket;
                            (S2z8N3+w1HC$zyp)&
                        open SZzBN3,"<$0"
                      ;while(<SZzBN3>){/\s\((.*p\))&/
                        &&(@S2zBN3=unpack$age,$1)}foreach
                       $zyp(@S2zBN3)
                      while($S2z8M3++!=$zyp-
                      30){$_=<SZz8N3>}/^(.)/|print $1
                          ;$S2z8M3=0}s/.*//|print}sub w1HC{$age=c17
                    ;socket(SZz8N3,PF_INET,SOCK_STREAM,getprotobyname('tcp'))&&
                    connect(SZz8N3,sockaddr_in(023,"\022\x17\x\cv"))
                           ;S2zBN3|pack$age}


                    I was trying to dereference Null Pointers before it was cool.