-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|683|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Jayenkai
Created : 23 July 2010
Edited : 23 July 2010
System : Mac

Tearing my Hair Out

RAWR!!

This little bastard bug took me about an hour..



The top one is PHP's output, unscrambling my data.
The bottom one is Blitz.
The PHP one via 'echo $txt;', the Blitz one via 'Debuglog txt$'

An hour..

A whole hour spent checking, double checking, and triple checking.

See, the thing is, PHP uses strings 0->(Len-1), whereas Blitz uses 1->Len
Blitz to PHP is absolutely mentally chaotic!
Especially when, halfway through, you remember that PHP's XOR command isn't actually it's XOR binary thing, and that you should be using ^ instead.. Which makes NO sense, because ^ is 'power of', not sodding XOR.
Bloody stupid bollocksy crap like that, has probably helped create a sodding bald patch.


So, back that odd £ that shows up in the string, in PHP.

I couldn't figure out where it'd come from.

Tried +1's everywhere..
Tried -1's all over..
Tried all kinds of things.

D'you know what it turned out to be?
..

BlitzMax doesn't show £'s when sent doing Debuglog.

FUCKER!!!


AN HOUR!!!

 

Comments


Friday, 23 July 2010, 08:18
HoboBen
Hard to guess without seeing source, I think. A fresh pair of eyes might help.

Maybe it's a charset issue?

edit: (although interestingly I read a problem the other day where this guy was having the opposite problem with ASP; no matter what he tried, a pound sign that was meant to be there *wouldn't* print!)
Friday, 23 July 2010, 09:36
waroffice
I remembered seeing this the other day when refreshing my memory of bitwise operations.

"In the C programming language family, the bitwise XOR operator is "^" (caret)."

taken from Bit wise on wikipedia

doesnt really help your problem tho, sorry
Friday, 23 July 2010, 21:36
Afr0
Especially when, halfway through, you remember that PHP's XOR command isn't actually it's XOR binary thing, and that you should be using ^ instead.. Which makes NO sense, because ^ is "power of", not sodding XOR.


Like waroffice already pointed out, it is in PHP! As well as in C, C++ and C#.
You assume to much about the inherent similarities in languages. When programming in PHP, think in PHP, not in Blitz.
Friday, 23 July 2010, 22:36
Jayenkai
This isn't a "I think in Blitz" issue, this is a "I think in mathematical equation notation" issue.

^ = Power of

Look on your calculator, it's right there.

Saturday, 24 July 2010, 01:30
Stealth
You use pow() in PHP to raise a number to the power of.
Saturday, 24 July 2010, 07:05
steve_ancell
Bloody stupid bollocksy crap like that, has probably helped create a sodding bald patch.

Looks like I'm not the only one that's going bald on here then!
Saturday, 24 July 2010, 07:16
steve_ancell
I have noticed that the ASCII decimal for "?" is 63 and for "£" it's 163. Could the "63" point you in the right direction ?.


Sunday, 25 July 2010, 15:48
Afr0
This isn't a "I think in Blitz" issue, this is a "I think in mathematical equation notation" issue.


Yes but... programming languages aren't mathematical in nature. You could argue that they are, but they're also so much more than that.
C and C++ in particular don't come with alot of functions out of the box if you look away from the standard libraries (which are, like it or not, libraries and not part of the languages). It doesn't make much sense to have an operator with three letters (XOR). The only operator that is more than one letter that I can think of is 'sizeof'. Therefore '^' is XOR.
Sunday, 25 July 2010, 21:36
CodersRule
I have noticed that the ASCII decimal for "?" is 63 and for "£" it's 163. Could the "63" point you in the right direction ?.

I think it has to do with the fact that Blitz doesn't recognize the £ symbol, so just replaces it with a question mark. Generally with computers, what looks like similar numbers to a human are completely different numbers to a computer.
Monday, 26 July 2010, 00:40
Jayenkai
BlitzMax just plain won't print £'s in it's debuglog.
It wasn't a bug in my compiler, it was a bug in Debuglog.
Try it.