Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 8th, 2005, 1:10 PM   #1
ProjectX
Programmer
 
ProjectX's Avatar
 
Join Date: Feb 2005
Posts: 37
Rep Power: 0 ProjectX is on a distinguished road
Strange

Ok so i was bored and I just started playing around with loops in perl so I did this first
#!C:/PERL/BIN/perl.exe -w

for($i = 0; $i < 50; $i++){
         print ":: $i\n";
}
so then i tried this
#!C:/PERL/BIN/perl.exe -w

for($i = 0; $i < 50; $i++){
         print ":: $i\n";
}
if($i == 50){
     print ":: Begining the second loop...\n\n";
     sleep(3);
     for($me = 0x00; $me < 0xff; $me++){
     print "~ $me\n";
   }
}
and then I get ... you have to run it because its too long.
can anyone tell me why I got numbers instead of 0xff or something like that.
ProjectX is offline   Reply With Quote
Old Dec 8th, 2005, 1:20 PM   #2
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 3 Polyphemus_ is on a distinguished road
0xFF IS a number, with base 16 instead of base 10. You don't tell Perl to print it using base 16 instead of base 10.
Polyphemus_ is offline   Reply With Quote
Old Dec 8th, 2005, 1:24 PM   #3
ProjectX
Programmer
 
ProjectX's Avatar
 
Join Date: Feb 2005
Posts: 37
Rep Power: 0 ProjectX is on a distinguished road
oh ok. thanks alot
ProjectX is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:11 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC