Re: gt1 and gt2

new topic     » goto parent     » topic index » view thread      » older message » newer message

David Gay writes:
> Is there anything I can add to or change in these programs to prevent such
> a lockup from happening?

On one machine here your gt1 works fine but your gt2 causes a problem
in mode 256. So I fiddled around with gt2 and found I could eliminate
the problem by removing the statement that switches back to
graphics_mode(-1) before displaying the video parameters. I moved it
to the end of the program. Here's my new version:

----------------------------------------------------------------------
include graphics.e
sequence screen_modes, video_settings
atom counter
integer screen_set_status
screen_modes = {0,1,2,3,4,5,6,7,11,13,14,15,16,17,18,19,256,257,258,259,260,
261,262,263,-999}
counter = 1
while screen_modes[counter] != -999 do
     screen_set_status = graphics_mode(screen_modes[counter])
     if screen_set_status = 0 then
          video_settings = video_config()
          --screen_set_status = graphics_mode(-1) -- REMOVED
          printf(1, "Mode %d supports the following attributes:\n\n",
               {screen_modes[counter]})
          if video_settings[1] = 1 then
               puts(1, "     Has Colour\n")
          else
               puts(1, "     Has No Colour\n")
          end if
          printf(1, "     Has %d text rows and %d text columns\n",
               {video_settings[3], video_settings[4]})
          if video_settings[5] + video_settings[6] > 0 then
               printf(1, "     Has %d pixels across and %d pixels down\n",
                    {video_settings[5], video_settings[6]})
          end if
          printf(1, "     Has %d colours available\n", {video_settings[7]})
          printf(1, "     Has %d display pages accessible\n\n",
               {video_settings[8]})
          puts(1, "Press Any Key To Continue\n")
          while get_key() = -1 do
          end while
     end if
     counter = counter + 1
end while
puts(1, "\n\nProgram Example Completed. Press Any Key To End\n")
while get_key() = -1 do
end while
if graphics_mode(-1) then  -- moved it HERE
end if
------------------------------------------------------------------

I'm not sure why this works, but mode 256 has always given me problems
in a DOS window under Windows 95 on one machine here.
Mode 256 works fine if I reboot Win95 in DOS mode.
I don't know if this change will help on other machines.

Regards,
  Rob Craig
  Rapid Deployment Software

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu