Page 2 of 5

Posted: Sun Mar 30, 2008 12:12 pm
by moogle
you can, but having it by default would be better.

Code: Select all

Macro MD5StringFingerprint(text)
 MD5Fingerprint(@text,StringByteLength(text))
EndMacro

Thats the md5 macro, its by someone here in the forums so I don't take any credit for it.

Posted: Sun Mar 30, 2008 12:38 pm
by pdwyer
I was refering to:

PrintN("\"Hello\"")

Posted: Sun Mar 30, 2008 12:40 pm
by moogle
pdwyer wrote:I was refering to:

PrintN(""Hello"")
oh, well there's none that I know of. Would be nice if there was one include file with all these useful functions.

Posted: Sun Mar 30, 2008 12:53 pm
by #NULL
there are codes to do that. search for 'escape' in 'feature request.."

Posted: Sun Mar 30, 2008 1:15 pm
by Kaeru Gaman
but it's a matter of taste...
I'm used to the Chr() thingy from C64 on, for 25 years now, so there is no need for me to work with escaped strings.

Posted: Sun Mar 30, 2008 2:29 pm
by moogle
Kaeru Gaman wrote:but it's a matter of taste...
I'm used to the Chr() thingy from C64 on, for 25 years now, so there is no need for me to work with escaped strings.
and a matter of time,

Chr() + "Hello" + Chr() is longer than ""Hello""
I know we love PureBASIC for its easyness and simplicity but that doesn't mean it should stay in the dark ages of programming. If there was the ternary operator too that would be a nice addition.

Posted: Sun Mar 30, 2008 2:40 pm
by Seldon
I vote for Chr() :D : it's named PureBASIC and IMHO, the syntax must be "Basic". BTW, I wonder... is Chr() compiled as a call to a function or does the compiler simply insert that character, Chr() is refering to ?

Posted: Sun Mar 30, 2008 2:43 pm
by Kaeru Gaman
since it can be used with variables, the compiler cannot insert the value.
maybe it does if used without variables.

I think the runtime way is not a function call but an inbuilt macro, but I'm not sure about this.

Posted: Sun Mar 30, 2008 2:45 pm
by Fluid Byte
moogle wrote:I know we love PureBASIC for its easyness and simplicity but that doesn't mean it should stay in the dark ages of programming.
Yeah, we stay in the "dark ages of programming" because of Chr(). :roll:

Posted: Sun Mar 30, 2008 2:57 pm
by moogle
Fluid Byte wrote:
moogle wrote:I know we love PureBASIC for its easyness and simplicity but that doesn't mean it should stay in the dark ages of programming.
Yeah, we stay in the "dark ages of programming" because of Chr(). :roll:
Did I say Chr()? I'm talking about other stuff like

ternary evaluation ? true : false
""Hello""

I'm replying to the response of I've been using Chr() for years why would I want to use any easier option. Escaping Strings doesn't replace Chr() it just makes some other aspects of coding easier. I know know you'll all come down hard on me for suggesting to make it a little bit better because if it's not BASIC to you guys its a pos right?

Well I'm glad at least FreeBasic sees some sense.

Posted: Sun Mar 30, 2008 2:59 pm
by Fluid Byte
moogle wrote:Did I say Chr()?
Yes.
moogle wrote:Chr() + "Hello" + Chr() is longer than ""Hello""

Posted: Sun Mar 30, 2008 3:50 pm
by moogle
Fluid Byte wrote:
moogle wrote:Did I say Chr()?
Yes.
moogle wrote:Chr() + "Hello" + Chr() is longer than ""Hello""
did I say thats what holds purebasic in the dark ages? whats the matter you make a point but forget you said it?

Fluid Byte wrote: Yeah, we stay in the "dark ages of programming" because of Chr(). :roll:
Go show me where I specifically mention because of the Chr() function PureBasic stays in the dark ages. I implore you to show me that :roll:
I mean it's probably not your fault if you misunderstood seeing as English is probably not your mother tongue.

Posted: Sun Mar 30, 2008 3:58 pm
by Demivec
moogle wrote:
Kaeru Gaman wrote:but it's a matter of taste...
I'm used to the Chr() thingy from C64 on, for 25 years now, so there is no need for me to work with escaped strings.
and a matter of time,

Chr() + "Hello" + Chr() is longer than ""Hello""
I know we love PureBASIC for its easyness and simplicity but that doesn't mean it should stay in the dark ages of programming. If there was the ternary operator too that would be a nice addition.
Here's a light-hearted comparison for length:

Code: Select all

 Q.s=Chr(34)
 Debug Q+"Hello"+Q
;Debug ""Hello""
They look the same :shock: ! (" is a preset constant so you have to ignore the setup line in the comparison). :wink:

On a more serious note, I would like some of the other features you mentioned as well. All in good time. They would be useful in using code that originated in other languages that use those features.

I don't think PureBasic is in the dark ages with respect to anything really. But there is a healthy list of personal favorites on the wish list of features that could be added or improved.

Posted: Sun Mar 30, 2008 4:17 pm
by moogle
Demivec wrote:I don't think PureBasic is in the dark ages with respect to anything really. But there is a healthy list of personal favorites on the wish list of features that could be added or improved.
I know I know I didn't actually mean it is in the dark ages. I was referring to the attitude of "I've been using this for years I wouldn't want to do it an easier or better way". I'm not forcing it like Hey upgrade your coding standards or anything. I wish there was a choice too. I'm not that old to have had the chance to use C64 or Amiga and such hence why I prefer newer styles. At least you had the brains to post something constructive anyway unlike one other being on this forum. :roll:

He still hasn't shown me where I specifically point out that Chr() is dark age. Can't can you? Had to be that idiot to try and ridicule me for wanting a few features. You should be proud.

Posted: Sun Mar 30, 2008 5:01 pm
by pdwyer
Personally, I'm not a fan of escape characters in strings. I often see problems with ansi C programs (often connecting from unix) connecting to windows servers and things like domain\username authentication fails, then they manually hardcode a domain\\username into their conf files to deal with this some other catch spits the dummy in their code.

It might be convenient for a programmer to type a little less but I think that the time is sometimes lost with interest due to issues later and support time. I have no evidence that this happens a lot but I see it sometimes from the sysadmin side and so I'd not use it in my code if it were available

But then, null string termination pisses me off so perhaps I'm a bit wierd :?