Qbasicnews.com
May 27, 2018, 04:42:05 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Qbasics for Windows  (Read 22273 times)
Opresion
Member
*
Posts: 82


« on: September 19, 2007, 08:49:28 AM »

For a long time, to be able to use big dimensions in the Quickbasic I have been thinking to use the Windows. In some helps it is said that the Quickbasic also can be used for the Windows but never I have known how.

I made a test for a big dimension in the Visual Basics 1, 2 and 3 for Windows:

Code:
Dim Nothing(100, 100, 100) As Integer

The Visual Basics for Windows 1 and 2 respond with the error message: "Subscript Out of Range"; but NOT in the Visual Basic 3.

Making the Link knowledge base I found the next article that I put as the first article:

Determining the Default Exetype Value in Microsoft Link

In this article it is said that, beginning with the version 5.3 of the Link it's possible to create executables for Windows.

Seeing the versions of the several Quickbasics Links in the QBasics Files Dictionary, it can be read that only the Visual Basics for Ms-Dos have the version 5.31.009 to be used for Windows.

I did install the Visbasic Dos.

Now, to create an executable for the Windows I have been trying the next three steps using the files of the Visbasic Dos:


(Step One).~ The Link, to create an executable, it needs an object file (Test.Obj). The object file (Test.Obj) it is produced by the Basic Compiler using the source file (Test.Bas).

Using the next line in any Basic compiler:

Code:
Dim Nothing(100, 100, 100) As Integer

it responds with the error: "Subscript Out of Range". So that, as a source file I used the next lines in the source file Test.Bas:

Code:
Cls
Input "Put a number for a matrix of 3 dimensions: ", Variable
Dim Test(Variable, Variable, Variable) As Integer
System

In that way it is possible to produce the file Test.Obj.


(Step Two).~ The Link also it needs a definitions file (Test.Def) in the one which you indicate in what operating system you are going to use the executable. The definitions file (Test.Def) only it's a text file. In this case, apparently only it needs to have the next line in this case:

"Exetype Windows"

It is Not necessary to indicate that it is for the Windows 3.0 because that it is defaulted from the Link 5.3, that can be read in the article:

Prb: Link versions 5.03 to 5.2 Require Exetype Windows Stmt.


(Step Three).~ To use the Link to create the executable Test.Exe using the next command line:

Link  Test.Obj, Test.Exe, , , Test.Def

It compiles without any error, but when I run the Test.exe always shows the next error message:

"This program requires Microsoft Windows."

I don't know why it can't detect the Windows.
What is it wrong in all this?
I am using Windows 98SE.
I couldn't test this in a Windows 3.1
« Last Edit: February 01, 2008, 03:57:28 AM by Opresion » Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Opresion
Member
*
Posts: 82


« Reply #1 on: September 19, 2007, 09:05:45 AM »

I also found this next article in the Link knowledge base about that error message:

Prb: Unexpected "This Program Requires Microsoft Windows" Msg

It says that, that error it's present compiling from the Fortran and it is advisable to take out an error produced by the Link using the program Exehdr.exe with the option /Reseterror.

This utility it is in the PDS downloads. I ran this program in the indicated way but I had the same error message.

Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Opresion
Member
*
Posts: 82


« Reply #2 on: September 19, 2007, 09:09:34 AM »

Also I tried interchanging the Ms-Dos versions for the program Test.Exe put in the Setver.exe: 6.22, 4.10, 7.00, 7.10
Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Opresion
Member
*
Posts: 82


« Reply #3 on: September 19, 2007, 09:13:42 AM »

Just for testing I did install the files of the PDS to be able of compiling for OS/2 Protected Mode the Test.Obj file and linking with the Link utility of the Visbasic Dos to get made the Test.Exe but in this case the error message responded was: "This program can not be run in Ms-Dos mode".

I think the message changed because the executable was made for the OS/2 protected mode Not the Dos. That leads me to think that the utility Link it's correct. So, the error must be somewhere else.

Code:
If doubt$ = "This program requires Microsoft Windows." Then
Print "What kind of Windows can be?"
End If
« Last Edit: February 01, 2008, 04:00:27 AM by Opresion » Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Opresion
Member
*
Posts: 82


« Reply #4 on: October 01, 2007, 08:13:53 AM »

I have already tested it in Windows 3.11 without results. I have found that that message it's because the system it's expecting to find a visual program containing forms for Windows.

Using the Visbasic Dos to convert that code in a form with a single command button and using the utilities of the Visbasic Dos like the Projects Translator and the Forms Translator, the program can be easily loaded in the Visbasic 1 for Windows or the 3 just receiving a message that those binary forms will be upgrated to be run.

Using the Visbasic 3 my computer of 128MBS. of Ram could support:

Code:
Dim Anything(200, 200, 200) As Integer

This is not the solution that I want because I have not been looking for a 'Visbasics Dos for Windows' solution but a 'QBasics for Windows' solution. But to test it has been pleasant.

« Last Edit: November 19, 2007, 03:46:47 AM by Opresion » Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Ralph
Ancient Guru
****
Posts: 544


« Reply #5 on: January 10, 2008, 01:56:19 AM »

Opresion:

A few remarks are in order.

First, to test the maximum value of x for a three-dimensioned array in QuickBASIC (QB), I wrote a simple program, which consists of the first five lines of the code below.

When the program is run, I find that the value of i where the array fails is 20, making ARRAY(19,19,19) the maximum array for the stated conditions.

Next, since you are looking for large, three-dimension arrays in QB, and that is not possible, to my knowledge, beyond the above dimension 19, I propose the use of multiple such arrays.  And, to illustrate this, I came up with the following QB program.  Comments?:

Code:
GOTO START:

'Array.bas creates two, 3-dimensional arrays of dimension (19,19,19), which
'is the maximum size of 3-dimension array I could create in my QB4.5, using
'the following code, before it produces a "Subscript out of range" message:
FOR i = 1 TO 100
  REDIM array(i, i, i)
  PRINT i
NEXT i
STOP


START:
'ARRAY.BAS, by Ralph A. Esquivel, 01/09/08, shows how to use two arrays and,
'by extrapolating the program, a large number of such arrays.

CLS
x = 19 'array size to use is (x,x,x), which allows:
'1*6,859 =  6,859 elements for one array
'2*6,859 = 13,718 elemens for two arrays
'etc.

DIM array1(x, x, x) AS DOUBLE
  FOR i = 1 TO x
    FOR j = 1 TO x
      FOR k = 1 TO x
        a = a + 1
        array1(i, j, k) = a
        PRINT array1(i, j, k);
      NEXT k
    NEXT j
  NEXT i
STOP

DIM array2(x, x, x) AS DOUBLE
  FOR i = 1 TO x
    FOR j = 1 TO x
      FOR k = 1 TO x
        a = a + 1
        array2(i, j, k) = a
        PRINT array2(i, j, k);
      NEXT k
    NEXT j
  NEXT i
STOP



« Last Edit: January 10, 2008, 01:59:59 AM by Ralph » Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Ralph
Ancient Guru
****
Posts: 544


« Reply #6 on: January 12, 2008, 04:29:59 PM »

Above, I posted a possible solution to your thoughts on large arrays in QB.  Since then, I have explored farther, and have found that I can create a number (N) of three-dimensional arrays of the type  A(x,x,x), as follows:
             Total # of
   x    N   Elements
 25    5   78125
 24    6   82944
 23    6   73002
 22    7   74536
 21    9   83349
 20  10   80000
 19  12   82308
 18  14   81648
 17  17   83521
 16  20   81920

It would seem safe to assume that just about anybody should be able to approach those levels, which falls short of your desired three-dimensional arrays with x = 100 (1,000,000 elements), and higher, as the most I could get, using my method, would be 78,125 elements using 5 arrays with  x=25 (equivalent to a (42,42,42) array), or  82,944 elements using 6 arrays with x=24 (equivalent to a (43,43,43) aray).
 
However, back in 1986, I had the problem that Bechtel, the engineering company that I worked for, had a requirement for a 100-bus electrical voltage-drop program.  We had a BASIC program we bought from General Electric that was good for 25 busses.  It turned out that there were 4 (or was it 5?) three-dimensional arrays of (bus,bus,bus) size.  I tweeked that program, and got 28 buses maximum!  Finally, I learned of an IBM (or was it MicroSoft?) program that allowed one to use "far memory", which allowed me to convert the original 25-bus program to 120 busses.  Unfortunately, I don't have that program, nor do I remember its name.  Perhaps an intense search could find it?
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Opresion
Member
*
Posts: 82


« Reply #7 on: January 30, 2008, 09:13:46 AM »

I use the PDS. I did try just using the next lines.

Code:
CLS: COLOR 9
FOR iii = 1 TO 24
REDIM array(iii, iii, iii) 'AS STRING
PRINT iii;
NEXT iii
SYSTEM

The results were:
In the QBx: 24 without /AH, 36 with /AH
In the QBx: 21 without /AH, 21 with /AH Redimming As Strings
Compiled: 24 without /AH, 48 with /AH <---
Compiled: 23 without /AH, 23 with /AH  Redimming As Strings
« Last Edit: February 01, 2008, 04:04:43 AM by Opresion » Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Ralph
Ancient Guru
****
Posts: 544


« Reply #8 on: January 30, 2008, 10:58:18 PM »

Opresion:

You report that you managed to create a 3-dimension array(x,x,x), with a maximum value of x of 24 (36 using /ah), while in PDS.  But, for strings, the maximum value of x$ was 21, whether using or not using the /ah switch.  Interestingly, bt understandable, your results indicate that the /ah switch applies only to numeric arrays.

