I'm trying to avoid people looking at the data without proper access tks Anton
-----Original Message----- From: Mike Jackson [mailto:[EMAIL PROTECTED] Sent: Monday, March 29, 2004 1:54 PM To: Anton Ganeshalingam Cc: [EMAIL PROTECTED] Subject: Re: shifting bits yes, the string is represented by an array of 8 bit values (or 16 if using unicode), and the chr() and asc() (from memory) functions convert between text and value representations. but why would you want to shift a bit of textual data? It would no longer be text.. On Mon, 29 Mar 2004 13:18:56 -0800, Anton Ganeshalingam <[EMAIL PROTECTED]> wrote: > Let's say my data is the following phrase 'Hello World'. This phrase is > represented in machine language in bits (assuming I'm right). So this was > the reason I thought I could insert the data into MS db after shifting a > bit. > > tks > Anton > > -----Original Message----- > From: Mike Jackson [mailto:[EMAIL PROTECTED] > Sent: Monday, March 29, 2004 12:49 PM > To: Anton Ganeshalingam > Cc: [EMAIL PROTECTED] > Subject: Re: shifting bits > > > it sounds like you weren't talking about bit-shifting integers... What do > you mean by shifting a byte of data by any number? > > On Mon, 29 Mar 2004 12:23:21 -0800, Anton Ganeshalingam > <[EMAIL PROTECTED]> wrote: > >> Mike, >> Thanks for your reply. But I'm confused not by your answer but my >> lack of knowledge on this matter. How would I convert the data like >> "Hello >> World". Should I convert to acssii first ? >> >> tks >> Anton >> >> -----Original Message----- >> From: Mike Jackson [mailto:[EMAIL PROTECTED] >> Sent: Monday, March 29, 2004 12:16 PM >> To: Anton Ganeshalingam; '[EMAIL PROTECTED]' >> Subject: Re: shifting bits >> >> >> from perlop: >> >> Shift Operators >> >> Binary ``<<'' returns the value of its left argument shifted left by the >> number of bits specified by the right argument. Arguments should be >> integers. (See also Integer Arithmetic.) >> >> Binary ``>>'' returns the value of its left argument shifted right by >> the >> number of bits specified by the right argument. Arguments should be >> integers. (See also Integer Arithmetic.) >> >> so, >> >> use Win32::ODBC; >> $db = new Win32::ODBC('DBQ=myDB.mdb;Driver={Microsoft Access Driver >> (*.mdb)};') or die "can't open database"; >> $db->Sql "SELECT * FROM myTable WHERE someVal=$myConditionalVal"; >> if ($db->FetchRow) { >> my %datahash = $db->DataHash; >> $datahash{myVal} <<= $datahash{shiftAmt}; >> $db->Sql "UPDATE myTable SET myVal=$datahash{myVal} WHERE >> someVal=$datahash{someVal}"; >> } >> $db->Close(); >> >> would retrieve a row from myTable where someVal equals >> $myConditionalVal, >> shift myVal left by shiftAmt bits, and re-write... if you wanna do the >> whole table, just push all the result hashes onto an array, and when >> done, >> go through the array, pop each one, do the shift and re-write... >> >> which would be even easier with a tied hash - but I havent yet played >> with >> tied hashes... >> >> >> >> On Mon, 29 Mar 2004 11:54:43 -0800, Anton Ganeshalingam >> <[EMAIL PROTECTED]> wrote: >> >>> >>> >>>> Hello to all, >>>> I'm writing a perl program that will take a byte of data and shift >>>> (right or left) it by any number and write it to a MS access DB. Since >>>> Perl is free type language how would you accomplish this on perl. >>>> >>>> Please help. >>>> >>>> tks >>>> Anton >>> >>> _______________________________________________ >>> Perl-Win32-Users mailing list >>> [EMAIL PROTECTED] >>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs >>> >> >> >> >> > > > > _______________________________________________ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs