forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Scan Codes For @chr()...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Jul 04, 2002 8:16 am    Post subject: Scan Codes For @chr()... Reply with quote

This prog shows the @chr() numbers/chars for several fonts,
and allows you to change the font size so you'll know what it
looks like.

It has bug fix to the old post (thanks to Dread), with special
controls chars 0-31 and 127 definitions added (thanks to Tommy
and MarkTrubo).
______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac

rem -- Don't show main, only need it to have child dialog --
DIALOG CREATE,"Main Dialog",0,0,0,0
GOSUB LoadList1

%%style = "Arial"
%%pos = 0
%%size = 24
goto CreateDialog

:GetFontSize
  %%size = @input("Enter a font size (6-36):", 24)
  if @not(%%size) @not(@numeric(%%size)) @not(@both(@greater(%%size, 5),@greater(37, %%size)))
     goto GetFontSize
  end

:CreateDialog
  DIALOG CREATE,"@chr( ) Scan Codes",-1,0,230,190
    DIALOG ADD,STYLE,%%style,%%style,%%size,,WHITE
    DIALOG ADD,LIST,Numbers,5,5,90,90,CLICK
    DIALOG ADD,COMBO,Font,5,100,125,20,,LIST,CLICK
    DIALOG ADD,EDIT,ED1,30,100,65,65,,MULTI,WRAP,READONLY,%%style
    DIALOG ADD,TEXT,TypeTxt,102,5,,,"Type chars in here if you wish:"
    DIALOG ADD,EDIT,ED2,120,5,160,65,,MULTI,TABS,%%style
    DIALOG ADD,TEXT,FontSize,43,175,,,Size: %%size
    DIALOG ADD,BUTTON,ChangeSize,70,170,55,25,"Change"
    DIALOG ADD,BUTTON,Help,100,170,55,25
    DIALOG ADD,BUTTON,Check,130,170,55,25
    DIALOG ADD,BUTTON,Clear,160,170,55,25
  DIALOG SHOW

LIST LOADTEXT, Font,
"Arial
"Arial Black
"Comic Sans MS
"Courier
"Courier New
"Fixedsys
"Gill Sans MT
"Impact
"Marlett
"MS Sans Serif
"MS Serif
"Small Fonts
"Symbol
"System
"Times New Roman
"Verdana
"Webdings
"Wingdings

LIST SEEK, Font, 0
if @match(Font, %%style)
   rem -- This displays %%style in combo --
end

%x = 0
REPEAT
  LIST ADD, Numbers, "@chr("%x")"
  %x = @succ(%x)
UNTIL @greater(%x, 255)
LIST SEEK, Numbers, %%pos

:EVLOOP
  WAIT EVENT
  goto @event()

:ChangeSizeBUTTON
  if @greater(@index(Numbers), -1)
     %%pos = @index(Numbers)
  end
  DIALOG SELECT, 1
  DIALOG CLOSE
  goto GetFontSize

:HelpBUTTON
  INFO "You can click on the @chr() number on the"@tab()@cr()"left, or enter a char in the bottom edit box."@cr()"Press the Check button to locate the char's"@cr()"@chr() number."@cr()@cr()"You will get a popup info window describing"@cr()"special control characters 0 - 31 and 127."@cr()@cr()"Selected @chr() numbers are copied to the"@cr()"clipboard."
  goto EVLOOP

:CheckBUTTON
  if @dlgtext(ED2)
     %s = @substr(@dlgtext(ED2), @len(@dlgtext(ED2)))
     %x = 0
     REPEAT
       %n = @substr(@item(Numbers, %x), 6, @pred(@len(@item(Numbers, %x))))
       if @equal(%s, @chr(%n), EXACT)
          CLIPBOARD SET, @item(Numbers)
          %x = @pred(@count(Numbers))
       end
       %x = @succ(%x)
     UNTIL @equal(%x, @count(Numbers))
  end
  goto EVLOOP

:ClearBUTTON
  DIALOG CLEAR, ED2
  goto EVLOOP

:NumbersCLICK
  DIALOG SET, ED1, @chr(@index(Numbers))
  CLIPBOARD SET, @item(Numbers)
  if @both(@greater(@index(Numbers), -1), @greater(32, @index(Numbers)))
     INFO @item(1, @index(Numbers))
  end
  if @equal(@index(Numbers),127)
     INFO @item(1, 32)
  end
  goto EVLOOP

:FontCLICK
  %%style = @item(Font)
  if @greater(@index(Numbers), -1)
     %%pos = @index(Numbers)
  end
  DIALOG SELECT, 1
  DIALOG CLOSE
  goto CreateDialog

:CLOSE
  EXIT

rem --------------- GOSUB ------------------

:LoadList1
LIST CREATE, 1
LIST LOADTEXT, 1,
"0   NUL (NULL) - A control character used to accomplish media-fill or time-fill. Null characters may be inserted into or removed from a stream of data without affecting the information content of that stream. But then the addition or removal of these characters may affect the information layout and/or the control of equipment.
"1   SOH (START OF HEADING) - A transmission control character used as the first character of a heading of an information message.
"2   STX (START OF TEXT) - A transmission control character which precedes a text and which is used to terminate a heading.
"3   ETX (END OF TEXT) - A transmission control character which terminates a text.
"4   EOT (END OF TRANSMISSION) - A transmission control character used to indicate the conclusion of the transmission of one or more texts.
"5   ENQ (ENQUIRY) - A transmission control character used as a request for a response from a remote station; the response may include station identification and/or station status. When a "Who are you" function is required on the general switched transmission network, the first use of ENQ after the connection is established shall have the meaning "Who are you" (station identification). Subsequent use of ENQ may, or may not, include the function "Who are you", as determined by agreement.
"6   ACK (ACKNOWLEDGE) - A transmission control character transmitted by a receiver as an affirmative response to the sender.
"7   BEL (BELL) - A control character that is used when there is a need to call for attention; it may control alarm or attention devices.
"8   BS (BACKSPACE) - A format effector which moves the active position one character position backwards on the same line.
"9   HT (HORIZONTAL TABULATION) - A format effector which advances the active position to the next pre-determined character position on the same line.
"10  LF (LINE FEED) - A format effector which advances the active position to the same character position of the next line.
"11  VT (VERTICAL TABULATION) - A format effector which advances the active position to the same character position on the next pre-determined line.
"12  FF (FORM FEED) - A format effector which advances the active position to the same character position on a pre-determined line of the next form or page.
"13  CR (CARRIAGE RETURN) - A format effector which moves the active position to the first character position on the same line.
"14  SO (SHIFT OUT) - A control character which is used in conjunction with SHIFT IN and ESCAPE to extend the graphic character set of the code. It may alter the meaning of octets 33 - 126 (dec.). The effect of this character when using code extension techniques is described in International Standard ISO 2022.
"15  SI (SHIFT IN) - A control character which is used in conjunction with SHIFT OUT and ESCAPE to extend the graphic character set of the code. It may reinstate the standard meanings of the octets which follow it. The effect of this character when using code extension techniques is described in International Standard ISO 2022.
"16  DLE (DATA LINK ESCAPE) - A transmission control character which will change the meaning of a limited number of contiguously following characters. Its is used exclusively to provide supplementary data transmission control functions. Only graphic characters and transmission control characters can be used in DLE sequences.
"17  DC1 (DEVICE CONTROL ONE) - A device control character which is primarily used for turning on or starting an ancillary device. If it is not required for this purpose, it may be used to restore a device to the basic mode of operation (see also DC2 and DC3), or for any other device control function not provided by other DCs. No assigned meaning in ASCII, but is used for XON in most software handshaking schemes.
"18  DC2 (DEVICE CONTROL TWO) - A device control character which is primarily used for turning on or starting an ancillary device. If it is not required for this purpose, it may be used to set a device to a special mode of operation (in which case DC1 is used to restore normal operation), or for any other device control function not provided by other DCs. No assigned meaning in ASCII.
"19  DC3 (DEVICE CONTROL THREE) - A device control character which is primarily use for turning off or stopping an ancillary device. This function may be a secondary level stop, for example, wait, pause, stand-by or halt (in which case DC1 is used to restore normal operation). If it is not required for this purpose, it may be used for any other device control function not provided by other DCs. No assigned meaning in ASCII, but is used for XOFF in most software handshaking schemes.
"20  DC4 (DEVICE CONTROL FOUR) - A device control character which is primarily used for turning off, stopping or interrupting an ancillary device. If it is not required for this purpose, it may be used for any other device control function not provided by other DCs. No assigned meaning in ASCII.
"21  NAK (NEGATIVE ACKNOWLEDGE) - A transmission control character transmitted by a receiver as a negative response to the sender.
"22  SYN (SYNCHRONOUS IDLE) - A transmission control character used by a synchronous transmission system in the absence of any other character (idle condition) to provide a signal from which synchronism may be achieved or retained between data terminal equipment.
"23  ETB (END OF TRANSMISSION BLOCK) - A transmission control character used to indicate the end of a transmission block of data where data is divided into such blocks for transmission purposes.
"24  CAN (CANCEL) - A character, or the first character of a sequence, indicating that the data preceding it is in error. As a result, this data is to be ignored. The specific meaning of this character must be defined for each application and/or between sender and recipient.
"25  EM (END OF MEDIUM) - A control character that may be used to identify the physical end of a medium, or the end of the used portion of a medium, or the end of the wanted portion of data recorded on a medium. The position of this character does not necessarily correspond to the physical end of the medium.
"26  SUB (SUBSTITUTE) - A control character used in the place of a character that has been found to be invalid or in error. SUB is intended to be introduced by automatic means.
"27  ESC (ESCAPE) - A control character which is used to provide additional control functions. It alters the meaning of a limited number of contiguously following bit combinations. The use of this character is specified in International Standard ISO 2022.
"28  FS (FILE SEPARATOR) - A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a file.
"29  GS (GROUP SEPARATOR) - A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a group.
"30  RS (RECORD SEPARATOR) - A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a record.
"31  US (UNIT SEPARATOR) - A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a unit.
"127 DEL (DELETE) - Not defined.
exit

EDIT - Updated help and removed some unnecessary code.

Cheers, Mac

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361


Last edited by Mac on Sun Jul 07, 2002 11:41 am; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Jul 04, 2002 9:31 pm    Post subject: Reply with quote

Some major changes - Added special control character
definitions and eliminated initial popup and single font
display.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Jul 29, 2002 4:34 am    Post subject: Reply with quote

Made some major changes again, so I'm posting
this version and leaving the original in case anyone
prefers it.

