Post new topic    
Metal Slime
Send private message
variable shall be set to be = another variable 
 PostSun Sep 01, 2013 7:36 am
Send private message Reply with quote
Hello,
in the following script, I want to set the variable current day equal to system day.
But wether I write "currentday == system day " or "currentday = system day" the compiler does not accept it.
Is there another command to set two variables equal?

Thanks for your help in advance. Smile

Code:
script, determine day, begin
#global variables: set at the beginning of the script collection
#weekday:
## 1 = monday
## 2 = tuesday
## 3 = wednesday
## 4 = thursday
## 5 = friday
## 6 = saturday   
## 7 = sunday
## , tuesday, ect.
#current day # the day from 1 to 31, checks if this number changes, because if it does weekday has to be changes

if (system day <> currentday)
then
   (
   switch (weekday), do
      (
      case  (1) , do # Monday 
         (
         weekday == 2 #Tuesday
         currentday = system day
         )
      case  (2), do     
         (
         weekday == 3 #Wednesday
         currentday = system day
         )
      case  (3), do
           (
         weekday == 4 #Thursday
         currentday == system day
         )
      case  (4), do          
         (
         weekday == 5 #Friday
         currentday == system day
         )         
      case  (5), do
            (
         weekday == 6 #Saturday
         currentday == system day
         )
      case  (6), do       
         (
         weekday == 7 #Sunday
         currentday == system day
         )   
      case  (7), do  #Saturday to Sunday
          (
         weekday == 1 #Monday
         currentday == system day
         )# Sunday to Monday
   )   
)
end
Metal King Slime
Send private message
 
 PostSun Sep 01, 2013 1:32 pm
Send private message Reply with quote
Current day == system day is a question, not a declaration. I think what you're trying to do is tell it something, so you'd want to use

Code:
current day := systemday


Which would set a variable you had previously defined as "currentday" to the value returned by the "systemday" function.

I'm not sure what you're trying to do with Weekday == 2, 3, etc. in the same script, since the switch statement is already asking that. You can probably just get rid of that line. [/code]
Display posts from previous: