www.ClassicTW.com
https://mail.black-squirrel.com/

twx203 windows
https://mail.black-squirrel.com/viewtopic.php?f=15&t=13110
Page 1 of 1

Author:  PHX [ Mon Mar 21, 2005 2:16 am ]
Post subject: 

Well this is the first time ive ever worked with data windows so its probably me doin somethin wrong. I can get the window to come up but no data will show in it, and my txt file comes out just fine.

Code:
setvar $sector 11
setvar $file "list.txt"
  window status 100 50 "List Status" ONTOP
  setvar $window "0"
  setwindowcontents status $window

  while ($sector <= SECTORS)
      if (SECTOR.EXPLORED[$sector] = "NO")
          write $file $sector
          gosub :update
        end
      add $sector 1
    end
  goto :end

:update
  add $window 1
  setwindowcontents status $window
  return

:end

Author:  ElderProphet [ Mon Mar 21, 2005 3:30 am ]
Post subject: 

Ok PHX, just a few minor changes. Think of the contents of the display window as a variable. The window contents will be formatted however the info within that variable is formatted. You'll see from the code below that I formatted it so that there are 11 sectors per line in the $window variable. Then, when the script is complete, we display that $window variable in the display window.

Hope it helps,
+EP+

Code:
setvar $sector 11
setvar $file "list.txt"
window status 350 500 "List Status" ONTOP
setvar $window ""

while ($sector <= SECTORS)
   if (SECTOR.EXPLORED[$sector] = "NO")
      write $file $sector
      gosub :update
   end
   add $sector 1
end
goto :end

:update
add $wordsPerLine 1
if ($wordsPerLine > 11)
   setVar $window $window & "*"
   setVar $wordsPerLine 1
end
setVar $window $window & "   " & $sector
return

:end
setwindowcontents status $window
pause

Author:  Kimsanee2 [ Mon Mar 21, 2005 12:13 pm ]
Post subject: 

Something EP didn't say is that all things written to a script window MUST end with a * to display anything.
Kimsanee

Author:  Kimsanee2 [ Mon Mar 21, 2005 12:22 pm ]
Post subject: 

I just remembered. If you'd like to see an example of a script window. d/l my route window over at http://www.grimytrader.com (cheap plug). It's fully commented, so it should help with windows.
Kimsanee

Author:  RammaR [ Tue Mar 22, 2005 1:02 pm ]
Post subject: 

Thanks for the cheap plug!

Author:  Kimsanee2 [ Tue Mar 22, 2005 3:18 pm ]
Post subject: 

well I could't afford an expensive one <G>

Author:  ElderProphet [ Tue Mar 22, 2005 11:24 pm ]
Post subject: 

I've never found that to be the case about * Kimsanee, but I'll give your route display a go. Actually, I thought this was a clever use of script windows. I've often wanted a visual of my path. So props, a good idea.

See, now it is up to 2 cheap plugs :)

+EP+

Author:  Kimsanee2 [ Wed Mar 23, 2005 2:59 am ]
Post subject: 

TY

Author:  Silence [ Wed Mar 23, 2005 4:31 am ]
Post subject: 

oh, and go visit http://www.tw-cabal.com for all your tradewars info needs!




It needed to be done. [:D]

Author:  PHX [ Fri Apr 01, 2005 1:48 am ]
Post subject: 

Sorry EP but I took Kimsanee's fix before trying yours and it worked just fine. SO see the simplest answer is usually the correct one. No it doesn't have to be the only correct answer but it was certainly the quickest fix.

Thanks to both of you. Id be lost in the sauce otherwise.

Author:  PHX [ Fri Apr 01, 2005 1:52 am ]
Post subject: 

OH yeah btw, the script I was writing that I wanted to know this for is now posted on The Grimy Trader. With updates to follow probably soon.....my turn to make a cheap plug. heh

Sector List Generator 3.0

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/