Hi All,
Over the last 20 odd years I've developed a suite of programmes for our business, which handles stock, sales etc.etc. Buy we're now getting the absolute limit of what's possible with QBX Basic 7.1PDS, in that I need large arrays of numbers and strings, whilst it's possible to do everything I want with Basic, I'm spending more and more time just 'getting around' the limitations that I'm coming up against, so I've decided that after owning Powerbasic for nearly 6 years, I'm going to have to bite the bullet and convert all my code.
When I've looked at this in the past, the biggest problem for me was that file handling required Type/End type - the prospect of having to recode ALL my file handling fills me with dread. But I now notice that in the later incarnations (version 4 onwards?) that you can use FIELD, but have to declare the variables used in the field statement as field variables (which I can live with), but I have FIELD statements that have subscripted variables in them.
Is there an easy way to go about converting these, as PBCC complains that the variables are either not dimensioned, or not field variables, dependant on where or if I dimension the string array .
Basically my code is currently:-
FIELD #Filenum%, 10 as a$, 4 as b$, 4 as c$(1), 4 as c$(2), 4 as c$(3), 4 as c$(4), 10 as d$
I realise I could change this to:-
DIM C$(4)
FIELD #Filenum%,10 as a$, 4 as b$, 16 as c$, 10 as d$
and then use a FOR/NEXT loop to populate c$() EG:-
FOR a%=1 to 4
c$(a%)=CVS(MID$(c$,((a%-1)*4)+1,4)
next a%
But I'd much prefer it if there was some way to allow Field variables to cope with subscripts.
I hope I've explained this well enough for you to understand - have I missed something fundamental?
Thanks in advance, John
Over the last 20 odd years I've developed a suite of programmes for our business, which handles stock, sales etc.etc. Buy we're now getting the absolute limit of what's possible with QBX Basic 7.1PDS, in that I need large arrays of numbers and strings, whilst it's possible to do everything I want with Basic, I'm spending more and more time just 'getting around' the limitations that I'm coming up against, so I've decided that after owning Powerbasic for nearly 6 years, I'm going to have to bite the bullet and convert all my code.
When I've looked at this in the past, the biggest problem for me was that file handling required Type/End type - the prospect of having to recode ALL my file handling fills me with dread. But I now notice that in the later incarnations (version 4 onwards?) that you can use FIELD, but have to declare the variables used in the field statement as field variables (which I can live with), but I have FIELD statements that have subscripted variables in them.
Is there an easy way to go about converting these, as PBCC complains that the variables are either not dimensioned, or not field variables, dependant on where or if I dimension the string array .
Basically my code is currently:-
FIELD #Filenum%, 10 as a$, 4 as b$, 4 as c$(1), 4 as c$(2), 4 as c$(3), 4 as c$(4), 10 as d$
I realise I could change this to:-
DIM C$(4)
FIELD #Filenum%,10 as a$, 4 as b$, 16 as c$, 10 as d$
and then use a FOR/NEXT loop to populate c$() EG:-
FOR a%=1 to 4
c$(a%)=CVS(MID$(c$,((a%-1)*4)+1,4)
next a%
But I'd much prefer it if there was some way to allow Field variables to cope with subscripts.
I hope I've explained this well enough for you to understand - have I missed something fundamental?
Thanks in advance, John
Comment