Answered Does Opsys Function Return Ms-dos Anymore?

progdev1

Member
Hi folks,
I am re-writing an old program. The code is similar to the below. I know that op-sys can be overridden manually but I don't think that this applies in this case. I always assumed opsys only returned ms-dos for windows 3.1 and earlier machines; basically ever since Windows 95, it always returned win-32. I assume that the opsys function does not return ms-dos anymore? Does anyone know if that is correct?

Also in terms of windows 64 bit, everything I can find so far say that opsys does not return win64 at all, is anyone else aware that this is incorrect?
Just curious.

Code:
if opsys = "win32" then do:
    result = session:set-wait-state("").
    run _osprint.p (input ?, input ip-filename, input 100, input 1, input 0, input 0, output vlPrinted).
end.
if opsys = "msdos" then do:
    run setorientation.p (input 2).
    run _osprint.p (input ?, input ip-filename, input 100, input 1, input 0, input 0, output vlPrinted).
    run setorientation.p (input 1).
end.
else if opsys = "unix" then
    unix silent value("qprt " + trim(ip-filename)).
 

RealHeavyDude

Well-Known Member
You don't mention which version of Progress/OpenEdge you are working with.

In any recent version of OpenEdge the opsys function will always only return "win32" for any Windoze or "unix" for any *nix. Whether this is incorrect might be subject to discussion. Nevertheless for me this information was always sufficient. I say was, because nowadays - in the light of the os-command statement - I hardly ever need it.

Basically if you need to find out the bitness of the operating system you need to call the corresponding operating system API that can tell you. Nevertheless I don't thank that the bitness of the operating system should matter much - but your milage may vary. Do you have a particular reason to know the bitness of the operating system?

Heavy Regards, RealHeavyDude.
 

Osborne

Active Member
I don't know if this is any help, but a setting in the ini file can affect things. If in the ini file you have OPSYS=MSDOS for [WinChar Startup], I find the following gives MSDOS on Progress 10.2B 32-bit with both Windows 7 64-bit and Windows XP 32-bit when running a character client:
Code:
DISPLAY OPSYS.
Without the entry in the ini file I get WIN32.
 

TheMadDBA

Active Member
Osborne is correct... MSDOS is only returned for Windows Character clients (from the INI).

In 11.3 or higher you can use PROCESS-ARCHITECTURE to determine if you are running 32 or 64 bit Progress. As far as I know you would have to call OS functions to know about the OS version, but the important part would almost always be the Progress version.
 

progdev1

Member
Very good point regarding the Progress Version. In my case the progress version 102B. I assumed incorrectly that opsys always returned a value based on the windows operating system version. But now I see the value returned is actually based on the Progress version. This is good to know and thanks.

I am tidying up an old program, and I am deleting some of the old code. I wanted to remove the setion [ if opsys = "msdos" then do: ]. I have progress under a number of different os environments here. The couple I tested all returned win32. I posed the question in case there was any possible way I could end up getting ms-dos or anything else (say win64) as a value. Basically I was just seeing that removing the old code (if opsys = "ms-dos") would not cause any issues. I will check the ini files as a precaution. But thank you that pretty much asnwered my question.
 

RealHeavyDude

Well-Known Member
One can learn something new every day. Didn't know that the opsys functions can depend on a setting in the progress.ini. I hardly ever use a progress.ini for ChUI as we don't have one on Windoze.

Heavy Regards, RealHeavyDude.
 
Top