[Implemented] String constants from ASCII codes please

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] String constants from ASCII codes please

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

I recently went to define a string constant for NewLine+CarriageReturn
but couldn't figure out how. If it's not possible it would be a nice feature.

(Implemented with #CRLF$ etc.)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Ok.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

I like those constants ,for example in VB its named:

vbCr Carriage Return
vbLf LineFeed
vbCrLf CarriageReturn and Linefeed

so why not do it like:

pbCr
pbLf
pbCrLf



Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by theogott.

I am just trying to port something from PowerBasic (cause I think it'll run faster in Purebasic).

In Powerbasic we have Constants like:

$C ="A String"
$XYZ = 99

AT compiletime the compiler just inserts these items where
the "placeholder" $XYZ is. Then everybody can make his own set of constants ...

*************************
The best time to do things is now !
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by freak.

@theogott

I don't get you point.
You can do this in Purebasic:

#Constant = 256
#Constant2.s = "Hello World"

This is just, what you talk about, isn't it?

Timo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

> #Constant2.s = "Hello World"

you don't have to use the '.s' extension..
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

>vbCr Carriage Return
>vbLf LineFeed
>vbCrLf CarriageReturn and Linefeed
:) GRRRRRRRRRRR....
And the work of the programmer???? Is this???? Nooooooorrrrrrrrr...

Is this:
PB_Cr.s= Chr(13);Carriage Return
PB_Lf.s= Chr(10);LineFeed
PB_CrLf.s=CarriageReturn and Linefeed

Or if you prefer:

#PB_Cr=Chr(13);Carriage Return
#PB_Lf= Chr(10);LineFeed
#PB_CrLf=CarriageReturn and Linefeed

Do you like???

Is best. OK. The programmer need expand yours ideas. OK??

Regards. I only nedd floats. This is my request to Fred, not simplicism.

Regards.

Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by theogott.

Yes thanks.

If its there, then you can define everything else easily in a ".pbi"-file.



*************************
The best time to do things is now !
Post Reply