I use this utility a lot, and got tired of the popups
when scrolling thru the list. Now there's a "Special"
button for special control characters, and it seeks
to a specific special char (if it was clicked before
using the "Special" button).

The only INFO popup you get, is by sending an ENTER
keystroke to the edit box and pressing "Find". Since
the ENTER key sends a @cr(13)@cr(10) combination, it
always finds @chr(10) because only the last char in
the edit box is used. Also added this info to the special
char list under both @cr(13) and @cr(10).

There's only one edit box now, and an added status
bar for some tips and info.

Just finished this, so if ya find any bugs let me know.
__________________________________________________________________________________________________________________________
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac

rem -- Don't show main, only need it to have child dialog --
DIALOG CREATE,"Main Dialog",0,0,0,0
LIST CREATE, 1

%%style = "Arial"
%%pos = 0
%%size = 24
goto CreateDialog

:GetFontSize
  %%size = @input("Enter a font size (6-36):", 24)
  if @not(%%size) @not(@numeric(%%size)) @not(@both(@greater(%%size, 5),@greater(37, %%size)))
     goto GetFontSize
  end

:CreateDialog
  DIALOG CREATE,"@chr( ) Scan Codes",-1,0,230,192
    DIALOG ADD,STYLE,StatStyle,MS Sans Serif,8,B
    DIALOG ADD,STYLE,%%style,%%style,%%size,,WHITE
    DIALOG ADD,LIST,Numbers,5,5,90,165,CLICK
    DIALOG ADD,COMBO,Font,5,100,125,20,,LIST,CLICK
    DIALOG ADD,BUTTON,Help,30,100,60,22
    DIALOG ADD,BUTTON,Info,55,100,60,22,"Special"
    DIALOG ADD,BUTTON,ChangeSize,55,165,60,22,"Size"
    DIALOG ADD,BUTTON,Find,80,100,60,22
    DIALOG ADD,BUTTON,Clear,80,165,60,22
    DIALOG ADD,TEXT,FontSize,34,170,,,Size: %%size
    DIALOG ADD,EDIT,E1,105,100,125,65,,MULTI,TABS,%%style
    DIALOG ADD,STATUS,Stat,"Press 'Special' button for more info...",StatStyle
  DIALOG SHOW

rem -- Spacebar, and some that do not display in all fonts --
LIST ADD, 1, "@chr(32)"
LIST ADD, 1, "@chr(128)"
LIST ADD, 1, "@chr(129)"
LIST ADD, 1, "@chr(141)"
LIST ADD, 1, "@chr(142)"
LIST ADD, 1, "@chr(143)"
LIST ADD, 1, "@chr(144)"
LIST ADD, 1, "@chr(157)"
LIST ADD, 1, "@chr(158)"

LIST LOADTEXT, Font,
"Arial
"Arial Black
"Comic Sans MS
"Courier
"Courier New
"Fixedsys
"Gill Sans MT
"Impact
"Marlett
"MS Sans Serif
"MS Serif
"Small Fonts
"Symbol
"System
"Times New Roman
"Verdana
"Webdings
"Wingdings

LIST SEEK, Font, 0
if @match(Font, %%style)
   rem -- This displays %%style in combo --
end

%x = 0
REPEAT
  LIST ADD, Numbers, "@chr("%x")"
  %x = @succ(%x)
UNTIL @greater(%x, 255)
LIST SEEK, Numbers, %%pos

:EVLOOP
  WAIT EVENT
  rem -- %e is event, %d is dialog number that issued it (0,1,2,etc.) --
  PARSE "%e;%d", @event(d)
  goto %e

:ChangeSizeBUTTON
  if @greater(@index(Numbers), -1)
     %%pos = @index(Numbers)
  end
  DIALOG SELECT, 1
  DIALOG CLOSE
  goto GetFontSize

:HelpBUTTON
  %s = "Click the @chr() code on the left, or scroll"@tab()@cr()
  %s = %s"the list to display characters in the edit box."@cr()@cr()
  %s = %s"Or you can type a char in the edit box and"@cr()
  %s = %s"press the  'find'  button to locate the @chr()"@cr()
  %s = %s"code (only last char in edit box is used)."@cr()@cr()
  %s = %s"You can also send SPACEBAR, ENTER, or"@cr()
  %s = %s"TAB keys to the edit box, then press 'find'."@cr()@cr()
  %s = %s"Press the 'Special' button for info describing"@cr()
  %s = %s"special control characters 0 - 32 and 127."@cr()@cr()
  %s = %s"Press the 'Size' button to change font size."@cr()@cr()
  %s = %s"Selected @chr() numbers are copied to the"@cr()"clipboard."
  INFO %s
  %s = ""
  goto EVLOOP

:FindBUTTON
  %s = @substr(@dlgtext(E1), @len(@dlgtext(E1)))
  rem -- Allow for SPACEBAR, TAB, and ENTER key (which is @chr(13)@chr(10)) --
  if %s @equal(%s, @chr(32), EXACT) @equal(%s, @chr(9), EXACT) @equal(%s, @chr(10), EXACT)
     DIALOG SET, E1, %s
     %x = 0
     REPEAT
       %n = @substr(@item(Numbers, %x), 6, @pred(@len(@item(Numbers, %x))))
       if @equal(%s, @chr(%n), EXACT)
          CLIPBOARD SET, @item(Numbers)
          if @greater(32, %x)@equal(%x, 127)
             if @equal(@index(Numbers), 10)@equal(@index(Numbers), 13)
                INFO "ENTER key sends a"@tab()@cr()@cr()"@chr(13)@chr(10)"@cr()@cr()"combination."
             end
             DIALOG SET, Stat, "Press 'Special' button for more info..."
             %%num = @item(Numbers)
          else
             LIST SEEK, 1, 0
             if @match(1, @item(numbers))
                if @equal(@index(Numbers), 32)
                   DIALOG SET, Stat, "Spacebar"
                else
                   DIALOG SET, Stat, "Does not display in some fonts..."
                end
             else
                DIALOG SET, Stat, @item(Numbers)
             end
          end
          %x = @pred(@count(Numbers))
       end
       %x = @succ(%x)
     UNTIL @equal(%x, @count(Numbers))
  end
  goto EVLOOP

:ClearBUTTON
  DIALOG CLEAR, E1
  DIALOG CLEAR, Stat
  %%num = ""
  goto EVLOOP

:NumbersCLICK
  if @greater(32, @index(Numbers))@equal(@index(Numbers), 127)
     DIALOG SET, Stat, "Press 'Special' button for more info..."
     %%num = @item(Numbers)
  else
     LIST SEEK, 1, 0
     if @match(1, @item(Numbers))
        if @equal(@index(Numbers), 32)
           DIALOG SET, Stat, "Spacebar"
        else
           DIALOG SET, Stat, "Does not display in some fonts..."
        end
     else
        DIALOG CLEAR, Stat
     end
     %%num = ""
  end
  DIALOG SET, E1, @chr(@index(Numbers))
  CLIPBOARD SET, @item(Numbers)
  goto EVLOOP

:FontCLICK
  %%style = @item(Font)
  if @greater(@index(Numbers), -1)
     %%pos = @index(Numbers)
  end
  DIALOG SELECT, 1
  DIALOG CLOSE
  goto CreateDialog

:InfoBUTTON
  if @winexists("Special Control Char Codes 0 - 31 and 127")
     DIALOG SELECT, 2
     DIALOG CLOSE
     %e = @event()
  end
  DIALOG CREATE,"Special Control Char Codes 0 - 31 and 127",-1,0,430,330,SMALLCAPS
    DIALOG ADD,STYLE,ChildStyle,Courier New,9
    DIALOG ADD,LIST,ChildList,0,0,430,330,,ChildStyle
  DIALOG SHOW
  rem -- Add horizontal slider to list --
  %z = @sendmsg(@winexists(~ChildList),$0194,2000,0)
  GOSUB LoadInfo
  rem -- Display @chr() topic in info list --
  if @match(ChildList, %%num)
     %i = @index(ChildList)
     if @match(ChildList, "*")
     end
     LIST SEEK, ChildList, %i
     %i = ""
  end
  goto EVLOOP

:CLOSE
  if @greater(%d, 1)
     DIALOG SELECT, %d
     DIALOG CLOSE
     rem -- Kill any extra events -
     %e = @event()
     DIALOG SELECT, 1
     goto EVLOOP
  end
  EXIT

rem --------------- GOSUB ------------------

:LoadInfo
LIST LOADTEXT, ChildList,
"*
"@chr(0) NUL (NULL) - A control character used to
"accomplish media-fill or time-fill. Null characters
"may be inserted into or removed from a stream of data
"without affecting the information content of that
"stream. But then the addition or removal of these
"characters may affect the information layout and/or
"the control of equipment.
"*
"@chr(1) SOH (START OF HEADING) - A transmission control
"character used as the first character of a heading of an
"information message.
"*
"@chr(2) STX (START OF TEXT) - A transmission control
"character which precedes a text and is used to terminate
"a heading.
"*
"@chr(3) ETX (END OF TEXT) - A transmission control
"character which terminates a text.
"*
"@chr(4) EOT (END OF TRANSMISSION) - Transmission control
"character used to indicate the conclusion of the
"transmission of one or more texts.
"*
"@chr(5) ENQ (ENQUIRY) - Transmission control character
"used as a request for a response from a remote station;
"the response may include station identification and/or
"station status. When a "Who are you" function is
"required on the general switched transmission network,
"the first use of ENQ after the connection is established
"shall have the meaning "Who are you" (station
"identification). Subsequent use of ENQ may, or may not,
"include the function "Who are you", as determined by
"agreement.
"*
"@chr(6) ACK (ACKNOWLEDGE) - A transmission control
"character transmitted by a receiver as an affirmative
"response to the sender.
"*
"@chr(7) BEL (BELL) - Control character that is used
"when there is a need to call for attention; it may
"control alarm or attention devices.
"*
"@chr(8) BS (BACKSPACE) - Format effector which moves
"the active position one character position backwards
"on the same line.
"*
"@chr(9) HT (HORIZONTAL TABULATION) - Format effector
"which advances the active position to the next
"pre-determined character position on the same line.
"*
"@chr(10) LF (LINE FEED) - Format effector which advances
"the active position to the same character position of
"the next line. The ENTER key sends @chr(13)@chr(10).
"*
"@chr(11) VT (VERTICAL TABULATION) - Format effector
"which advances the active position to the same
"character position on the next pre-determined line.
"*
"@chr(12) FF (FORM FEED) - Format effector which advances
"the active position to the same character position on a
"pre-determined line of the next form or page.
"*
"@chr(13) CR (CARRIAGE RETURN) - Format effector which
"moves the active position to the first character position
"on the same line. The ENTER key sends @chr(13)@chr(10).
"*
"@chr(14) SO (SHIFT OUT) - Control character which is
"used in conjunction with SHIFT IN and ESCAPE to extend
"the graphic character set of the code. It may alter the
"meaning of octets 33 - 126 (dec.). The effect of this
"character when using code extension techniques is
"described in International Standard ISO 2022.
"*
"@chr(15) SI (SHIFT IN) - Control character which is
"used in conjunction with SHIFT OUT and ESCAPE to extend
"the graphic character set of the code. It may reinstate
"the standard meanings of the octets which follow it.
"The effect of this character when using code extension
"techniques is described in International Standard ISO
"2022.
"*
"@chr(16) DLE (DATA LINK ESCAPE) - Transmission control
"character which will change the meaning of a limited
"number of contiguously following characters. Its is used
"exclusively to provide supplementary data transmission
"control functions. Only graphic characters and
"transmission control characters can be used in DLE
"sequences.
"*
"@chr(17) DC1 (DEVICE CONTROL ONE) - A device control
"character which is primarily used for turning on or
"starting an ancillary device. If it is not required for
"this purpose, it may be used to restore a device to the
"basic mode of operation (see also DC2 and DC3), or for
"any other device control function not provided by other
"DCs. No assigned meaning in ASCII, but is used for XON
"in most software handshaking schemes.
"*
"@chr(18) DC2 (DEVICE CONTROL TWO) - A device control
"character which is primarily used for turning on or
"starting an ancillary device. If it is not required for
"this purpose, it may be used to set a device to a
"special mode of operation (in which case DC1 is used to
"restore normal operation), or for any other device
"control function not provided by other DCs. No assigned
"meaning in ASCII.
"*
"@chr(19) DC3 (DEVICE CONTROL THREE) - A device control
"character which is primarily use for turning off or
"stopping an ancillary device. This function may be a
"secondary level stop, for example, wait, pause, stand-by
"or halt (in which case DC1 is used to restore normal
"operation). If it is not required for this purpose, it
"may be used for any other device control function not
"provided by other DCs. No assigned meaning in ASCII, but
"is used for XOFF in most software handshaking schemes.
"*
"@chr(20) DC4 (DEVICE CONTROL FOUR) - A device control
"character which is primarily used for turning off,
"stopping or interrupting an ancillary device. If it is
"not required for this purpose, it may be used for any
"other device control function not provided by other DCs.
"No assigned meaning in ASCII.
"*
"@chr(21) NAK (NEGATIVE ACKNOWLEDGE) - A transmission
"control character transmitted by a receiver as a
"negative response to the sender.
"*
"@chr(22) SYN (SYNCHRONOUS IDLE) - Transmission control
"character used by a synchronous transmission system in
"the absence of any other character (idle condition) to
"provide a signal from which synchronism may be achieved
"or retained between data terminal equipment.
"*
"@chr(23) ETB (END OF TRANSMISSION BLOCK) - Transmission
"control character used to indicate the end of a
"transmission block of data where data is divided into
"such blocks for transmission purposes.
"*
"@chr(24) CAN (CANCEL) - A character, or first character
"of a sequence, indicating that the data preceding it is
"in error. As a result, this data is to be ignored. The
"specific meaning of this character must be defined for
"each application and/or between sender and recipient.
"*
"@chr(25) EM (END OF MEDIUM) - Control character that may
"be used to identify the physical end of a medium, or the
"end of the used portion of a medium, or the end of the
"wanted portion of data recorded on a medium. The
"position of this character does not necessarily
"correspond to the physical end of the medium.
"*
"@chr(26) SUB (SUBSTITUTE) - Control character used in
"the place of a character that has been found to be
"invalid or in error. SUB is intended to be introduced
"by automatic means.
"*
"@chr(27) ESC (ESCAPE) - Control character which is used
"to provide additional control functions. It alters the
"meaning of a limited number of contiguously following
"bit combinations. The use of this character is
"specified in International Standard ISO 2022.
"*
"@chr(28) FS (FILE SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a file.
"*
"@chr(29) GS (GROUP SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a group.
"*
"@chr(30) RS (RECORD SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a record.
"*
"@chr(31) US (UNIT SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a unit.
"*
"@chr(127) DEL (DELETE) - Not defined.
"*
exit

[EDIT] Slight code optimization and help changes.

Cheers, Mac

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sun Dec 15, 2002 7:35 am    Post subject: Reply with quote

Hi Mac,

just found your little gem above - you've done a great job with it. I like the second lot of code better than the first.

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 15, 2002 7:42 am    Post subject: Reply with quote

Thanks Serge, glad to hear others find it useful. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Dec 18, 2002 12:24 am    Post subject: Reply with quote

Very nice piece of work, I added my 3 year old font routine to it...I haven't really ever checked the routine for accuracy...and it may not work on all windows versions.

Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac

rem -- Don't show main, only need it to have child dialog --
DIALOG CREATE,"Main Dialog",0,0,0,0
LIST CREATE, 1
list create,2
list create,3

%%style = "Arial"
%%pos = 0
%%size = 24
goto CreateDialog

:GetFontSize
  %%size = @input("Enter a font size (6-36):", 24)
  if @not(%%size) @not(@numeric(%%size)) @not(@both(@greater(%%size, 5),@greater(37, %%size)))
     goto GetFontSize
  end

:CreateDialog
  DIALOG CREATE,"@chr( ) Scan Codes",-1,0,230,192
    DIALOG ADD,STYLE,StatStyle,MS Sans Serif,8,B
    DIALOG ADD,STYLE,%%style,%%style,%%size,,WHITE
    DIALOG ADD,LIST,Numbers,5,5,90,165,CLICK
    DIALOG ADD,COMBO,Font,5,100,125,20,,LIST,CLICK,Sorted
    DIALOG ADD,BUTTON,Help,30,100,60,22
    DIALOG ADD,BUTTON,Info,55,100,60,22,"Special"
    DIALOG ADD,BUTTON,ChangeSize,55,165,60,22,"Size"
    DIALOG ADD,BUTTON,Find,80,100,60,22
    DIALOG ADD,BUTTON,Clear,80,165,60,22
    DIALOG ADD,TEXT,FontSize,34,170,,,Size: %%size
    DIALOG ADD,EDIT,E1,105,100,125,65,,MULTI,TABS,%%style
    DIALOG ADD,STATUS,Stat,"Press 'Special' button for more info...",StatStyle
  DIALOG SHOW

rem -- Spacebar, and some that do not display in all fonts --
LIST ADD, 1, "@chr(32)"
LIST ADD, 1, "@chr(128)"
LIST ADD, 1, "@chr(129)"
LIST ADD, 1, "@chr(141)"
LIST ADD, 1, "@chr(142)"
LIST ADD, 1, "@chr(143)"
LIST ADD, 1, "@chr(144)"
LIST ADD, 1, "@chr(157)"
LIST ADD, 1, "@chr(158)"

%%list = Font
list clear,2
list clear,3
LIST REGVALS,3,LOCAL,Software\Microsoft\Windows\CurrentVersion\Fonts

%a = 0
%b = @count(3)

