Page 1 of 2
New Constants...
Posted: Thu Dec 18, 2003 12:33 pm
by Kale
Inspired by Freedimension, could these constants be added please?
Code: Select all
#LF = Chr(10)
#CR = Chr(13)
#CRLF = Chr(13) + Chr(10)
As these would save me and others loads of unnecessary code.
Anybody got any more?
Posted: Thu Dec 18, 2003 1:47 pm
by freak
#TAB = Chr(9) maybe?
Posted: Thu Dec 18, 2003 1:59 pm
by Karbon
It would be handy to have the double quote char (34) in a constant too.
Posted: Thu Dec 18, 2003 3:54 pm
by Justin
it would be handy, everytime i need them i have to search the ascii code and make globals for them
Posted: Thu Dec 18, 2003 7:19 pm
by Psychophanta
Better should be:
Code: Select all
#LF$ = Chr(10)
#CR$ = Chr(13)
#CRLF$ = Chr(13) + Chr(10)
#LFCR$ =Chr(10) + Chr(13)
#TAB$ = Chr(9)
#ESC$ = Chr(27)
....
...
This would allow to define #CR=10, for example, if work with Ascii values...
hello
Posted: Thu Dec 18, 2003 8:47 pm
by DominiqueB
Why don't you simply build your own .res file with all constants, structures you aften need ?
Code: Select all
D:\PureBasic\Compilers\PBCompiler PureBasic.pb /RESIDENT PureBasic_x86.res
For example:
Code: Select all
D:\PureBasic\Compilers\PBCompiler MyResident.pb /RESIDENT MyResident.res
Hust modify the path above to your's, and change the .pb name to your's too, and put this line in a .bat file
Then write a .pb file that contains your constants and structures, and put all files in a folder appart and then run the .bat
You then get your own .res file, just put it in the Residents folder in your purebasic folder.
That's all . . .
You should avoid modiffying the original PureBasic_x86.res, and Windows.res because your modifications will be erased during the next update of purebasic !
Hope it helped some of you !
Dominique.
Posted: Thu Dec 18, 2003 9:00 pm
by Psychophanta
SOME times SOME women are right

Posted: Thu Dec 18, 2003 9:41 pm
by Karbon
Damn... Good idea!
*gets to it*
Posted: Thu Dec 18, 2003 11:16 pm
by freedimension
Yep, that would be a way, but not my favorite one.
Why?
Easy to tell.
Every Coder would implement his own resident file. Every nth one would have different constant names.
Standardized Constants for this would help diminish compatibility problems when showing code in the forum.
D.mn, I thought I wrote this some hours ago. I hate my browser, I hate my browser, I ... .
free
Psychophanta
Posted: Fri Dec 19, 2003 12:02 am
by DominiqueB
who is a woman ?
I'm a man, in French Dominique is for both !
Dominique
Posted: Fri Dec 19, 2003 12:36 am
by Karbon
Ok people, stop making good points and confusing me.
Right again, so lets pester Fred until he adds a resident file for stuff like this
@DominiqueB: Suuuuuuuuuuure!

Posted: Fri Dec 19, 2003 9:22 am
by Danilo
added for next version:
Code: Select all
#LF$ = Chr(10)
#CR$ = Chr(13)
#CRLF$ = Chr(13) + Chr(10)
#LFCR$ = Chr(10) + Chr(13)
#TAB$ = Chr(9)
#ESC$ = Chr(27)
works fine:
Code: Select all
MessageRequester("Title","ABC"+#TAB$+"DEF"+#CRLF$+"GHI"+#TAB$+"JKL")
Syntax Highlighting corrected.
Posted: Fri Dec 19, 2003 10:39 am
by Psychophanta
Beautiful DominiqueB said:
who is a woman ?
I'm a man, in French Dominique is for both !
Judging for your posts i think you are a man, but just in case ...
Even i give that idea; in fact i am in accordance with what you say in this thread.
Why don't you simply build your own .res file with all constants, structures you aften need ?
Why? because i don´t like to fill my human memory of constants; i mean: #LF$ is Line Feed char; #CR$ is Carriage Return char; and so on...
These things, in certain way, limits the programmer freedom, because even you don't want to use it, you are invited to force your human memory unnecessaryly.
Posted: Fri Dec 19, 2003 11:56 am
by Kale
Danilo wrote:added for next version:
Code: Select all
#LF$ = Chr(10)
#CR$ = Chr(13)
#CRLF$ = Chr(13) + Chr(10)
#LFCR$ = Chr(10) + Chr(13)
#TAB$ = Chr(9)
#ESC$ = Chr(27)
works fine:
Code: Select all
MessageRequester("Title","ABC"+#TAB$+"DEF"+#CRLF$+"GHI"+#TAB$+"JKL")
Syntax Highlighting corrected.
Nice! what about:
i needed this loads the other day...

Posted: Fri Dec 19, 2003 12:52 pm
by Froggerprogger
What about:
Code: Select all
#IDONTKNOWTHENAMEFORITSOICALLITJUSTTHE_Y_WITHTWODOTSABOVEIT$ = Chr(255)