Also, as you have confirmed, QuickBASIC 7.1 (PDS), cannot produce, by itself, 3-dimensioned arrays with more than some 25^3 = 15625 elements (15625*4 = 62,500 bytes) without using /ah, and some 36^3 = 46656 elements (186,624 bytes) using /ah.  Please note that I was able to obtain exactly that number of elements and bytes with 6 arrays, each with an x of 24, or 24^3*6 = 82944 elements = 186,624 bytes. This corresponds, very nearly, to the available memory in the 640K allotted to QuickBASIC programs. 

So, we seem to be butting our heads on the memory available to QuickBASIC 4.5 and PDS.  I still believe we need to link our QB program to another program, that allows using far memory, as I used long ago.

What do you think about the above?  Where can we find such a program to allow using far memory?
« Last Edit: January 30, 2008, 11:13:37 PM by Ralph » Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Opresion
Member
*
Posts: 82


« Reply #9 on: February 01, 2008, 05:05:53 AM »

I still believe we need to link our QB program to another program, that allows using far memory, as I used long ago.

I believe so too.

Where can we find such a program to allow using far memory?

Possibly between asm coders.
Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Ralph
Ancient Guru
****
Posts: 544


« Reply #10 on: February 01, 2008, 08:50:26 PM »

Opresion, here's somethig found on the Internet:
Quote
The big advantage of the PDS over QuickBasic 4.5 is that it has an option to put strings into FAR memory (outside the 64K data segment). This frees up a lot more memory for simple variables and allows you to build much bigger programs.

So, it would seem that your PDS should be able to put strings in far memory.  Perhaps you can use that property to convert a proposed large array into smaller string arrays that you can store in far memory?  What do you think?  I am goingto download PDS and start playing around with it.

As to the program that I used, back in 1987, I remember that in a FOR/NEXT loop, I had to use a transformation of each element of the array I was using before it could be stored in far memory.  I just don't remember the syntax nor the name of the ausiliary program! 
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Ralph
Ancient Guru
****
Posts: 544


« Reply #11 on: February 02, 2008, 02:40:12 AM »

I found still more information on the large array topic.  It seems that if I start qb.exe from the DOS-PROMPT window, using the /ah switch (arrays huge switch), thus:
qb /ah
I can now get an array(43,43,43), corresponding to 43^3 = 79,507 elements = 79,507*4 = 318,028 bytes, again, the available memory for this DOS program.

BUT, I also learned that, for QB7, one can use the metacommand, '$DYNAMIC, to generate arrays in far memory.  So, give it a try!  Me, I'm still looking for qb7.
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Opresion
Member
*
Posts: 82


« Reply #12 on: February 06, 2008, 04:35:57 AM »

So, it would seem that your PDS should be able to put strings in far memory.  Perhaps you can use that property to convert a proposed large array into smaller string arrays that you can store in far memory?  What do you think? 

Apparently there is a limit of 640 Kbs. In my webpage I wrote that that limit can be overpassed but I don't remember where I did read that, possibly it has a relation with the overlays.

I am goingto download PDS and start playing around with it.

Click my signature.

As to the program that I used, back in 1987, I remember that in a FOR/NEXT loop, I had to use a transformation of each element of the array I was using before it could be stored in far memory.

Maybe could be something like converting the numbers to strings, same way as used in this funtions of the Basic
Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Opresion
Member
*
Posts: 82


« Reply #13 on: February 06, 2008, 04:46:56 AM »

...using the /ah switch (arrays huge switch), thus: qb /ah...

The PDS compiler also include the /Fs option for the Far strings.
 
...But, I also learned that, for QB7, one can use the metacommand, '$DYNAMIC, to generate arrays in far memory...

That metacommand also can be seen included in the QB45.

...So, give it a try!  Me, I'm still looking for qb7.

Click here.
« Last Edit: February 06, 2008, 04:58:57 AM by Opresion » Logged

MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Ralph
Ancient Guru
****
Posts: 544


« Reply #14 on: February 06, 2008, 06:48:46 PM »

With respect to qb7.1:  I have downloaded the zip file from three different sources.  Each time, when I try to run the setup.exe file, I get stuck in a screen that asks me to Re-enter Paths and Directories.  The only thing I see that I believe I have to change is the first line, "Source Drive: a:", which I changed to"c:".  Everything proceeds fine, until I get to the point where I press "I" to install 7.1...then, it asks me to insert Disk 1 in drive C:.  I enter "c", for Continue, and I can't proceed!  Do you have any suggestions?  The only reason that I have tried to get 7.1 is to see if I can get the large arrays in far memory...

In QuickBASIC 4.5, when I enter "qb /ah" in the DOS-Prompt command line, I can then create an array,
a(43,43,43)
which has 43^3 = 79507 elments, or 79507*4 (bytes/single-precision element) = 318,028 bytes, just the memory area available to qb 4.5.  I'm hoping that "far memory" refers to a good chunk of the 512 MB of memory in my computer! I hope.
« Last Edit: February 06, 2008, 08:14:00 PM by Ralph » Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!