Hidden characters in code

ThePentiumGuy

Well-known member
Joined
May 21, 2003
Messages
1,113
Location
Boston, Massachusetts
hey,
does vb.net ever bother you about 2 lines of code that are exactly the same, but it only bothers you with one of them?

for example, these 2 lines are in the same place

Code:
game.LookAt = Vector3.TransformCoordinate([color=#0000ff]New[/color] Vector3(0, 0, 1),
Matrix.Multiply(Matrix.RotationY((yrot * Math.PI) / 180), Matrix.RotationX((xrot * Math.PI) / 180)))
game.LookAt = Vector3.TransformCoordinate([color=#0000ff]New[/color] Vector3(0, 0, 1),
Matrix.Multiply(Matrix.RotationY((yrot * Math.PI) / 180), Matrix.RotationX((xrot * Math.PI) / 180)))

except, the first one is givng an error becuase of the slash ((xrot * Math.PI) / 180))) <-- saying, "Expression expected"...

ive checked it, WORD FOR WORD, CHARACTRER FOR CHARACTER :-p

i tried compiling agian... still the same error...my friend told me it probably has something to do with hidden characters...

does anyone know whats goin on here???
-pent

[edit]i took out an "enter" so that its easier to compare the code ... and yet it still double spaces the code :p[/edit]
[edit]I removed formatting from the code and wrapped the lines. - Derek[/edit]
 
Last edited by a moderator:
There;s no hidden characters in vb.net. Id double check that your math.pi function works in the 2nd place, maybe its not declared properly (IE you may need a imports system.math or something at the top)
 
Copy and paste the code in a simply (notepad, wordpad) text editor and see if there is a space or something else there. Did you type them word for word or did you copy and paste from somewhere?
 
NO that doesnt make sense. VB.NET autoformats all the code anyway. There are no hidden characters. Its a myth.
 
\There;s no hidden characters in vb.net. Id double check that your math.pi function works in the 2nd place, maybe its not declared properly (IE you may need a imports system.math or something at the top)
yeah but dude, theyre in the same place, line after line from each other...

Copy and paste the code in a simply (notepad, wordpad) text editor and see if there is a space or something else there. Did you type them word for word or did you copy and paste from somewhere?
the line that works, i copied from MSN messenger, but the line that didnt work, i typed it in manually :p, and i checked it out in word, still the same(i even pressed control+F to search the same text, and it found the same thing

Its a myth.
:D!! lol

---


as a side note, i closed an opened my IDE again, and it ... works!
vs.net (2002) is really buggy - one time messagebox.show didnt even work, it couldnt recognize it or something,

well thanks for the replies guys,
pent
 
I cant speak for VB.NET, but I KNOW Ive had "special" characters in C# - only when cutting and pasting.

I found that if I cut and paste into notepad then copied from notepad right back to VS, it worked most of the time. Sometimes I had deleted the CRLF chars until two words were right next to each other (like eachother) and then manually typed a space and THEN pasted things back into VS.

Every once in awhile it would be stubborn. In those cases, I just retyped the line. It should only "bite" you once. After that, youll quickly learn to cut-n-paste to notepad or manually type a line.

-ner
 
Theres no myth. Numerous programs (including MSN Messenger) add unreadable Unicode characters to text to mark it up. Once copied the text isnt readable by programs that dont understand the markup. Your best bet, as Nerseus stated, is to copy the text into Notepad. Alternatively, you can simply retype the text in question.
 
I cut and paste from all sorts of places, VB.NET, word, outlook, MSN messenger, IE, and many more and Ive NEVER come accross this problem before. Not to say that I dont believe its possible, but VB isnt C where you used to be able to scroll across 500 spaces to the left and put in an extra character to crash the compiler...

:p
 
Back
Top