| 
| 
| 
| #201252 - 2010-12-22 08:01 AM  Chr0 and Null |  
| Allen   KiX Supporter
 
       
 Registered:  2003-04-19
 Posts: 4562
 Loc:  USA
 | 
Okay... I know that Chr(0) is a no no in Kix... but with the following code, I'm wondering if it is working.  I also tried creating a Null function.  Would someone smarter than me look at this and provide your thoughts?
 
 
? vartypename($chr0)
? val($chr0)
$chr0=chr0()
? vartypename($chr0)
? "[" + $chr0 + "]"
? val($chr0)
? "__________________________"
? vartypename($null)
? val($null)
$null=null()
? vartypename($null)
? "[" + $null + "]"
? val($null)
 
 
function Chr0()
    dim $sc
    $sc = CreateObject("ScriptControl")
    $sc.language = "VBScript"
    $sc.addcode('chr0=chr(0)')
    $sc.run
    $chr0=$sc.codeobject.chr0
endfunction
function Null()
    dim $sc
    $sc = CreateObject("ScriptControl")
    $sc.language = "VBScript"
    $sc.addcode('nul=null')
    $sc.run
    $null=$sc.codeobject.nul
endfunction
 |  
| Top |  |  |  |  
| 
| 
| #201254 - 2010-12-22 08:47 AM  Re: Chr0 and Null
[Re:  Allen] |  
| Allen   KiX Supporter
 
       
 Registered:  2003-04-19
 Posts: 4562
 Loc:  USA
 | 
Add these to the list to check out too...
 
 
function Cbyte($val)
    dim $sc
    $sc = CreateObject("ScriptControl")
    $sc.language = "VBScript"
    $sc.addcode('by=cbyte(' + $val + ')')
    $sc.run
    $cbyte=$sc.codeobject.by
endfunction
function CBool($val)
    dim $sc
    $sc = CreateObject("ScriptControl")
    $sc.language = "VBScript"
    $sc.addcode('bool=cbool(' + $val + ')')
    $sc.run
    $cbool=$sc.codeobject.bool
endfunction
 |  
| Top |  |  |  |  
| 
| 
| #201258 - 2010-12-22 03:52 PM  Re: Chr0 and Null
[Re:  Richard H.] |  
| Allen   KiX Supporter
 
       
 Registered:  2003-04-19
 Posts: 4562
 Loc:  USA
 | 
Hmmmmm 
 "A"+ Chr0 +"B"+Chr0 + "C" ;produces ABC
 "A"+ Chr(0) +"B" + Chr(0) + "C" ; also produces ABC
 
 Now is kixtart just ignoring the Chr(0)?
 
 When you say terminate the string in an environment where it recognizes chr(0)... would that mean something like
 "A"+ Chr0 +"B"+Chr0 + "C" ; produces only A
 
 sigh... (the less better looking one
  ) |  
| Top |  |  |  |  
 Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
 
 | 
| 
 
| 0 registered
and 456 anonymous users online. 
 | 
 |  |