Hello everyone,
We are attempting to convert a program from Basic to PB and we are having a few problems that I hope you will have some answers to...
The program has been in use for a long time and has grown quite a lot over the years. It now has near 1000 sources files (Basic & Assembly). So the following questions might have simple solutions but keep in mind that the less we have to significantly modify, the better considering the size of this program.
1 - Compile errors
I'm currently converting a small part of the program (it uses about 100 of the 1000 units) to PB and VISION. I created five forms with the help of Workshop to give it a new look (it has to remain a « pure » DOS program, no 32 bit).
When I compile only the code generated from Workshop (no code behind buttons, etc), it compiles OK.
However, when I add the original code (converted to PB format of course) then the problems begin. Now, when I attemp to compile, my computer locks up and the reset button is the only thing I can use. Once, the compilation got throught without freezing the computer, but gave me the following error:
"String too big"
(There was no error number)
What does this mean? How can I know what "String" it's referring to?
Another compilation gave me an error 517 so I tried compiling my program to a pure DOS machine but resulted in the same ending(freeze). Whatever I use, (Win 95 console, DOS mode in WIN95, pure DOS environment with more exp/ext memory) it freezes most of the time or gives me this "string too big" error message.
I would like to hear your thoughts on the source of this problem as I’m out of ideas...
2 - Segments
We are using CODE SEG in all our units as it exceeds the 64K limitations(Error 408). When the compilation is done, it gives us how many segments and how much space they use. Is there a way to know what CODE SEG statement is associated with what segment size? Also, is there a way to know how many space takes our variables so we can know how far/close we are to the 64K variable limitation (error 409)?
3 - Parameters in fct/sub
Is there any way to pass more than 16 parameters to a function or sub? Our current program have a number of sub that passes much more that 16 parameters (a few one have as much as 40 or more wich Basic allowed). The only solution that we thought about is to make all those variables PUBLIC/EXTERNAL but we would like to know if there is another way of doing this so we can leave all the parameters as is...
4 - TYPE and Strings in subs
I'm trying to pass a variable member of a TYPE into a sub like this:
In the main program
TYPE TestA
Var1 AS STRING
Var2 AS STRING * 8
END TYPE
In a unit:
DIM TypeA AS TESTA
call MySub (TypeA.Var1, TypeA.Var2, Var3$)
In another unit:
SUB MYSUB (SubVar1$, SubVar2$, SubVar3$) PUBLIC
[…treatment…]
END SUB
Var1/SubVar1$ and Var2/SubVar2 both gives me a parameter mismatch when I try to pass them BYREF. How can this be? True the string is part of a TYPE but it's still a string right? Does the language considers a varialble in a TYPE an expression? Passing it BYVAL generates no errors but we can’t pass those variables this way as the value has to change wihtin the called sub. We can’t exactly redefine the parameter in the sub either because it’s not always a TYPE variable that is passed. Most of the time, it’s a variable-lenght string. Passing a fixed-lenght string also generates a parameter mistmatch. Is it possible to declare the parameter in the sub definition so it can accept strings defined in TYPE, fixed-lenght and variable-lenght?
Any input on any of the above questions would be a tremendous help to us.
Thank you for your time,
Randi
We are attempting to convert a program from Basic to PB and we are having a few problems that I hope you will have some answers to...
The program has been in use for a long time and has grown quite a lot over the years. It now has near 1000 sources files (Basic & Assembly). So the following questions might have simple solutions but keep in mind that the less we have to significantly modify, the better considering the size of this program.
1 - Compile errors
I'm currently converting a small part of the program (it uses about 100 of the 1000 units) to PB and VISION. I created five forms with the help of Workshop to give it a new look (it has to remain a « pure » DOS program, no 32 bit).
When I compile only the code generated from Workshop (no code behind buttons, etc), it compiles OK.
However, when I add the original code (converted to PB format of course) then the problems begin. Now, when I attemp to compile, my computer locks up and the reset button is the only thing I can use. Once, the compilation got throught without freezing the computer, but gave me the following error:
"String too big"
(There was no error number)
What does this mean? How can I know what "String" it's referring to?
Another compilation gave me an error 517 so I tried compiling my program to a pure DOS machine but resulted in the same ending(freeze). Whatever I use, (Win 95 console, DOS mode in WIN95, pure DOS environment with more exp/ext memory) it freezes most of the time or gives me this "string too big" error message.
I would like to hear your thoughts on the source of this problem as I’m out of ideas...
2 - Segments
We are using CODE SEG in all our units as it exceeds the 64K limitations(Error 408). When the compilation is done, it gives us how many segments and how much space they use. Is there a way to know what CODE SEG statement is associated with what segment size? Also, is there a way to know how many space takes our variables so we can know how far/close we are to the 64K variable limitation (error 409)?
3 - Parameters in fct/sub
Is there any way to pass more than 16 parameters to a function or sub? Our current program have a number of sub that passes much more that 16 parameters (a few one have as much as 40 or more wich Basic allowed). The only solution that we thought about is to make all those variables PUBLIC/EXTERNAL but we would like to know if there is another way of doing this so we can leave all the parameters as is...
4 - TYPE and Strings in subs
I'm trying to pass a variable member of a TYPE into a sub like this:
In the main program
TYPE TestA
Var1 AS STRING
Var2 AS STRING * 8
END TYPE
In a unit:
DIM TypeA AS TESTA
call MySub (TypeA.Var1, TypeA.Var2, Var3$)
In another unit:
SUB MYSUB (SubVar1$, SubVar2$, SubVar3$) PUBLIC
[…treatment…]
END SUB
Var1/SubVar1$ and Var2/SubVar2 both gives me a parameter mismatch when I try to pass them BYREF. How can this be? True the string is part of a TYPE but it's still a string right? Does the language considers a varialble in a TYPE an expression? Passing it BYVAL generates no errors but we can’t pass those variables this way as the value has to change wihtin the called sub. We can’t exactly redefine the parameter in the sub either because it’s not always a TYPE variable that is passed. Most of the time, it’s a variable-lenght string. Passing a fixed-lenght string also generates a parameter mistmatch. Is it possible to declare the parameter in the sub definition so it can accept strings defined in TYPE, fixed-lenght and variable-lenght?
Any input on any of the above questions would be a tremendous help to us.
Thank you for your time,
Randi
Comment