Page Date
2004-05-18
DD-Software
Kapitel zurück / previous Chapter
Main Index
 
Seite zurück / previous page
Backward
Seite vor / next page
Forward
 
Seitenanfang/TopOfPage
Top
Seitenende/EndOfPage
Bottom
MyWbtHelp current version

WinBatch Scripting - Conversion Functions



Seitenanfang/TopOfPage Seitenende/EndOfPage
Seitenanfang/TopOfPage Seitenende/EndOfPage

udfUrlEncodeCreateTableFile ()
udfUrlEncodeWriteTableFile (hBBUrlEncTable, sFilename)
udfUrlEncodeReadTable (sFilename)
udfUrlEncodeStrByTable (hBBUrlEncTable, sString)
udfUrlDecodeStrByTable (hBBUrlEncTable, sString)
udfUrlEncodeStr_1 (sString)
udfUrlEncodeStr_2 (sString)
udfUrlEncodeStr_3 (sString)
udfUrlDecodeStr_1 (sString)
udfUrlDecodeStr_2 (sString)
udfUrlDecodeStr_3 (sString)
udfUrlEncodeStrAll_1 (sString)
udfUrlEncodeStrAll_2 (sString)
udfHtmlEncodeStr (sString)

;------------------------------------------------------------------------------------------------------------------------------------------
; udfUrlEncodeCreateTable()
; udfUrlEncodeWriteTable (hBBUrlEncTable, sFilename)
; udfUrlEncodeReadTable (sFilename)
;
; udfUrlEncodeStrByTable (hBBUrlEncTable, sString)
; udfUrlDecodeStrByTable (hBBUrlEncTable, sString)
;
; udfUrlEncodeStr_1 (sString)
; udfUrlEncodeStr_2 (sString)
; udfUrlEncodeStr_3 (sString)
;
; udfUrlDecodeStr_1 (sString)
; udfUrlDecodeStr_2 (sString)
; udfUrlDecodeStr_3 (sString)
;
; udfUrlEncodeStrAll_1 (sString)
; udfUrlEncodeStrAll_2 (sString)
;
; udfHtmlEncodeStr (sString)
;------------------------------------------------------------------------------------------------------------------------------------------

;------------------------------------------------------------------------------------------------------------------------------------------
; Teststring is:
;    `Hello World, that's _my_ [2%] + <"~more"> or less /../ .`
;
;
; WinBatch Extender UrlEncode gives:
;    `Hello+World%2C+that%27s+_my_+%5B2%25%5D+%2B+%3C%22%7Emore%22%3E+or+less+%2F..%2F+.`
;
;
; My UrlEncode gives:
;
; including `/,'+` (that means, take over the four characters `/,'+` into the encoded string):
;    `Hello%20World,%20that's%20_my_%20%5B2%25%5D%20+%20%3C%22%7Emore%22%3E%20or%20less%20/../%20.`
;
; excluding `/,'+`:
;    `Hello%20World%2C%20that%27s%20_my_%20%5B2%25%5D%20%2B%20%3C%22%7Emore%22%3E%20or%20less%20%2F..%2F%20.`
;
;
; My UrlEncodeStrAll gives:
;    `%48%65%6C%6C%6F%20%57%6F%72%6C%64%2C%20%74%68%61%74%27%73%20%5F%6D%79%5F%20%5B%32` ... [wrapped into next line]
;    ... `%25%5D%20%2B%20%3C%22%7E%6D%6F%72%65%22%3E%20%6F%72%20%6C%65%73%73%20%2F%2E%2E%2F%20%2E`
;------------------------------------------------------------------------------------------------------------------------------------------
; Detlev Dalitz.20011111.20020630.20020826
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodecreatetable",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodecreatetable

#DefineFunction udfUrlEncodeCreateTable()
hBBGoodChars = BinaryAlloc(80)
;BinaryPokeStr(hBBGoodChars,0,"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;/?:@=&$-_.+!*'(),") ; including `/,'+`
BinaryPokeStr(hBBGoodChars,0,"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;?:@=&$-_.!*()") ; without `/,'+`
hBBHexChars = BinaryAlloc(16)
BinaryPokeStr(hBBHexChars,0,"0123456789ABCDEF")
hBBUrlEncTable = BinaryAlloc(1024) ; recordsize=4, buffersize=256*recordsize=1024
iOffset = 0
For iByte=0 To 255
   If (BinaryIndexEx(hBBGoodChars,0,Num2Char(iByte),@FWDSCAN,1)<0)
      BinaryPoke(hBBUrlEncTable,iOffset,37) ; the percent sign
      BinaryCopy(hBBUrlEncTable,iOffset+1,hBBHexChars,(iByte>>4),1)
      BinaryCopy(hBBUrlEncTable,iOffset+2,hBBHexChars,(iByte&15),1)
   Else
      BinaryPoke(hBBUrlEncTable,iOffset,iByte)
   EndIf
   iOffset = iOffset+4 ; recordsize=4
Next
BinaryFree(hBBHexChars)
BinaryFree(hBBGoodChars)
BinaryEodSet(hBBUrlEncTable,1024)
Return (hBBUrlEncTable)
; returns a handle to a buffer which contains the encoding table (1024 Byte)
#EndFunction

:skip_udfurlencodecreatetable
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodewritetable",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodewritetable

#DefineFunction udfUrlEncodeWriteTable (hBBUrlEncTable, sFilename)
Return (1024==BinaryWrite(hBBUrlEncTable,sFilename))
; returns @true if 1024 byte are written otherwise @false
#EndFunction

:skip_udfurlencodewritetable
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodereadtable",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodereadtable

#DefineFunction udfUrlEncodeReadTable (sFilename)
iBBSize = FileSize(sFilename)
hBBUrlEncTable = 0
If (iBBSize==1024)
   hBBUrlEncTable = BinaryAlloc(iBBSize)
   iResult = BinaryRead(hBBUrlEncTable,sFilename)
   If (iResult<>1024)
      BinaryFree(hBBUrlEncTable)
      hBBUrlEncTable = 0
   EndIf
EndIf
Return (hBBUrlEncTable)
; returns a handle to a binary buffer which contains encoding decoding table data
; make sure that there is read a file which contains the appropriate data (1024 byte)
#EndFunction

:skip_udfurlencodereadtable
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodestrbytable",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodestrbytable

#DefineFunction udfUrlEncodeStrByTable (hBBUrlEncTable, sString)
If (sString=="") Then Return (sString)
iStrLen = StrLen(sString)
hBBString = BinaryAlloc(iStrLen)
BinaryPokeStr(hBBString,0,sString)
sString = ""
iStrLen = iStrLen-1
For i=0 To iStrLen
   sString = StrCat(sString,BinaryPeekStr(hBBUrlEncTable,4*BinaryPeek(hBBString,i),4)) ; recordsize=4
Next
BinaryFree(hBBString)
Return (sString)
#EndFunction

:skip_udfurlencodestrbytable
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurldecodestrbytable",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurldecodestrbytable

#DefineFunction udfUrlDecodeStrByTable (hBBUrlEncTable, sString)
If (sString=="") Then Return (sString)
iStrLen = StrLen(sString)
hBBString = BinaryAlloc(iStrLen)
BinaryPokeStr(hBBString,0,sString)
sString = ""
i=0
While (i<iStrLen)
   If (BinaryPeek(hBBString,i)==37) ; the percent sign
      iOffset = Max(0,BinaryIndexEx(hBBUrlEncTable,0,BinaryPeekStr(hBBString,i,3),@FWDSCAN,0))
      sString = StrCat(sString,Num2Char(iOffset/4)) ; recordsize=4
      i = i+3
   Else
      sString = StrCat(sString,BinaryPeekStr(hBBString,i,1))
      i = i+1
   EndIf
EndWhile
BinaryFree(hBBString)
Return (sString)
#EndFunction

:skip_udfurldecodestrbytable
;------------------------------------------------------------------------------------------------------------------------------------------



;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodestr_1",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodestr_1

#DefineFunction udfUrlEncodeStr_1 (sString)
If (sString=="") Then Return (sString)

;sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;/?:@=&$-_.+!*'()," ; including /,'+
sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;?:@=&$-_.!*()" ; without /,'+
sPct = "%%" ; the percent sign

iStrLen = StrLen(sString)
sOut = ""
For i=1 To iStrLen
   sChar = StrSub(sString,i,1)
   If !StrScan(sGoodChars,sChar,1,@FWDSCAN)
      iByte = Char2Num(sChar)
      sOut = StrCat(sOut,sPct,Num2Char((iByte>>4)+48+7*((iByte>>4)>9)),Num2Char((iByte&15)+48+7*((iByte&15)>9)))
   Else
      sOut = StrCat(sOut,sChar)
   EndIf
Next
Return (sOut)
#EndFunction

:skip_udfurlencodestr_1
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodestr_2",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodestr_2

#DefineFunction udfUrlEncodeStr_2 (sString)
If (sString=="") Then Return (sString)

;sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;/?:@=&$-_.+!*'()," ; including /,'+
sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;?:@=&$-_.!*()" ; without /,'+
sHexChars = "0123456789ABCDEF"
sPct = "%%" ; the percent sign

iStrLen = StrLen(sString)
sOut = ""
For i=1 To iStrLen
   sChar = StrSub(sString,i,1)
   If !StrScan(sGoodChars,sChar,1,@FWDSCAN)
      iByte = Char2Num(sChar)
      sOut = StrCat(sOut,sPct,StrSub(sHexChars,1+(iByte>>4),1),StrSub(sHexChars,1+(iByte&15),1))
   Else
      sOut = StrCat(sOut,sChar)
   EndIf
Next
Return (sOut)
#EndFunction

:skip_udfurlencodestr_2
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodestr_3",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodestr_3

#DefineFunction udfUrlEncodeStr_3 (sString)
If (sString=="") Then Return (sString)

;sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;/?:@=&$-_.+!*'()," ; including /,'+
sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;?:@=&$-_.!*()" ; without /,'+
sBadChars = StrClean(sString,sGoodChars,"",@TRUE,1)
sPct = "%%" ; The percent sign

If StrIndex(sBadChars,sPct,1,@FWDSCAN)
   sString = StrReplace(sString,sPct,"%%25") ; The percent sign, hex encoded.
   sBadChars = StrReplace(sBadChars,sPct,"")
EndIf

While (sBadChars>"")
   sChar = StrSub(sBadChars,1,1)
   iByte = Char2Num(sChar)
   sCharEnc = StrCat(sPct,Num2Char((iByte>>4)+48+7*((iByte>>4)>9)),Num2Char((iByte&15)+48+7*((iByte&15)>9)))
   sString = StrReplace(sString,sChar,sCharEnc)
   sBadChars = StrReplace(sBadChars,sChar,"")
EndWhile
Return (sString)
#EndFunction

:skip_udfurlencodestr_3
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurldecodestr_1",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurldecodestr_1

#DefineFunction udfUrlDecodeStr_1 (sString)
If (sString=="") Then Return (sString)

;sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;/?:@=&$-_.+!*'()," ; including /,'+
sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;?:@=&$-_.!*()" ; without /,'+

iStrLen = StrLen(sString)
sOut = ""
i=1
While (i<=iStrLen)
   sChar = StrSub(sString,i,1)
   If !StrScan(sGoodChars,sChar,1,@FWDSCAN)
      iHi = Char2Num(StrUpper(StrSub(sString,i+1,1)))-48
      iLo = Char2Num(StrUpper(StrSub(sString,i+2,1)))-48
      sOut = StrCat(sOut,Num2Char(((iHi-7*(iHi>9))<<4)+(iLo-7*(iLo>9))))
      i = i+3
   Else
      sOut = StrCat(sOut,sChar)
      i = i+1
   EndIf
EndWhile
Return (sOut)
#EndFunction

:skip_udfurldecodestr_1
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurldecodestr_2",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurldecodestr_2

#DefineFunction udfUrlDecodeStr_2 (sString)
If (sString=="") Then Return (sString)

sGoodChars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;/?:@=&$-_.+!*'(),"
sHexChars = "0123456789ABCDEF"

iStrLen = StrLen(sString)
sOut = ""
i = 1
While (i<=iStrLen)
   sChar = StrSub(sString,i,1)
   If !StrScan(sGoodChars,sChar,1,@FWDSCAN)
      ; if ((sChar==Num2Char(37)) && (i<=(iStrLen-2)))
      iByte = StrIndex(sHexChars,StrUpper(StrSub(sString,i+1,1)),0,@FWDSCAN)-1
      iByte = (iByte<<4)+StrIndex(sHexChars,StrUpper(StrSub(sString,i+2,1)),0,@FWDSCAN)-1
      sOut = StrCat(sOut,Num2Char(iByte))
      i = i+3
      ; endif
   Else
      sOut = StrCat(sOut,sChar)
      i = i+1
   EndIf
EndWhile
Return (sOut)
#EndFunction

:skip_udfurldecodestr_2
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurldecodestr_3",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurldecodestr_3

#DefineFunction udfUrlDecodeStr_3 (sString)
If (sString=="") Then Return (sString)

sPct = "%%" ; The Percent sign.
iPos = 0
While 1
   iPos = StrIndex(sString,sPct,1+iPos,@FWDSCAN)
   If !iPos Then Break
   sHi = StrSub(sString,iPos+1,1)
   sLo = StrSub(sString,iPos+2,1)
   iHi = Char2Num(StrUpper(sHi))-48
   iLo = Char2Num(StrUpper(sLo))-48
   sChar = Num2Char(((iHi-7*(iHi>9))<<4)+(iLo-7*(iLo>9)))
   sString = StrReplace(sString,StrCat(sPct,sHi,sLo),sChar)
EndWhile
Return (sString)
#EndFunction

:skip_udfurldecodestr_3
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodestrall_1",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodestrall_1

#DefineFunction udfUrlEncodeStrAll_1 (sString)
If (sString=="") Then Return (sString)
sPct = "%%" ; the percent sign

iStrLen = StrLen(sString)
sOut = ""
For i=1 To iStrLen
   iByte = Char2Num(StrSub(sString,i,1))
   sOut = StrCat(sOut,sPct,Num2Char((iByte>>4)+48+7*((iByte>>4)>9)),Num2Char((iByte&15)+48+7*((iByte&15)>9)))
Next
Return (sOut)
; This udf accepts a string and returns the url encoded string
; All characters are treated the same way.
; For example "Hello World" becomes "%48%65%6C%6C%6F%20%57%6F%72%6C%64"
#EndFunction

:skip_udfurlencodestrall_1
;------------------------------------------------------------------------------------------------------------------------------------------

;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfurlencodestrall_2",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfurlencodestrall_2

#DefineFunction udfUrlEncodeStrAll_2 (sString)
If (sString=="") Then Return (sString)
sPct = "%%" ; the percent sign

sTemp = sString
If StrIndex(sTemp,sPct,1,@FWDSCAN)
   sString = StrReplace(sString,sPct,"%%25") ; The percent sign, hex encoded.
   sTemp = StrReplace(sTemp,sPct,"")
EndIf

While (sTemp>"")
   sChar = StrSub(sTemp,1,1)
   iByte = Char2Num(sChar)
   sCharEnc = StrCat(sPct,Num2Char((iByte>>4)+48+7*((iByte>>4)>9)),Num2Char((iByte&15)+48+7*((iByte&15)>9)))
   sString = StrReplace(sString,sChar,sCharEnc)
   sTemp = StrReplace(sTemp,sChar,"")
EndWhile
Return (sString)
; This udf accepts a string and returns the url encoded string
; All characters are treated the same way.
; For example "Hello World" becomes "%48%65%6C%6C%6F%20%57%6F%72%6C%64"
#EndFunction

:skip_udfurlencodestrall_2
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfhtmlencodestr",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfhtmlencodestr

#DefineFunction udfHTMLEncodeStr (sString)
If (sString=="") Then Return (sString)
sString = StrReplace(sString,"<","&#60;")
sString = StrReplace(sString,">","&#62;")
sString = StrReplace(sString,"&","&#38;")
sString = StrReplace(sString,'"',"&#34;")
sString = StrReplace(sString,"{","&#123;")
sString = StrReplace(sString,"}","&#125;")
sString = StrReplace(sString,"ä","&#228;")
sString = StrReplace(sString,"ö","&#246;")
sString = StrReplace(sString,"ü","&#252;")
sString = StrReplace(sString,"Ä","&#196;")
sString = StrReplace(sString,"Ö","&#214;")
sString = StrReplace(sString,"Ü","&#220;")
sString = StrReplace(sString,"ß","&#223;")
Return (sString)
#EndFunction

:skip_udfhtmlencodestr
;------------------------------------------------------------------------------------------------------------------------------------------



;--- test ---

:test11
sString = "Hello World!"
sEncode = udfUrlEncodeStr_3(sString)
sDecode = udfUrlDecodeStr_3(sEncode)
Pause(sString,StrCat(sEncode,@CRLF,sDecode))

:test12
sString = "Hello World!"
sEncode = udfUrlEncodeStrAll_2(sString)
sDecode = udfUrlDecodeStr_3(sEncode)
Pause(sString,StrCat(sEncode,@CRLF,sDecode))



:test2
Display(1,"Demo  UrlEncode/UrlDecode","Creating encoding table, please wait ...")
hBB =  udfUrlEncodeCreateTable()

Display(1,"Demo  UrlEncode/UrlDecode","Writing table to diskfile, please wait ...")
sTempFilename = FileCreateTemp("TMP")
iResult = udfUrlEncodeWriteTable(hBB,sTempFilename)
BinaryFree(hBB)

Display(1,"Demo  UrlEncode/UrlDecode","Reading table from diskfile, please wait ...")
hBB = udfUrlEncodeReadTable(sTempFilename) ; The binary buffer for the test.

; The test routine does not need the physical table file any longer.
FileDelete(sTempFilename)



:test3
AddExtender("WWWSK34i.DLL")

Display(1,"Demo  UrlEncode/UrlDecode","Looptest running, please wait ...")

sTest = `Hello World, that's _my_ [2%%] + <"~more"> or less /../ .`

iLoopMax = 20 ; Adjust it for testing.

For i=1 To 7
   For k=1 To 2
      iTicks%k%%i% = 0
   Next
Next
Exclusive(@ON)
For i=1 To iLoopMax
   iStart = GetTickCount()
   sEncode7 = udfUrlEncodeStrAll_2(sTest)
   iStop = GetTickCount()
   iTicks17 = iTicks17 + iStop-iStart

   iStart = GetTickCount()
   sEncode6 = udfUrlEncodeStrAll_1(sTest)
   iStop = GetTickCount()
   iTicks16 = iTicks16 + iStop-iStart

   iStart = GetTickCount()
   sEncode5 = urlEncode(sTest)
   iStop = GetTickCount()
   iTicks15 = iTicks15 + iStop-iStart

   iStart = GetTickCount()
   sEncode4 = udfUrlEncodeStrByTable(hBB,sTest)    ; Encode using binary buffer table.
   iStop = GetTickCount()
   iTicks14 = iTicks14 + iStop-iStart

   iStart = GetTickCount()
   sEncode3 = udfUrlEncodeStr_3(sTest)
   iStop = GetTickCount()
   iTicks13 = iTicks13 + iStop-iStart

   iStart = GetTickCount()
   sEncode2 = udfUrlEncodeStr_2(sTest)
   iStop = GetTickCount()
   iTicks12 = iTicks12 + iStop-iStart

   iStart = GetTickCount()
   sEncode1 = udfUrlEncodeStr_1(sTest)
   iStop = GetTickCount()
   iTicks11 = iTicks11 + iStop-iStart


   iStart = GetTickCount()
   sDecode5 = urlDecode(sEncode5)
   iStop = GetTickCount()
   iTicks25 = iTicks25 + iStop-iStart

   iStart = GetTickCount()
   sDecode4 = udfUrlDecodeStrByTable(hBB,sEncode4) ; Decode using binary buffer table.
   iStop = GetTickCount()
   iTicks24 = iTicks24 + iStop-iStart

   iStart = GetTickCount()
   sDecode3 = udfUrlDecodeStr_3(sEncode3)
   iStop = GetTickCount()
   iTicks23 = iTicks23 + iStop-iStart

   iStart = GetTickCount()
   sDecode2 = udfUrlDecodeStr_2(sEncode2)
   iStop = GetTickCount()
   iTicks22 = iTicks22 + iStop-iStart

   iStart = GetTickCount()
   sDecode1 = udfUrlDecodeStr_1(sEncode1)
   iStop = GetTickCount()
   iTicks21 = iTicks21 + iStop-iStart
Next
Exclusive(@OFF)

; The test routine does not need the binary buffer any longer.
BinaryFree(hBB)


:result
iTicksMax1 = Max(iTicks11,iTicks12,iTicks13,iTicks14,iTicks15)
iTicksMax2 = Max(iTicks21,iTicks22,iTicks23,iTicks24,iTicks25)
iTicksMax3 = Max(iTicks16,iTicks17)

sMsgTitle = "Demo  udfUrlEncode/Decode  Performancetest"
sMsgText  = ""
sMsgText  = StrCat(sMsgText,"Test11 (Encode Algorithm_1)"    ,@TAB,@TAB,iTicks11,@TAB,100*iTicks11/iTicksMax1,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test12 (Encode Algorithm_2)"    ,@TAB,@TAB,iTicks12,@TAB,100*iTicks12/iTicksMax1,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test13 (Encode Algorithm_3)"    ,@TAB,@TAB,iTicks13,@TAB,100*iTicks13/iTicksMax1,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test14 (Encode Table Algorithm)",@TAB,@TAB,iTicks14,@TAB,100*iTicks14/iTicksMax1,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test15 (Encode WinBatch Extender)"   ,@TAB,iTicks15,@TAB,100*iTicks15/iTicksMax1,"%%",@CR)
sMsgText  = StrCat(sMsgText,@CR)
sMsgText  = StrCat(sMsgText,"Test16 (Encode AllChars_1)"     ,@TAB,@TAB,iTicks16,@TAB,100*iTicks16/iTicksMax3,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test17 (Encode AllChars_2)"     ,@TAB,@TAB,iTicks17,@TAB,100*iTicks17/iTicksMax3,"%%",@CR)
sMsgText  = StrCat(sMsgText,@CR)
sMsgText  = StrCat(sMsgText,"Test21 (Decode Algorithm_1)"    ,@TAB,@TAB,iTicks21,@TAB,100*iTicks21/iTicksMax2,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test22 (Decode Algorithm_2)"    ,@TAB,@TAB,iTicks22,@TAB,100*iTicks22/iTicksMax2,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test23 (Decode Algorithm_3)"    ,@TAB,@TAB,iTicks23,@TAB,100*iTicks23/iTicksMax2,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test24 (Decode Table Algorithm)",@TAB,@TAB,iTicks24,@TAB,100*iTicks24/iTicksMax2,"%%",@CR)
sMsgText  = StrCat(sMsgText,"Test25 (Decode WinBatch Extender)"   ,@TAB,iTicks25,@TAB,100*iTicks25/iTicksMax2,"%%",@CR)

IntControl(28,1,0,0,0)
IntControl(63,200,200,800,700)
AskItemlist(sMsgTitle,sMsgText,@CR,@UNSORTED,@SINGLE)


; Note:
; The native WinBatch routines 'UrlEncode' and 'UrlDecode' are fast because they are extender routine.

; Conclusion:
; Use WinBatch Extender routines as the first choice or alternatively the Algorithm_3 routines.

Exit
;------------------------------------------------------------------------------------------------------------------------------------------



Page Date
2004-05-18
DD-Software
Kapitel zurück / previous Chapter
Main Index
 
Seite zurück / previous page
Backward
Seite vor / next page
Forward
 
Seitenanfang/TopOfPage
Top
Seitenende/EndOfPage
Bottom
MyWbtHelp current version