Jump to content

String trouble


VicTT
 Share

Recommended Posts

Func Misc_AddNull($number)
Local $i,$s=""
Debug("Misc_AddNull","StringLen should be "&$number)
for $i=1 to $number
$s=$s&Chr(0)
Debug($s,StringLen($s))
next
Return $s
EndFunc
Func Debug($a,$s)
Msgbox(0,$a,$s)
EndFunc
$s="Whatever"&Misc_AddNull(4)&"Blah"

Why doesn't that work?AutoIt just doesn't seem to want to add nulls to a string..WHAT IS THERE TO BE DONE?

Edited by VicTT
Quote

Together we might liveDivided we must fall

 

Link to comment
Share on other sites

Actually, I asked the question in the Bug Forum AFTER I started a thread here and seen that no one doesn't really care to answer..I'm glad I've been given such an informative first-response..

Quote

Together we might liveDivided we must fall

 

Link to comment
Share on other sites

Actually, I asked the question in the Bug Forum AFTER I started a thread here and seen that no one doesn't really care to answer..I'm glad I've been given such an informative first-response..

Your script is working as expected. you get a binary string of 4 null char.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...