hello everybody,
i am a newcomer to powerbasic even though i purchased it some time ago
and had it laying on the shelf, like i have the 2 powerbasic for windows compilers
on the shelf right now, but i know they will come in use later.
i wanted to support powerbasic in its ongoing ventures so my programs will be ongoing.
i do not understand much asm or want to use asm code if at all possible to keep
my programs in a stardard code so i can upgrade from powerbasic for dos
to powerbasic for windows later.
i perfer to use compiler builtin functions when possible for compatiblity reasons.
i have read about cell pointers and strptr and all the other powerbasic
functions concerning pointers to strings and still a bit confused on how to accomplish
what i want to write.
in the powerbasic for dos 3.5 users guide on the section of pointers(@)(page 91), i have read about using the
pointers to read the screen fast but also i want to copy(fill,plug) a string from one string to another.
i do not want to write a function(routine) that is called , i want an inline code, but beggers
cannot be chosers.
i just want to copy(fill,plug) characters for one string to another as fast a possible in a program
that i have watching what is displayed on the screen and taking some action if certain information
is displayed on the screen, the program is a tsr that is loaded before a certain program
and unloaded after the program has finished. it will activate every 1 second if there is
no activity by popping down using the POPUP QUIET 18 command for tsr's.
here is what i have so far and it is abbreiated for general purposes
'i initialize this variable in the beginning of my progam
'i never want the variable to be less or more than 2000 characters
CHARACTERSONSCREEN$=SPACE$(2000)
'here is the kicker
'i want to transfer the characters from the screen to the above
'string variable as fast as possible without using any asm code.
'and here is how i do that
'i do this many times in the tsr
'i do not know but i have read that reading the screen with pointers
'is a faster way to go in copying(filling,plugging) of data in powerbasic
DIM J AS INTERGER
DIM I AS INTERGER
' this next line is only placed once in the program
CHARACTERSONSCREEN$=SPACE$(2000)
SAVESCREEN$ = PEEK$(0,4000) ' save the entire screen
J=0
FOR I=0 TO 2000
I=I+1
J=J+1
MID$(CHARACTERSONSCREEN$,J,1)=MID$(SAVESCREEN$,I,1)
NEXT I
also i want to mention, i would also like to transfer(copy,fill,plug) characters
from one string to another fast without using asm code.
the characters from the string being copied may only be a few characters in
length to the total characters in the string and being placed in the
middle of the second string.
maybe somebody out there has already gone through some of this kind of testing for speed
and has some answers for me.
thanks in advance.
ps.
a big thanks to all those who understand asm and help me and others with by suppling your code for
things that might otherswise be unpossible to write in normal(text)source code and for powerbasic having
the ability to easily add asm code into the source code. both are applauded by myself.
------------------
[This message has been edited by paul d purvis (edited October 09, 2003).]
i am a newcomer to powerbasic even though i purchased it some time ago
and had it laying on the shelf, like i have the 2 powerbasic for windows compilers
on the shelf right now, but i know they will come in use later.
i wanted to support powerbasic in its ongoing ventures so my programs will be ongoing.
i do not understand much asm or want to use asm code if at all possible to keep
my programs in a stardard code so i can upgrade from powerbasic for dos
to powerbasic for windows later.
i perfer to use compiler builtin functions when possible for compatiblity reasons.
i have read about cell pointers and strptr and all the other powerbasic
functions concerning pointers to strings and still a bit confused on how to accomplish
what i want to write.
in the powerbasic for dos 3.5 users guide on the section of pointers(@)(page 91), i have read about using the
pointers to read the screen fast but also i want to copy(fill,plug) a string from one string to another.
i do not want to write a function(routine) that is called , i want an inline code, but beggers
cannot be chosers.
i just want to copy(fill,plug) characters for one string to another as fast a possible in a program
that i have watching what is displayed on the screen and taking some action if certain information
is displayed on the screen, the program is a tsr that is loaded before a certain program
and unloaded after the program has finished. it will activate every 1 second if there is
no activity by popping down using the POPUP QUIET 18 command for tsr's.
here is what i have so far and it is abbreiated for general purposes
'i initialize this variable in the beginning of my progam
'i never want the variable to be less or more than 2000 characters
CHARACTERSONSCREEN$=SPACE$(2000)
'here is the kicker
'i want to transfer the characters from the screen to the above
'string variable as fast as possible without using any asm code.
'and here is how i do that
'i do this many times in the tsr
'i do not know but i have read that reading the screen with pointers
'is a faster way to go in copying(filling,plugging) of data in powerbasic
DIM J AS INTERGER
DIM I AS INTERGER
' this next line is only placed once in the program
CHARACTERSONSCREEN$=SPACE$(2000)
SAVESCREEN$ = PEEK$(0,4000) ' save the entire screen
J=0
FOR I=0 TO 2000
I=I+1
J=J+1
MID$(CHARACTERSONSCREEN$,J,1)=MID$(SAVESCREEN$,I,1)
NEXT I
also i want to mention, i would also like to transfer(copy,fill,plug) characters
from one string to another fast without using asm code.
the characters from the string being copied may only be a few characters in
length to the total characters in the string and being placed in the
middle of the second string.
maybe somebody out there has already gone through some of this kind of testing for speed
and has some answers for me.
thanks in advance.
ps.
a big thanks to all those who understand asm and help me and others with by suppling your code for
things that might otherswise be unpossible to write in normal(text)source code and for powerbasic having
the ability to easily add asm code into the source code. both are applauded by myself.
------------------
[This message has been edited by paul d purvis (edited October 09, 2003).]
Comment