Jump to content

String Function


Markir
 Share

Recommended Posts

Hmm I dont understand why? I use the same regkey and it work for me. Here's what i used:

$VmApl = Regread("HKEY_CURRENT_USER\test\01", "ParamBlock")
;$VmApl = "RoutDev=400-403 TrunkDev=9601-9630 PlayDev=792,793,794,795 PickTimeout=15 PickHome=20"

$array = stringSplit($VmApl, " ", 0)

for $e = 1 to ($array[0])

    msgBox(0, "Display element " & $e, $array[$e] )

next
AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Link to comment
Share on other sites

  • Replies 49
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I figured out why. Hold on while try to work it out

Edit: if you look at the binary data for the REG_MULTI_SZ value, it has each character in hex followed by a zero. Then there are two zeros seperating each part of your string. regedit sees that space as 0x0000.

I haven't been able to seperate them using stringSplit(). I will keep trying other ideas.

EDIT: I got it to work with a @LF. I guess i shoulda tried that first :)

$VmApl = Regread("HKEY_CURRENT_USER\VMApl\01", "ParamBlock")
;$VmApl = "RoutDev=400-403 TrunkDev=9601-9630 PlayDev=792,793,794,795 PickTimeout=15 PickHome=20"

$array = stringSplit($VmApl, @LF, 0)

for $e = 1 to ($array[0])

    msgBox(0, "Display element " & $e, $array[$e] )

next
Edited by steveR
AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Link to comment
Share on other sites

Hello StevR,

this works fine now. Thank you for all and have a good evening

ONE last question, is it possible that the value "PlayDev=" will be not displayed, but the value "792,793,794,795"???

Edited by Markir
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

This should return just the values:

$VmApl = Regread("HKEY_CURRENT_USER\VMApl\01", "ParamBlock")
;$VmApl = "RoutDev=400-403 TrunkDev=9601-9630 PlayDev=792,793,794,795 PickTimeout=15 PickHome=20"

$array = stringSplit($VmApl, @LF, 0)

;~ for $e = 1 to ($array[0])

;~     msgBox(0, "Display element " & $e, $array[$e] )

;~ next

for $e = 1 to $array[0]
    
    $value = StringTrimLeft($array[$e], StringInStr($array[$e], "="))
    msgBox(0, "Display element value " & $e, $value)

next
Edited by steveR
AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Link to comment
Share on other sites

I have one question for the following script:

Another Question:

Okay I have download the Beta Version and now it functioned. But I have one question about your code:

There is one more problem.... :-(

ONE last question, is it possible that the value "PlayDev=" will be not displayed, but the value "792,793,794,795"???

one last question about it:

Look familiar, are you sure its the last question? Why don't you, instead of compacting all you 'last questions' into one topic, create a new topic, this way people will actually bother to read what you have to say and may actually reply instead of getting sick or seeing and reading the same thing over and over and over again.

Like this.

How can I integrated your Code to my Code?

Why does nobody help me, to solve my problem?

have you any idea, how I can realise it?

BTW the 3 above posts were all consecutive, get my point...?

Edit: This is just from one of your topics. Not including the other ones were you also demand answers instead of trying something for yourself and getting other people to write your script for you.

Edited by Burrup

qq

Link to comment
Share on other sites

Okay your code works,

one last question about it:

Now I want to display the first value on a msgbox and not the others after them

Do you know what I mean?

<{POST_SNAPBACK}>

Each element of the array contains a seperate value. Just pick the one you want. And don't use a loop.
AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
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...