Page 2 of 2

Posted: Fri Dec 19, 2003 1:21 pm
by plouf
Nice! what about:

Code: Select all

#DOUBLEQUOTE$ = Chr(34)
i needed this loads the other day... :)
serieously there are 32 special chatracter if we do the start why
nopt covere them all ?
NULL ,ACK etc

Posted: Fri Dec 19, 2003 1:52 pm
by Danilo

Code: Select all

#NUL$   = Chr(000)  :  #NUL =   0 ;    (NULL)
#SOH$   = chr(001)  :  #SOH =   1 ;    (Start of Header)
#STX$   = chr(002)  :  #STX =   2 ;    (Start of Text)
#ETX$   = chr(003)  :  #ETX =   3 ;    (End of Text)
#EOT$   = chr(004)  :  #EOT =   4 ;    (End of Transmission)
#ENQ$   = chr(005)  :  #ENQ =   5 ;    (Enquiry)
#ACK$   = chr(006)  :  #ACK =   6 ;    (Acknowledgment)
#BEL$   = chr(007)  :  #BEL =   7 ;    (Bell)
#BS$    = chr(008)  :  #BS  =   8 ;    (Backspace)
#HT$    = chr(009)  :  #HT  =   9 ;    (Horizontal Tab)
#LF$    = chr(010)  :  #LF  =  10 ;    (Line Feed)
#VT$    = chr(011)  :  #VT  =  11 ;    (Vertical Tab)
#FF$    = chr(012)  :  #FF  =  12 ;    (Form Feed)
#CR$    = chr(013)  :  #CR  =  13 ;    (Carriage Return)
#SO$    = chr(014)  :  #SO  =  14 ;    (Shift Out)
#SI$    = chr(015)  :  #SI  =  15 ;    (Shift In)
#DLE$   = chr(016)  :  #DLE =  16 ;    (Data Link Escape)
#DC1$   = chr(017)  :  #DC1 =  17 ;    (Device Control 1) (XON)
#DC2$   = chr(018)  :  #DC2 =  18 ;    (Device Control 2)
#DC3$   = chr(019)  :  #DC3 =  19 ;    (Device Control 3) (XOFF)
#DC4$   = chr(020)  :  #DC4 =  20 ;    (Device Control 4)
#NAK$   = chr(021)  :  #NAK =  21 ;    (Negative Acknowledgement)
#SYN$   = chr(022)  :  #SYN =  22 ;    (Synchronous Idle)
#ETB$   = chr(023)  :  #ETB =  23 ;    (End of Trans. Block)
#CAN$   = chr(024)  :  #CAN =  24 ;    (Cancel)
#EM$    = chr(025)  :  #EM  =  25 ;    (End of Medium)
#SUB$   = chr(026)  :  #SUB =  26 ;    (Substitute)
#ESC$   = chr(027)  :  #ESC =  27 ;    (Escape)
#FS$    = chr(028)  :  #FS  =  28 ;    (File Separator)
#GS$    = chr(029)  :  #GS  =  29 ;    (Group Separator)
#RS$    = chr(030)  :  #RS  =  30 ;    (Request to Send)(Record Separator)
#US$    = chr(031)  :  #US  =  31 ;    (Unit Separator)

#DEL$   = chr(127)  :  #DEL = 127 ;    (delete)


#NULL$  = Chr(000)                ;    (NULL)
#TAB$   = Chr(009)  :  #TAB =   9 ;    (TAB)

#CRLF$  = Chr(13) + Chr(10)
#LFCR$  = Chr(10) + Chr(13)

#DOUBLEQUOTE$ = chr(34)
#DQUOTE$      = chr(34)
More needed?

Posted: Fri Dec 19, 2003 2:13 pm
by jqn
... YES :!:

When I create a HTML page from a PB program, I need to change every vowel with accent (in spanish) and every special character, by the HTML value. (Character Entity Reference)

#AACUTE = "á"
#NTILDE = "ñ"
#QUOT = """
#AMP = "&amp:"
...

I need to include all constants, and use them in final page.

BR
joaquin

Posted: Fri Dec 19, 2003 2:17 pm
by jqn
SORRY.

Html in forum message has changed my example:

#AACUTE = "&aacute"
#NTILDE = "&ntilde"
#QUOT = "&quot"
#AMP = "&amp"

(missing semicolon for reading purposes)

BR
joaquin

Posted: Fri Dec 19, 2003 3:07 pm
by Danilo
I think HTML isnt related to PB in any way, but you can add
this constants at the top of your project.
Adding standard ASCII chars should be enough, because its
directly related to PB.

But maybe the boss wants to add HTML stuff too... Fred :?:

(The bigger the Residents are, the longer it takes to start the compiler...)

Posted: Fri Dec 19, 2003 6:38 pm
by TronDoc
Danilo wrote:

Code: Select all

....
More needed?
those seem most appropriate.
Froggerprogger wrote:What about:

Code: Select all

#IDONTKNOWTHENAMEFORITSOICALLITJUSTTHE_Y_WITHTWODOTSABOVEIT$ = Chr(255)
:lol:

Pre-canned constants are a suboptimal solution

Posted: Wed Jan 07, 2004 8:08 pm
by guido
While of course having a resident file containing all that stuff is a solution, the example in a previous reply already showed, that the control character is not the final destination but an intermediate one like in

"text1" + #CR + "text2"

There is also not much advantage of looking up a value in a constant name table compared to an ASCII/UNICODE/HTML table. I would prefer syntactic support for embedding arbitrary hex codes like C does with the "\xHH" syntax. (Whether all that \a, \t, \n special cases are a bonus is another discussion). To ensure downward compatibility a different enhanced text delimiter (at least at the beginning) would be nice, like x", so the example would transform to x"text1\x0Dtext2".

Posted: Wed Jan 07, 2004 9:22 pm
by freedimension
Full Ack but for the x"", that's some ugly code.
I would prefer compiler directives like CompilerEscapeCharactersOn and CompilerEscapeCharactersOff (default). That should be implemented very easy and fast.

Posted: Thu Jan 22, 2004 6:56 am
by johndehope3
Umlaut

Danilo, please add 1 more, conditional on platform...

Posted: Sat Apr 10, 2004 12:50 am
by USCode
Hi Danilo,
:idea: Please add a "new line" constant, something like "#NL$".
This would be a NEW LINE constant.

On Windows this constant should be:
#NL$ = Chr(13) + Chr(10)

On Linux it should be:
#NL$ = Chr(10)

This would be nice for those of us that need to write cross-platform software and need to insert a new line into our strings.

Thanks!