Why does the instr function in kixtart seems to not work correctly?

Mar 25
2014

Today, I had a problem with a login script specially for Windows 8 users with a microsoft account.

For these, the @userid macro of kixtart returns the full microsoft account, i.e. gregakselrod@outlook.com.

Since I was interested in the part before the @, I wrote the following script part:

$len = instr( @userid, “@” )
if $len == 0
$localuser = @userid
else
$localuser = substr( @userid, 1, $len – 1 )
endif

but it does not worked – $len was 0 all the time.

It seems kixtart interprets the @ character even if quoted. This is the fixed script:

$len = instr( @userid, chr( 64 ) )
if $len == 0
$localuser = @userid
else
$localuser = substr( @userid, 1, $len – 1 )
endif

Comments are closed.