PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Extracting strings
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the ASCII code of specified character. The ASCII code used corresponds to the ANSI standard of Windows.
ASCIICode = Asc("A")    // Returns 65
ASCIICode = Asc("Barbier")   // Returns 66
Syntax
<Result> = Asc(<Character String to Process>)
<Result>: Integer
Requested ASCII code (between 0 and 255).
<Character String to Process>: Character, character string or buffer
Character whose ASCII code must be calculated. If this parameter corresponds to:
  • an empty string or an empty buffer, <Result> will be equal to 0.
  • a character string, <Result> will be equal to the ASCII code of the first character.
  • a buffer, <Result> will be equal to the ASCII code of the first byte.
WEBDEV - Browser code In this version, this parameter can only correspond to a character or to a character string.
Remarks

Extracting strings

Extracting a string (via the [[ and ]] operators) can be used to convert a character found anywhere in a string.
For example: "Asc(Str[[N]])" returns the ASCII value of Nth character found in the "Str" string.
Component : wd250vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
EXAMPLE WxUnCryptASCII
WxUnCryptASCII(SenhaCryptografada is string)

Senha is string = HexaToAscii(SenhaCryptografada)

Senha = ExtractString(Senha,3,";",FromBeginning)

RESULT Senha
BOLLER
17 Apr. 2019
EXAMPLE WxCryptASCII
WxCryptASCII(Login is string, Senha is string, DataCadastro is int)

Login = Lower(Login)

Senha = Lower(Senha)

Resultado is Variant = Login +";"+ Senha +";"+ DataCadastro +";BOB-ESPONJA-BOLLERZITO"

Hash01 is Buffer = HashString(HA_MD5_128, Resultado)

Resultado = Hash01 + ";" + Resultado +";"+ Hash01

Resultado = AsciiToHexa(Resultado)

RESULT Resultado
BOLLER
17 Apr. 2019
EXAMPLE HexaToAscii - Hexa To Ascii
PROCEDURE HexaToAscii(sCh is string)

sHexaString is string = Upper(sCh)

sAsciiString is string
sIntegerString is string
nSize is int = IntegerPart((Length(sHexaString)/2))
sStringToProcess is string
s is string
j is int = 1

FOR i = 1 TO nSize
sStringToProcess = Middle(sHexaString,j,2)
j = j+2
sIntegerString += [TAB] + NumToString(HexaToInt(sStringToProcess))
END

FOR EACH STRING s OF sIntegerString SEPAREE BY TAB
sAsciiString += Charact(Val(s))
END

RESULT sAsciiString
BOLLER
17 Apr. 2019
EXAMPLE AsciiToIntegerString - Ascii To Integer String
PROCEDURE AsciiToIntegerString(sCh is string)

sIntegerString is string
nStringSize is int = Length(sCh)
sStringToProcess is string

FOR i = 1 TO nStringSize
sStringToProcess = Middle(sCh,i,1)
sIntegerString += [TAB] + Asc(sStringToProcess)
END

RESULT sIntegerString
BOLLER
17 Apr. 2019
EXAMPLE AsciiToHexa - Ascii To Hexa
PROCEDURE AsciiToHexa(str is string)

sHexaString is string
FOR nChar=1 _TO_ Length(str)
sHexaString += NumToString(Asc(str[[nChar]]),"02x")
END

RESULT sHexaString
BOLLER
17 Apr. 2019