repeat
list seek,3,%a
option fieldsep,(
parse "%c;%d",@item(3)
list add,2,%c
%a = @succ(%a)
until @equal(%a,%b)

list seek,2,0

repeat
if @match(2,Bold)
list delete,2
else
end
until @null(@match(2,bold))

list seek,2,0

repeat
if @match(2,Italic)
list delete,2
else
end
until @null(@match(2,Italic))
list assign,%%list,2

LIST SEEK, Font, 0
if @match(Font, %%style)
   rem -- This displays %%style in combo --
end

%x = 0
REPEAT
  LIST ADD, Numbers, "@chr("%x")"
  %x = @succ(%x)
UNTIL @greater(%x, 255)
LIST SEEK, Numbers, %%pos

:EVLOOP
  WAIT EVENT
  rem -- %e is event, %d is dialog number that issued it (0,1,2,etc.) --
  PARSE "%e;%d", @event(d)
  goto %e

:ChangeSizeBUTTON
  if @greater(@index(Numbers), -1)
     %%pos = @index(Numbers)
  end
  DIALOG SELECT, 1
  DIALOG CLOSE
  goto GetFontSize

:HelpBUTTON
  %s = "Click the @chr() code on the left, or scroll"@tab()@cr()
  %s = %s"the list to display characters in the edit box."@cr()@cr()
  %s = %s"Or you can type a char in the edit box and"@cr()
  %s = %s"press the  'find'  button to locate the @chr()"@cr()
  %s = %s"code (only last char in edit box is used)."@cr()@cr()
  %s = %s"You can also send SPACEBAR, ENTER, or"@cr()
  %s = %s"TAB keys to the edit box, then press 'find'."@cr()@cr()
  %s = %s"Press the 'Special' button for info describing"@cr()
  %s = %s"special control characters 0 - 32 and 127."@cr()@cr()
  %s = %s"Press the 'Size' button to change font size."@cr()@cr()
  %s = %s"Selected @chr() numbers are copied to the"@cr()"clipboard."
  INFO %s
  %s = ""
  goto EVLOOP

:FindBUTTON
  %s = @substr(@dlgtext(E1), @len(@dlgtext(E1)))
  rem -- Allow for SPACEBAR, TAB, and ENTER key (which is @chr(13)@chr(10)) --
  if %s @equal(%s, @chr(32), EXACT) @equal(%s, @chr(9), EXACT) @equal(%s, @chr(10), EXACT)
     DIALOG SET, E1, %s
     %x = 0
     REPEAT
       %n = @substr(@item(Numbers, %x), 6, @pred(@len(@item(Numbers, %x))))
       if @equal(%s, @chr(%n), EXACT)
          CLIPBOARD SET, @item(Numbers)
          if @greater(32, %x)@equal(%x, 127)
             if @equal(@index(Numbers), 10)@equal(@index(Numbers), 13)
                INFO "ENTER key sends a"@tab()@cr()@cr()"@chr(13)@chr(10)"@cr()@cr()"combination."
             end
             DIALOG SET, Stat, "Press 'Special' button for more info..."
             %%num = @item(Numbers)
          else
             LIST SEEK, 1, 0
             if @match(1, @item(numbers))
                if @equal(@index(Numbers), 32)
                   DIALOG SET, Stat, "Spacebar"
                else
                   DIALOG SET, Stat, "Does not display in some fonts..."
                end
             else
                DIALOG SET, Stat, @item(Numbers)
             end
          end
          %x = @pred(@count(Numbers))
       end
       %x = @succ(%x)
     UNTIL @equal(%x, @count(Numbers))
  end
  goto EVLOOP

:ClearBUTTON
  DIALOG CLEAR, E1
  DIALOG CLEAR, Stat
  %%num = ""
  goto EVLOOP

:NumbersCLICK
  if @greater(32, @index(Numbers))@equal(@index(Numbers), 127)
     DIALOG SET, Stat, "Press 'Special' button for more info..."
     %%num = @item(Numbers)
  else
     LIST SEEK, 1, 0
     if @match(1, @item(Numbers))
        if @equal(@index(Numbers), 32)
           DIALOG SET, Stat, "Spacebar"
        else
           DIALOG SET, Stat, "Does not display in some fonts..."
        end
     else
        DIALOG CLEAR, Stat
     end
     %%num = ""
  end
  DIALOG SET, E1, @chr(@index(Numbers))
  CLIPBOARD SET, @item(Numbers)
  goto EVLOOP

:FontCLICK
  %%style = @item(Font)
  if @greater(@index(Numbers), -1)
     %%pos = @index(Numbers)
  end
  DIALOG SELECT, 1
  DIALOG CLOSE
  goto CreateDialog

:InfoBUTTON
  if @winexists("Special Control Char Codes 0 - 31 and 127")
     DIALOG SELECT, 2
     DIALOG CLOSE
     %e = @event()
  end
  DIALOG CREATE,"Special Control Char Codes 0 - 31 and 127",-1,0,430,330,SMALLCAPS
    DIALOG ADD,STYLE,ChildStyle,Courier New,9
    DIALOG ADD,LIST,ChildList,0,0,430,330,,ChildStyle
  DIALOG SHOW
  rem -- Add horizontal slider to list --
  %z = @sendmsg(@winexists(~ChildList),$0194,2000,0)
  GOSUB LoadInfo
  rem -- Display @chr() topic in info list --
  if @match(ChildList, %%num)
     %i = @index(ChildList)
     if @match(ChildList, "*")
     end
     LIST SEEK, ChildList, %i
     %i = ""
  end
  goto EVLOOP

:CLOSE
  if @greater(%d, 1)
     DIALOG SELECT, %d
     DIALOG CLOSE
     rem -- Kill any extra events -
     %e = @event()
     DIALOG SELECT, 1
     goto EVLOOP
  end
  EXIT

rem --------------- GOSUB ------------------

:LoadInfo
LIST LOADTEXT, ChildList,
"*
"@chr(0) NUL (NULL) - A control character used to
"accomplish media-fill or time-fill. Null characters
"may be inserted into or removed from a stream of data
"without affecting the information content of that
"stream. But then the addition or removal of these
"characters may affect the information layout and/or
"the control of equipment.
"*
"@chr(1) SOH (START OF HEADING) - A transmission control
"character used as the first character of a heading of an
"information message.
"*
"@chr(2) STX (START OF TEXT) - A transmission control
"character which precedes a text and is used to terminate
"a heading.
"*
"@chr(3) ETX (END OF TEXT) - A transmission control
"character which terminates a text.
"*
"@chr(4) EOT (END OF TRANSMISSION) - Transmission control
"character used to indicate the conclusion of the
"transmission of one or more texts.
"*
"@chr(5) ENQ (ENQUIRY) - Transmission control character
"used as a request for a response from a remote station;
"the response may include station identification and/or
"station status. When a "Who are you" function is
"required on the general switched transmission network,
"the first use of ENQ after the connection is established
"shall have the meaning "Who are you" (station
"identification). Subsequent use of ENQ may, or may not,
"include the function "Who are you", as determined by
"agreement.
"*
"@chr(6) ACK (ACKNOWLEDGE) - A transmission control
"character transmitted by a receiver as an affirmative
"response to the sender.
"*
"@chr(7) BEL (BELL) - Control character that is used
"when there is a need to call for attention; it may
"control alarm or attention devices.
"*
"@chr(8) BS (BACKSPACE) - Format effector which moves
"the active position one character position backwards
"on the same line.
"*
"@chr(9) HT (HORIZONTAL TABULATION) - Format effector
"which advances the active position to the next
"pre-determined character position on the same line.
"*
"@chr(10) LF (LINE FEED) - Format effector which advances
"the active position to the same character position of
"the next line. The ENTER key sends @chr(13)@chr(10).
"*
"@chr(11) VT (VERTICAL TABULATION) - Format effector
"which advances the active position to the same
"character position on the next pre-determined line.
"*
"@chr(12) FF (FORM FEED) - Format effector which advances
"the active position to the same character position on a
"pre-determined line of the next form or page.
"*
"@chr(13) CR (CARRIAGE RETURN) - Format effector which
"moves the active position to the first character position
"on the same line. The ENTER key sends @chr(13)@chr(10).
"*
"@chr(14) SO (SHIFT OUT) - Control character which is
"used in conjunction with SHIFT IN and ESCAPE to extend
"the graphic character set of the code. It may alter the
"meaning of octets 33 - 126 (dec.). The effect of this
"character when using code extension techniques is
"described in International Standard ISO 2022.
"*
"@chr(15) SI (SHIFT IN) - Control character which is
"used in conjunction with SHIFT OUT and ESCAPE to extend
"the graphic character set of the code. It may reinstate
"the standard meanings of the octets which follow it.
"The effect of this character when using code extension
"techniques is described in International Standard ISO
"2022.
"*
"@chr(16) DLE (DATA LINK ESCAPE) - Transmission control
"character which will change the meaning of a limited
"number of contiguously following characters. Its is used
"exclusively to provide supplementary data transmission
"control functions. Only graphic characters and
"transmission control characters can be used in DLE
"sequences.
"*
"@chr(17) DC1 (DEVICE CONTROL ONE) - A device control
"character which is primarily used for turning on or
"starting an ancillary device. If it is not required for
"this purpose, it may be used to restore a device to the
"basic mode of operation (see also DC2 and DC3), or for
"any other device control function not provided by other
"DCs. No assigned meaning in ASCII, but is used for XON
"in most software handshaking schemes.
"*
"@chr(18) DC2 (DEVICE CONTROL TWO) - A device control
"character which is primarily used for turning on or
"starting an ancillary device. If it is not required for
"this purpose, it may be used to set a device to a
"special mode of operation (in which case DC1 is used to
"restore normal operation), or for any other device
"control function not provided by other DCs. No assigned
"meaning in ASCII.
"*
"@chr(19) DC3 (DEVICE CONTROL THREE) - A device control
"character which is primarily use for turning off or
"stopping an ancillary device. This function may be a
"secondary level stop, for example, wait, pause, stand-by
"or halt (in which case DC1 is used to restore normal
"operation). If it is not required for this purpose, it
"may be used for any other device control function not
"provided by other DCs. No assigned meaning in ASCII, but
"is used for XOFF in most software handshaking schemes.
"*
"@chr(20) DC4 (DEVICE CONTROL FOUR) - A device control
"character which is primarily used for turning off,
"stopping or interrupting an ancillary device. If it is
"not required for this purpose, it may be used for any
"other device control function not provided by other DCs.
"No assigned meaning in ASCII.
"*
"@chr(21) NAK (NEGATIVE ACKNOWLEDGE) - A transmission
"control character transmitted by a receiver as a
"negative response to the sender.
"*
"@chr(22) SYN (SYNCHRONOUS IDLE) - Transmission control
"character used by a synchronous transmission system in
"the absence of any other character (idle condition) to
"provide a signal from which synchronism may be achieved
"or retained between data terminal equipment.
"*
"@chr(23) ETB (END OF TRANSMISSION BLOCK) - Transmission
"control character used to indicate the end of a
"transmission block of data where data is divided into
"such blocks for transmission purposes.
"*
"@chr(24) CAN (CANCEL) - A character, or first character
"of a sequence, indicating that the data preceding it is
"in error. As a result, this data is to be ignored. The
"specific meaning of this character must be defined for
"each application and/or between sender and recipient.
"*
"@chr(25) EM (END OF MEDIUM) - Control character that may
"be used to identify the physical end of a medium, or the
"end of the used portion of a medium, or the end of the
"wanted portion of data recorded on a medium. The
"position of this character does not necessarily
"correspond to the physical end of the medium.
"*
"@chr(26) SUB (SUBSTITUTE) - Control character used in
"the place of a character that has been found to be
"invalid or in error. SUB is intended to be introduced
"by automatic means.
"*
"@chr(27) ESC (ESCAPE) - Control character which is used
"to provide additional control functions. It alters the
"meaning of a limited number of contiguously following
"bit combinations. The use of this character is
"specified in International Standard ISO 2022.
"*
"@chr(28) FS (FILE SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a file.
"*
"@chr(29) GS (GROUP SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a group.
"*
"@chr(30) RS (RECORD SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a record.
"*
"@chr(31) US (UNIT SEPARATOR) - Control character used
"to separate and qualify data logically; its specific
"meaning has to be specified for each application. If
"this character is used in hierarchical order, it
"delimits a data item called a unit.
"*
"@chr(127) DEL (DELETE) - Not defined.
"*
exit


NodNarb
Back to top
View user's profile Send private message AIM Address
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Dec 18, 2002 12:53 am    Post subject: Reply with quote

Nice job nodnarb, it seems to work fine on Windows 95. Smile

I'm sure you know this, but users should be aware that not
all systems have the same fonts. I used a generic font list
(for the most part - Win95 doesn't come with "webdings", but
I think everything else does) because of writing compatible
code. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Dec 18, 2002 7:11 am    Post subject: Reply with quote

The Fonts addition is very nice.

For compatibility, however, I have substituted the Registry read line with this:
Code:

if @equal(@name(@sysinfo(winver)),5)@equal(@sysinfo(winver),"4.0")
  LIST REGVALS,3,LOCAL,Software\Microsoft\Windows NT\CurrentVersion\Fonts
else
  LIST REGVALS,3,LOCAL,Software\Microsoft\Windows\CurrentVersion\Fonts
end

Otherwise no fonts are obtained on XP/2K systems.

And I also need to evaluate the %%style part in the FontCLICK section because there are
parentheses triggering an error:
Code:
 %%style = @item(Font)
  if @greater(@pos("(",%%style),0)
    %%style = @substr(%%style,1,@pred(@pos("(",%%style)))
  end


Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group