Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating an accented character
Message
De
21/02/2018 13:20:39
 
 
À
21/02/2018 10:39:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01658323
Message ID:
01658330
Vues:
178
>>Hi all,
>>
>>A client of mine emailed saying she would like to insert the character ś into a field. I have a utility for them that allows them to insert other common accented characters to any field but this one is not found in the 1252 code page. I also tried code page 1250 but I am still not seeing it. My utility just inserts the character using CHR(xx).
>>
>>It sort of seems that it is a unicode character (U+015A) but I don't know how to use that.
>>
>>Thanks,
>>Albert
>
>Try with chr(154) provided you are using a font which has this character, e.g. Arial
>
>Rgds,
>
>P.S. a quick utility to find 'strange' characters, use MSWord and look for the insert symbol menu option. It will reveal the asc number of any character you select.
>
>Koen

Many years ago I created this program to display the complete ASCII chart, it would be easy to add a getfont() dialog to it.
*ascii.prg
#define dnLeft 5
#define dnTop 5
#define dnBoxWidth 45
#define dnBoxHeight 36

public m.loAscii 
m.loAscii = createobject('form')
m.loAscii.Width = 800
m.loAscii.Height = 700
lnTop = dnTop
lcText = 'NUL,SOH,STX,ETX,EOT,ENQ,ACK,BEL,BS,TAB,LF,VT,FF,CR,SO,SI,DLE,DC1,DC2,DC3,DC4,NAK,SYN,ETB,CAN,EM,SUB,ESC,FS,GS,RS,US,Space'
alines(laText,lcText,0,',')
for lnX1 = 0 to 15
   for lnX2 = 0 to 15
      lnAscii = (m.lnX1 * 16) + m.lnX2 
      lcObject = 'loAsc' + transform(m.lnAscii)
      
      local m.loObject as EditBox 
      m.loAscii.AddObject(m.lcObject,'editbox')
      loObject = evaluate('loAscii.' + m.lcObject)  
      m.loObject.Left = dnLeft + (m.lnX2 * (dnBoxWidth + 2) )
      m.loObject.Top = lnTop &&dnTop  + (m.lnX1 * (dnBoxHeight + 2 ))
      m.loObject.Width = dnBoxWidth 
      if lnX1 < 3
         m.loObject.Height = dnBoxHeight * 1.5
      else
         m.loObject.Height = dnBoxHeight 
      Endif
      m.loObject.ScrollBars = 0 
      text to lctext noshow textmerge pretext 1+2+4
         <<transform(lnAscii)>>
         <<chr(lnAscii)>>
         <<iif(lnAscii<33,laText(lnAscii + 1),'')>>
      endtext
      m.loObject.Value = lcText 
      m.loObject.Visible = .T.
   Endfor
   lnTop = lnTop + m.loObject.Height + 2
Endfor
m.loAscii.SetAll('Fontname','Courier new')
m.loAscii.Caption = 'ASCII chart - Font is Courier new'
m.loAscii.Visible = .t.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform