Jump to content
Sign in to follow this  
Marius

variables...

Recommended Posts

Marius

:evil:

Hello all!

I have one interesting question... Let's say I have variable $var.

And now I need that AutoIt check if there's any " in variable and if there's then before them add /". So result should be /""

Is it possible to do it? :)


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
Marius

sorry... wrong forum. Maybe any mod could put this in right forum?


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
Jos

sorry... wrong forum. Maybe any mod could put this in right forum?

<{POST_SNAPBACK}>

why ? this is the support forum so is the right place.

To answer your question: check the helpfile for the StringReplace() command...


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Marius

it's already been moved :)


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
Marius

what I need to write for stringreplace to search for " ?

Because stringreplace won't recognize " as text. :)


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
Jos

what I need to write for stringreplace to search for "   ?

Because stringreplace won't recognize " as text.  :)

<{POST_SNAPBACK}>

Something like ?:

StringReplace($var,'"','/""')
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Marius

YES! It works! I didn't even knew, that I can use ' instead of "

Thank You.


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
Jos

YES! It works! I didn't even knew, that I can use ' instead of "

Thank You.

<{POST_SNAPBACK}>

this works as well:

StringReplace($var,"""","/""""")

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Marius

ok. now a bigger one:

;---------

$super = 0

For i=1 to 5

If GUICtrlRead($additional1) <> ""

$super = $super + 1

EndIf

Next

;---------

I want that "for" used $additional1, then $additional2, $additional3 and so on.

I can't use:

If GUICtrlRead($additional & $i)

What should I do?


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
Valuater

like this...

For $i=1 to 5

If GUICtrlRead($additiona[$i]) <> ""

$super = $super + 1

EndIf

Next

you may need to add " dim $additiona[6] " to the beginning of the script

enjoy

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Marius

Tried but no effect. It shows me that $super is 0

Edited by Marius

Marius back in da hood! :)

Share this post


Link to post
Share on other sites
therks

For $i=1 to 5
  If GUICtrlRead(Eval('additional' & $i)) <> ""
    $super = $super + 1
  EndIf
Next

Share this post


Link to post
Share on other sites
Marius

Whow!!! This one works. Thanks :) Topic can be closed :evil:


Marius back in da hood! :)

Share this post


Link to post
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
Sign in to follow this  

×