ASP Classico: How to replace the character "DASH" with "DASH"?

Asked

Viewed 582 times

0

I have a problem - when using a PDF component - I ended up having a "Out of Range" error when generating the PDF document.

by error and line I found out where the problem was - and identified that the error was pq the user registered a "INDENT" in the field searched.

by switching "DASH" to "DASH" - everything is back to normal.

Obviously the error in the component occurs because it does not identify the "MISCHIEF" as a "Table" character - even though it is not part of the default keyboard.

In thousands of registrations it was the first time q had this problem - but as it is common for clients to use the trace to separate the information from the field, (and I believe that the problem occurred pq the CORRECTOR ORTHOGRAPHIC automatically changed the trace for the crossbar) - wanted a solution to the problem.

This solution is simple..

just check the data sent in the register and exchange the DASH DASH using the command "REPLACE"

REPLACE(texto, "TRAVESSAO", "TRAÇO")

my doubt is - as I inform the "MISCHIEF" in the code - since it does not exist on the keyboard.

thanks!!

  • Without knowing what type of character this INDENT is very difficult. Have you ever thought about doing the reverse? For example: Filter only acceptable characters in search.

  • Indent in Windows Altgr + Num- or Alt + CTRL + Num- (or Alt + 0151) OBS: Num- is the "less" key in the numeric key panel as well as 0151 as well. On my keyboard worked Alt + 0151 look it ai - is bigger than the Half-stripe - or - (tracinho)

1 answer

2


Indent in Windows AltGr + Num- or Alt + CTRL + Num- or Alt + 0151

NOTE: Num- is the "less" key in the numeric key panel as well as 0151. On my keyboard it worked Alt + 0151 look at it there - it is bigger than the Half-stripe - or - (tracinho).

On Mac OS X Alt + hífen

REPLACE(texto, "—", "-")

I’ve used many Places in Asp like this: REPLACE(texto, chr(151), "-") Stroke can be Chr(150) or Chr(45)

           glifo    Unicode          HTML    TeX         Windows    Mac OS
hífen        -      U+2012 (8210)   nenhum    -        Alt + 0045   
meia-risca   –      U+2013 (8211)   –   --       Alt + 0150   Option + -
travessão    —      U+2014 (8212)   —   ---      Alt + 0151   Shift + Option + -

Some keyboards have no numeric key panel, how to do?

Copy the Indent - and paste it into your code!!

Wikipedia

  • Hi @leo-Caracciolo, first thanks for the help!! That’s just what I needed! My keyboard does not have the alfnum and for some reason using the Chr(151) in the replace he was not making the switch. But it all worked out using the direct character. Thank you!! Daniel

Browser other questions tagged

You are not signed in. Login or sign up in order to post.