New Constants...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

New Constants...

Post 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?
--Kale

Image
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

#TAB = Chr(9) maybe?
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

It would be handy to have the double quote char (34) in a constant too.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

it would be handy, everytime i need them i have to search the ascii code and make globals for them
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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...
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

hello

Post 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.
Dominique

Windows 10 64bits. Pure basic 32bits
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

SOME times SOME women are right :P
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Damn... Good idea! :-)

*gets to it*
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post 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
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

Psychophanta

Post by DominiqueB »

who is a woman ?

I'm a man, in French Dominique is for both !

:lol:

Dominique
Dominique

Windows 10 64bits. Pure basic 32bits
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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! :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post 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.
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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 ... 8)

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.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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:

Code: Select all

#DOUBLEQUOTE$ = Chr(34)
i needed this loads the other day... :)
--Kale

Image
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

What about:

Code: Select all

#IDONTKNOWTHENAMEFORITSOICALLITJUSTTHE_Y_WITHTWODOTSABOVEIT$ = Chr(255)
:wink:
%1>>1+1*1/1-1!1|1&1<<$1=1
Post Reply