NPrint() and NPrintN()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

You have issues drac, that was pure flaming!

I agree with Psyco, support for such has to be considered carefully!

1. Should the compiler turn any \n in any string into a Chr(13) or only when used with PrintN
2. if only with PrintN then how should the compiler handle \n other places? And PrintN would get a reduced stringlength, though again this depends on how the compiler handles strings.
3. How should \n be possible? As \\n or a different way? And what about \e etc, treated as a escape code and ignored since it's wrong, return a error, or treat as just \e and print that as if it was \\e ?

I definetly don't like the NPrintN, NPrint, or whatever. it's messy.
I also don't like the Chr() solution (if it worked that is, here it seems that ascii 10 and 13 isn't handled properly by the codepage *shrug*)
Using +#CRLF$+ is just as messy.

Thing is. there is no point adding escape chars just to Print.
There would be no benefit for all that extra code work for Fred except just console programmers users.
Any escape char implementation has to be for all strings.

Altough a alternative could be a PrintF command, that supports a C like output formatting.
and a PrintS that does the same but instead of actually printing it returns a formatted string.

I think a PrintF and possibly a PrintS may be a more usefull way.
Esp. considering that just adding \ as escape char to Print and PrintN
would possibly break any current code that uses Print or printN
and actually outputs \ chars.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

dracflamloc wrote:Wtf are you talking about, haha

Are you trying to state basic knowledge that a chr() command creates one character, and "\n" is two characters?

I BOW DOWN TO YOUR AMAZING KNOWLEDGE AND BEG YOU TO FATHER MY CHILDREN!

:roll:

no offense or anything...
No ofense, don't worry, but i didn't try to teach, i just tried to you to realize of that fact.

BTW: all of us have lots of things to learn ALWAYS, and i'd say also that all of us have lots of things to teach.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

No it was just my inner sarcasm kicking in...

At any rate. There really isn't much to be considered since the escape characters for strings should just behave how they do in C.
Post Reply