Problem: Variable

11/19/2012 16:57 Ezio534#1
Ich möchte das Scripten lernen. Ich habe ein Problem. Mein Problem ist es, dass ich keine Variablen setzen kann. Mir wurde gesagt, dass ich ein $-Zeichen vor der Variable setzen muss. Damit sie als Variable anerkannt wird. Grundsätzlich verändert sich die Farben, wenn man die Funktion ausführt, aber bei mir verändert sich die Farbe nicht. Was mache ich falsch ? Ich kann sie auch nicht als Variable verwenden. Bsp: $Variable1
Variable1 wird in der Farbe nicht verändert. Und ich kann es nicht definieren.
11/19/2012 17:17 logical691#2
Code would help with the issue but yes variables are normally written like this...

$var = "Hello world"

MsgBox(0, "Title", $var)


$var = "Ezio"
MsgBox(0, "Title", "my name is " & $var)

$var1 = "Hello"
$var2 = "World"
MsgBox(0, "Title", $var1 & $var2)

$var1 = "Hello"
$var2 = "World"
$joined = $var1 & $var2
MsgBox(0, "Title", $joined)
11/19/2012 17:43 Ezio534#3
Quote:
Originally Posted by logical691 View Post
Code would help with the issue but yes variables are normally written like this...)
Why it does not work for me?
I write it, like you said it.
11/19/2012 20:03 RenzoARG#4
could you paste the code itself?
Most of the Autoit Problems are "Typing Errors"
11/19/2012 20:30 logical691#5
Quote:
Originally Posted by Ezio534 View Post
Why it does not work for me?
I write it, like you said it.
So your non working code is that secretive you dont want help? Oh ok, i guess you need to figure out the problem yourself then or hire a coder.
11/19/2012 23:11 RenzoARG#6
Okey... A basic Variable
$secret = "red"
^Var^ ^value^

Whenever you call $secret, what the script really does is call in the value.
For example:
$secret = red

msgbox (0,"blah","your value of $secret is: " & $secret)
^1^ ^2^ ^3^

1: command
2: Variable name inside a string, thi counts as plain text
3: Variable being called, this counts as the value.

Translated: msgbox (0,"blah","your value of $secret is: red")

•••••••••••••••••••••••••••••••••••••••••••••••••• ••••••••

PD: Using messages as a pause is really useful if you want to know step by step whats going on in your script.

That's as much as I can Help guessing what's going on, since it was a common error for me to set a $var in between a string, when I was starting.
11/19/2012 23:36 omer36#7
wenn du sein erstes bsp script ausführen tust, klappt es denn?
wenn ja ist dein problem nur das es nihct farblich dargestellt wird.
google dann mal nach "scite" und lad dir den runter (ist´n editor für au3), soweit ich mich erinnere stellt er auch die sachen farblich dar.
wenn nicht muss tdu mal in den optionen irgendwo schauen, mann konnte einstellen, was in welcher farbe dargestellt werden soll
11/20/2012 14:25 Ezio534#8
Quote:
Originally Posted by omer36 View Post
wenn du sein erstes bsp script ausführen tust, klappt es denn?
wenn ja ist dein problem nur das es nihct farblich dargestellt wird.
google dann mal nach "scite" und lad dir den runter (ist´n editor für au3), soweit ich mich erinnere stellt er auch die sachen farblich dar.
wenn nicht muss tdu mal in den optionen irgendwo schauen, mann konnte einstellen, was in welcher farbe dargestellt werden soll
Mich stört es, dass es nicht farblich angezeigt wird.
Ich lerne seit gesten zu Skripten.
Zur Visualisierung wäre es besser, wenn es farblich dargestellt wird.
11/20/2012 16:25 logical691#9
I dont speak German, but i see no code has been posted so you obviously dont want help other wise code would be here with the issue and it would be fixed.

The only person stopping you from learning and fixing the issue is you Ezio.
I will not re-check this thread to help, its just wasting my time now.
11/23/2012 00:30 BlueBasHeR#10
Also dein Problem ist, die Farbe ändert sich nicht bei einer VAriable? also du willst es so haben: $Test

Lade dir Scite4AutoIt vllt hast du es bereits ka

Drück CTRL + 1 und dann öffnet sich ein neues fenster
Oben gibt es dann ein tab das heißt "Color Settings" dann zeigt er dir die Schriftarten.. geh unter "Variable"dann in der Reihe auf "Fore" und wähl deine farbe dann Save + Apply und fertig

MfG Blue