Binary Data???

Dave dave at looktowindward.com
Tue Feb 13 11:59:42 EST 2007


Hi,

Yes, if the data were 5 x 5 (instead of 512, 512) then all I want is  
a buffer that contains the data:

0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,   5 lots  
of (0,128,0,128 in a line, and 5 lines, making 25 groups of 0,128,0,128)
0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,
0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,
0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,
0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128,0,128

Thanks a lot, I think that should do it! I guess when I have my C  
head on I find it hard to think in TranScript!

All the Best
Dave

On 13 Feb 2007, at 16:30, Mark Smith wrote:

> Dave, could you explain in what you're doing - to my non-C eyes it  
> looks like your'e simply building a 512 * 512 list of bytes of  
> alternating value 0 and 128.
>
> If it's any help, you can do this with <put numToChar(0) & numToChar 
> (128) after tBuffer> the required number of times, but I'm guessing  
> that that is not exactly what you want...
>
> Best,
>
> Mark
>
> On 13 Feb 2007, at 16:02, Dave wrote:
>
>> Hi All,
>>
>> I would like to pass a large buffer of binary data to an External  
>> Function, but I'm not sure how to go about it in TranScript.
>>
>> The C code for it looks a bit like this:
>>
>> int					myXCounter;
>> int					myYCounter;
>> unsigned char*		myImagePtr;
>>
>> myImagePtr = theImagePtr;
>> for (myYCounter = 0;myYCounter < 512;myYCounter++)
>> 	{
>> 	for (myXCounter = 0;myXCounter < 512;myXCounter++)
>> 		{
>> 		myImagePtr[0] = 0;
>> 		myImagePtr[1] = 128;
>> 		myImagePtr[2] = 0;
>> 		myImagePtr[3] = 128;
>> 		myImagePtr += 4;
>> 		}
>> 	}
>>
>> I then would I write this so it is stored inside a TranScript  
>> variable?
>>
>> Thanks a lot and All the Best
>> Dave
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list