Total players online: 7



Take the Tour | Site Map

It is currently Mon Jan 21, 2019 4:49 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Dec 18, 2018 10:29 pm 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 125

Groups:
The following snippets do not evaluate the logical expression the same.
  1. set %operator >
  2. set %value 100
  3. if 90 %operator %value
  4.  display ok True
  5.  display ok False



  1. set %operator >
  2. set %value 100
  3. while 120 %operator %value
  4.  {
  5.  wait 20
  6.  set %value 50
  7.  }


Any idea why these evaluate differently? I realize these do not take the same action, but when using the F7 step function through the script, the if statement evaluates, but the while statement falls through the first time and never executes the block.

Help!
Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Wed Dec 19, 2018 1:31 am 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 18966
Location: Switzerland

While: It doesnt fall thru for me... Evaluates the condition correctly and executes the wait and the set.
If i change the
set %value 50
to
set %value 500
it correctly executes the while once and the second time it finishes and jumps out.

Using EasyUO 1.5.333

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Wed Dec 19, 2018 8:44 am 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 125

Groups:
Thanks for that info. I was using an array construct for my initial value so that must be what is happening. I will test that later.
Thanks, Orngrimm!

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Wed Dec 19, 2018 2:16 pm 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 125

Groups:
So I am now home and retested what I initially wanted to do... and it worked perfectly - just as you said when you tested the code. I have no idea now what I must have done to get myself into a test which failed. I believe it had to do with trying to build a multidimensional array on the fly in the while condition.

I know I have tried to do that in the past - which also didn't work, but even when i tried what I thought was a simple 1 dimensional array - it didn't work... hence my post. This afternoon it works as I would have expected - so back to more important details.

Thanks for giving me an objective viewpoint on my test!

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Sun Dec 23, 2018 2:12 am 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 18966
Location: Switzerland

You are welcome! :) Thats the purpose of such a forum: Ask questions and get ideas and information. Sometimes solutions even ;)
Glad it got fixed.

On a sidenote: I often do something like
  1. set %temp %arrayname , %dim1 , %dim2 , %dim3
  2. set %temp % . %temp
  3. If %temp > %value
  4. {
  5. ...
  6. }
because i aswell had problems in the past with array-evaluation within a command...

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Hosted by CalWeb Internet Services, Inc.